Revision: 201033 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 31 Aug 2010 16:04:40 +0300
branchRCL_3
changeset 21 09b1ac925e3f
parent 20 63339781d179
child 22 03674e5abf46
Revision: 201033 Kit: 201035
boottimeintegritycheck/TrkDummy/group/TrkDummy.mmp
boottimeintegritycheck/TrkDummy/group/TrkDummy1.mmp
boottimeintegritycheck/TrkDummy/group/TrkDummy2.mmp
cpsecplugins/common.pri
cpsecplugins/cpadvancedsecplugin/group/advancedsecplugin.pri
cpsecplugins/cpadvancedsecplugin/group/advancedsecplugin.pro
cpsecplugins/cpadvancedsecplugin/inc/cpcertdatacontainer.h
cpsecplugins/cpadvancedsecplugin/inc/cpcertdetailview.h
cpsecplugins/cpadvancedsecplugin/inc/cpcertmanuisyncwrapper.h
cpsecplugins/cpadvancedsecplugin/inc/cpcertpluginloader.h
cpsecplugins/cpadvancedsecplugin/inc/cpcerttrustview.h
cpsecplugins/cpadvancedsecplugin/inc/cpcertview.h
cpsecplugins/cpadvancedsecplugin/inc/cpmoduleview.h
cpsecplugins/cpadvancedsecplugin/inc/cpsecmodmodel.h
cpsecplugins/cpadvancedsecplugin/inc/cpsecmodsyncwrapper.h
cpsecplugins/cpadvancedsecplugin/inc/cpsecmoduleinfoview.h
cpsecplugins/cpadvancedsecplugin/inc/cpsecmodview.h
cpsecplugins/cpadvancedsecplugin/inc/cpsecurityview.h
cpsecplugins/cpadvancedsecplugin/inc/cpuitrustids.h
cpsecplugins/cpadvancedsecplugin/rom/advancedsecurity_resources.iby
cpsecplugins/cpadvancedsecplugin/rom/cpsecplugins.iby
cpsecplugins/cpadvancedsecplugin/rom/cpsecplugins_rom.pri
cpsecplugins/cpadvancedsecplugin/src/cpcertdatacontainer.cpp
cpsecplugins/cpadvancedsecplugin/src/cpcertdetailview.cpp
cpsecplugins/cpadvancedsecplugin/src/cpcertmanuisyncwrapper.cpp
cpsecplugins/cpadvancedsecplugin/src/cpcertpluginloader.cpp
cpsecplugins/cpadvancedsecplugin/src/cpcerttrustview.cpp
cpsecplugins/cpadvancedsecplugin/src/cpcertview.cpp
cpsecplugins/cpadvancedsecplugin/src/cpmoduleview.cpp
cpsecplugins/cpadvancedsecplugin/src/cpsecmodmodel.cpp
cpsecplugins/cpadvancedsecplugin/src/cpsecmodsyncwrapper.cpp
cpsecplugins/cpadvancedsecplugin/src/cpsecmoduleinfoview.cpp
cpsecplugins/cpadvancedsecplugin/src/cpsecmodview.cpp
cpsecplugins/cpadvancedsecplugin/src/cpsecurityview.cpp
cpsecplugins/cpplugincommon.pri
cpsecplugins/cpsecplugins.pro
cpsecplugins/devicelockplugin/devicelocking.ts
cpsecplugins/devicelockplugin/devicelockplugin.pri
cpsecplugins/devicelockplugin/devicelockplugin.pro
cpsecplugins/devicelockplugin/devicelockplugin_installer.pkg
cpsecplugins/devicelockplugin/qmakepluginstubs/devicelockplugin.qtplugin
cpsecplugins/devicelockplugin/rom/devicelockplugin.iby
cpsecplugins/devicelockplugin/rom/devicelockplugin_resources.iby
cpsecplugins/devicelockplugin/rom/devicelockplugin_rom.pri
cpsecplugins/devicelockplugin/secuidevicelockplugin_installer.pkg
cpsecplugins/devicelockplugin/src/cpdevicelockplugin.cpp
cpsecplugins/devicelockplugin/src/cpdevicelockplugin.h
cpsecplugins/devicelockplugin/src/cpdevicelockpluginview.cpp
cpsecplugins/devicelockplugin/src/cpdevicelockpluginview.h
cpsecplugins/devicelockplugin/src/cpremotelockdataformviewitem.cpp
cpsecplugins/devicelockplugin/src/cpremotelockdataformviewitem.h
cpsecplugins/devicelockplugin/src/debug.h
cpsecplugins/inc/cpsecplugins.h
cpsecplugins/simpincodeplugin/inc/cppincodeplugin.h
cpsecplugins/simpincodeplugin/inc/cppincodepluginview.h
cpsecplugins/simpincodeplugin/inc/seccodeedit.h
cpsecplugins/simpincodeplugin/inc/seccodeeditdataformviewitem.h
cpsecplugins/simpincodeplugin/inc/seccodemodel.h
cpsecplugins/simpincodeplugin/inc/seccodemodel_p.h
cpsecplugins/simpincodeplugin/inc/seccodesettings.h
cpsecplugins/simpincodeplugin/inc/seccodeuiglobal.h
cpsecplugins/simpincodeplugin/pincodeplugin.pri
cpsecplugins/simpincodeplugin/pincodeplugin.pro
cpsecplugins/simpincodeplugin/rom/pincodeplugin.iby
cpsecplugins/simpincodeplugin/rom/pincodeplugin_rom.pri
cpsecplugins/simpincodeplugin/src/cppincodeplugin.cpp
cpsecplugins/simpincodeplugin/src/cppincodepluginview.cpp
cpsecplugins/simpincodeplugin/src/seccodeedit.cpp
cpsecplugins/simpincodeplugin/src/seccodeeditdataformviewitem.cpp
cpsecplugins/simpincodeplugin/src/seccodemodel.cpp
cpsecplugins/simpincodeplugin/src/seccodemodel_symbian.cpp
cpsecplugins/simpincodeplugin/src/seccodemodel_win.cpp
cpsecplugins/simpincodeplugin/src/seccodesettings.cpp
devencdiskutils/DevEncCommonUtils/src/DevEncDiskUtils.cpp
devencdiskutils/DevEncCommonUtils/src/DevEncKeyUtils.cpp
gba/gbaapi/group/gba.mmp
gba/gbafilter/group/httpfiltergba.mmp
gba/gbaserver/group/gbaserver.mmp
gba/gbaserver/inc/dataretriever.h
gba/gbaserver/src/dataretriever.cpp
gba/sis/gba.pkg
gba/sis/gba_stub.pkg
gba/sis/gba_stub.sis
gba/uicc/group/gbauicc.mmp
layers.sysdef.xml
package_definition.xml
package_map.xml
pkiutilities/CTSecurityDialogs/Group/CTSecDialogImpl.mmp
pkiutilities/CTSecurityDialogs/Group/bld.inf
pkiutilities/CTSecurityDialogs/NotifInc/CTNoTrustQuery.h
pkiutilities/CTSecurityDialogs/NotifInc/CTSecurityDialogsAO.h
pkiutilities/CTSecurityDialogs/NotifInc/CTUntrustedCertQuery.h
pkiutilities/CTSecurityDialogs/NotifSrc/CTCertificateQuery.cpp
pkiutilities/CTSecurityDialogs/NotifSrc/CTInvalidCertNote.cpp
pkiutilities/CTSecurityDialogs/NotifSrc/CTNoTrustQuery.cpp
pkiutilities/CTSecurityDialogs/NotifSrc/CTPinPinQueryDialog.cpp
pkiutilities/CTSecurityDialogs/NotifSrc/CTQueryDialog.cpp
pkiutilities/CTSecurityDialogs/NotifSrc/CTSecurityDialogsAO.cpp
pkiutilities/CTSecurityDialogs/NotifSrc/CTSelectcertificatedialog.cpp
pkiutilities/CTSecurityDialogs/NotifSrc/CTSigntextdialog.cpp
pkiutilities/CTSecurityDialogs/NotifSrc/CTUntrustedCertQuery.cpp
pkiutilities/CTSecurityDialogs/NotifSrc/CTpinquerydialog.cpp
pkiutilities/CTSecurityDialogs/data/CTsecdlgs.rss
pkiutilities/CTSecurityDialogs/ecomsrc/CTSecDlgWrapper.cpp
pkiutilities/CTSecurityDialogs/loc/wmlbrowser_wim.loc
pkiutilities/CertSaver/data/CertSaver.rss
pkiutilities/CertSaver/group/CertSaver.mmp
pkiutilities/CertSaver/inc/CertSaverModel.h
pkiutilities/CertSaver/loc/certsaver.loc
pkiutilities/CertSaver/src/CertSaverAppUi.cpp
pkiutilities/CertSaver/src/CertSaverDocument.cpp
pkiutilities/CertSaver/src/CertSaverModel.cpp
pkiutilities/CertSaver/src/certparser.cpp
pkiutilities/CertmanUi/INC/CertmanuiCommon.h
pkiutilities/CertmanUi/INC/CertmanuiKeeper.h
pkiutilities/CertmanUi/INC/CertmanuicontainerTrust.h
pkiutilities/CertmanUi/INC/Certmanuitrustids.h
pkiutilities/CertmanUi/SRC/CertmanuiCertificateHelper.cpp
pkiutilities/CertmanUi/SRC/CertmanuiKeeper.cpp
pkiutilities/CertmanUi/SRC/CertmanuicontainerAuthority.cpp
pkiutilities/CertmanUi/SRC/CertmanuicontainerDevice.cpp
pkiutilities/CertmanUi/SRC/CertmanuicontainerPersonal.cpp
pkiutilities/CertmanUi/SRC/CertmanuicontainerTrust.cpp
pkiutilities/CertmanUi/SRC/CertmanuicontainerTrustedSite.cpp
pkiutilities/CertmanUi/SRC/Certmanuidialogs.cpp
pkiutilities/CertmanUi/SRC/CertmanuiviewAuthority.cpp
pkiutilities/CertmanUi/SRC/CertmanuiviewPersonal.cpp
pkiutilities/CertmanUi/SRC/CertmanuiviewTrust.cpp
pkiutilities/CertmanUi/data/certmanui.rss
pkiutilities/CertmanUi/loc/certmanui.loc
pkiutilities/PKCS12/CrPkcs12/group/crpkcs12.mmp
pkiutilities/SecModUI/src/SecModUIViewAccess.cpp
pkiutilities/SecModUI/src/SecModUIViewSignature.cpp
pkiutilities/StubSIS/swipolicy.ini
pkiutilities/StubSIS/tlsproviderpolicy.ini
pkiutilities/group/bld.inf
pkiutilities/pkiutilities.pro
pkiutilities/rom/CTSecurityDialogs.iby
pkiutilities/rom/StubSIS.iby
pkiutilities/securitydialognotifier/data/20031DB3.rss
pkiutilities/securitydialognotifier/group/bld.inf
pkiutilities/securitydialognotifier/group/securitydialognotifier.mmp
pkiutilities/securitydialognotifier/inc/securitydialognotifier.h
pkiutilities/securitydialognotifier/inc/securitydialognotifiersrv.h
pkiutilities/securitydialognotifier/inc/securitydialogs.h
pkiutilities/securitydialognotifier/inc/securitydialogstrace.h
pkiutilities/securitydialognotifier/rom/securitydialognotifier.iby
pkiutilities/securitydialognotifier/src/securitydialogmain.cpp
pkiutilities/securitydialognotifier/src/securitydialognotifier.cpp
pkiutilities/securitydialognotifier/src/securitydialognotifiersrv.cpp
pkiutilities/securitydialognotifier/src/securitydialogs.cpp
pkiutilities/securitydialognotifier/tsrc/srvauthfaildlglauncher/srvauthfaildlglauncher.cpp
pkiutilities/securitydialognotifier/tsrc/srvauthfaildlglauncher/srvauthfaildlglauncher.h
pkiutilities/securitydialognotifier/tsrc/srvauthfaildlglauncher/srvauthfaildlglauncher.iby
pkiutilities/securitydialognotifier/tsrc/srvauthfaildlglauncher/srvauthfaildlglauncher.pkg
pkiutilities/securitydialognotifier/tsrc/srvauthfaildlglauncher/srvauthfaildlglauncher.pro
pkiutilities/securitydialognotifier/tsrc/srvauthfaildlglauncher/srvauthfaildlglaunchermain.cpp
pkiutilities/securitydialognotifier/tsrc/srvauthfaildlglauncher/testCerts/IntermediateCert.cer
pkiutilities/securitydialognotifier/tsrc/srvauthfaildlglauncher/testCerts/RootCert.cer
pkiutilities/securitydialognotifier/tsrc/srvauthfaildlglauncher/testCerts/ServerCert1.cer
pkiutilities/securitydialognotifier/tsrc/srvauthfaildlglauncher/testCerts/ServerCert2_noCN.cer
pkiutilities/securitydialognotifier/tsrc/srvauthfaildlglauncher/testCerts/ServerCert3_exp.cer
pkiutilities/securitydialognotifier/tsrc/srvauthfaildlglauncher/testCerts/ServerCert4_exp2.cer
pkiutilities/securitydialognotifier/tsrc/srvauthfaildlglauncher/testCerts/ServerCert5_alg.cer
pkiutilities/securitydialognotifier/tsrc/srvauthfaildlglauncher/testCerts/ServerCert6_key.cer
pkiutilities/securitydialognotifier/tsrc/srvauthfaildlglauncher/testCerts/ServerCert8_aia.cer
pkiutilities/securitydialognotifier/tsrc/srvauthfaildlglauncher/testCerts/ServerCert9_san.cer
pkiutilities/securitydialognotifier/tsrc/srvauthfaildlglauncher/testCerts/SevverCert7_ocsp.cer
pkiutilities/securitydialognotifiersrv/group/bld.inf
pkiutilities/securitydialognotifiersrv/group/securitydialognotifiersrv.mmp
pkiutilities/securitydialognotifiersrv/inc/securitydialognotifierserver.h
pkiutilities/securitydialognotifiersrv/inc/securitydialognotifierservername.h
pkiutilities/securitydialognotifiersrv/inc/securitydialognotifiersession.h
pkiutilities/securitydialognotifiersrv/inc/securitydialogoperation.h
pkiutilities/securitydialognotifiersrv/inc/securitydialogoperationobserver.h
pkiutilities/securitydialognotifiersrv/inc/securitydialogoperserverauthfail.h
pkiutilities/securitydialognotifiersrv/inc/securitydialogstrace.h
pkiutilities/securitydialognotifiersrv/inc/untrustedcertquery.h
pkiutilities/securitydialognotifiersrv/rom/securitydialognotifiersrv.iby
pkiutilities/securitydialognotifiersrv/src/securitydialognotifierserver.cpp
pkiutilities/securitydialognotifiersrv/src/securitydialognotifierservermain.cpp
pkiutilities/securitydialognotifiersrv/src/securitydialognotifiersession.cpp
pkiutilities/securitydialognotifiersrv/src/securitydialogoperation.cpp
pkiutilities/securitydialognotifiersrv/src/securitydialogoperserverauthfail.cpp
pkiutilities/securitydialognotifiersrv/src/untrustedcertquery.cpp
pkiutilities/untrustedcertificatedialog/inc/untrustedcertificatedefinitions.h
pkiutilities/untrustedcertificatedialog/inc/untrustedcertificatedialog.h
pkiutilities/untrustedcertificatedialog/inc/untrustedcertificateinfo_symbian.h
pkiutilities/untrustedcertificatedialog/inc/untrustedcertificateinfobase.h
pkiutilities/untrustedcertificatedialog/inc/untrustedcertificateplugin.h
pkiutilities/untrustedcertificatedialog/inc/untrustedcertificatewidget.h
pkiutilities/untrustedcertificatedialog/rom/untrustedcertdialog.iby
pkiutilities/untrustedcertificatedialog/rom/untrustedcertdialog_resources.iby
pkiutilities/untrustedcertificatedialog/src/untrustedcertificatedialog.cpp
pkiutilities/untrustedcertificatedialog/src/untrustedcertificateinfo_symbian.cpp
pkiutilities/untrustedcertificatedialog/src/untrustedcertificateinfobase.cpp
pkiutilities/untrustedcertificatedialog/src/untrustedcertificateplugin.cpp
pkiutilities/untrustedcertificatedialog/src/untrustedcertificatewidget.cpp
pkiutilities/untrustedcertificatedialog/src/untrustedcertificatewidget_symbian.cpp
pkiutilities/untrustedcertificatedialog/tsrc/dialoglauncher/ctc_instrument_code.bat
pkiutilities/untrustedcertificatedialog/tsrc/dialoglauncher/ctc_remove_instrumentation.bat
pkiutilities/untrustedcertificatedialog/tsrc/dialoglauncher/dialoglauncher.cpp
pkiutilities/untrustedcertificatedialog/tsrc/dialoglauncher/dialoglauncher.h
pkiutilities/untrustedcertificatedialog/tsrc/dialoglauncher/dialoglauncher.iby
pkiutilities/untrustedcertificatedialog/tsrc/dialoglauncher/dialoglauncher.pkg
pkiutilities/untrustedcertificatedialog/tsrc/dialoglauncher/dialoglauncher.pro
pkiutilities/untrustedcertificatedialog/tsrc/dialoglauncher/dialoglaunchermain.cpp
pkiutilities/untrustedcertificatedialog/tsrc/dialoglauncher/test_cert_expired.crt
pkiutilities/untrustedcertificatedialog/tsrc/dialoglauncher/test_cert_server.crt
pkiutilities/untrustedcertificatedialog/tsrc/dialoglauncher/test_cert_sha2.crt
pkiutilities/untrustedcertificatedialog/tsrc/tlsconntest/tlsconnection.cpp
pkiutilities/untrustedcertificatedialog/tsrc/tlsconntest/tlsconnection.h
pkiutilities/untrustedcertificatedialog/tsrc/tlsconntest/tlsconnectionapp.cpp
pkiutilities/untrustedcertificatedialog/tsrc/tlsconntest/tlsconnectionapp.h
pkiutilities/untrustedcertificatedialog/tsrc/tlsconntest/tlsconnectionmain.cpp
pkiutilities/untrustedcertificatedialog/tsrc/tlsconntest/tlsconnectionobserver.h
pkiutilities/untrustedcertificatedialog/tsrc/tlsconntest/tlsconntest.iby
pkiutilities/untrustedcertificatedialog/tsrc/tlsconntest/tlsconntest.loc
pkiutilities/untrustedcertificatedialog/tsrc/tlsconntest/tlsconntest.pkg
pkiutilities/untrustedcertificatedialog/tsrc/tlsconntest/tlsconntest.pro
pkiutilities/untrustedcertificatedialog/untrustedcertificateplugin.pro
pkiutilities/x509certnameparser/group/X509CertNameParser.mmp
remotelock/RemoteLockEngine/Src/RemoteLock.cpp
secsrv_plat/devenccommonutils_api/inc/DevEncDiskUtils.h
secsrv_plat/devicelock_access_api/group/ABLD.BAT
secsrv_plat/keyguard_access_api/group/ABLD.BAT
secsrv_plat/lockapp_server_api/group/ABLD.BAT
secsrv_plat/security_code_ui_api/inc/SecUi.h
secsrv_plat/security_code_ui_api/inc/SecUiCodeQueryDialog.h
secsrv_plat/security_code_ui_api/inc/SecUiSecurityHandler.h
secsrv_plat/security_code_ui_api/inc/SecUiSecuritySettings.h
securitydialogs/Autolock/Autolock.loc
securitydialogs/Autolock/Autolock.pro
securitydialogs/Autolock/Autolock.qrc
securitydialogs/Autolock/Autolock.rss
securitydialogs/Autolock/Autolock_reg.rss
securitydialogs/Autolock/Autolock_reg.rss.back
securitydialogs/Autolock/Autolock_template.pkg
securitydialogs/Autolock/CenRep/AutolockPrivateCRKeys.h
securitydialogs/Autolock/Keyguard_enabled.svg
securitydialogs/Autolock/PubSub/SecurityUIsPrivatePSKeys.h
securitydialogs/Autolock/aif/Autolockaif.rss
securitydialogs/Autolock/autolock.qcrml
securitydialogs/Autolock/autolockuseractivityservice.pro
securitydialogs/Autolock/autolockuseractivityservice/autolockuseractivityservice.pri
securitydialogs/Autolock/autolockuseractivityservice/autolockuseractivityservice.pro
securitydialogs/Autolock/autolockuseractivityservice/autolockuseractivityservice_s60.pri
securitydialogs/Autolock/autolockuseractivityservice/autolockuseractivityservice_stub.pri
securitydialogs/Autolock/autolockuseractivityservice/bld.inf
securitydialogs/Autolock/autolockuseractivityservice/bwins/autolockuseractivityserviceu.def
securitydialogs/Autolock/autolockuseractivityservice/common.pri
securitydialogs/Autolock/autolockuseractivityservice/eabi/autolockuseractivityserviceu.def
securitydialogs/Autolock/autolockuseractivityservice/inc/autolockuseractivityservice.h
securitydialogs/Autolock/autolockuseractivityservice/inc/autolockuseractivityservice_global.h
securitydialogs/Autolock/autolockuseractivityservice/inc/autolockuseractivityserviceinterface.h
securitydialogs/Autolock/autolockuseractivityservice/s60/inc/autolockuseractivityservice_p.h
securitydialogs/Autolock/autolockuseractivityservice/s60/src/autolockuseractivityservice_p.cpp
securitydialogs/Autolock/autolockuseractivityservice/src/autolockuseractivityservice.cpp
securitydialogs/Autolock/autolockuseractivityservice/stub/inc/autolockuseractivityservice_p.h
securitydialogs/Autolock/autolockuseractivityservice/stub/src/autolockuseractivityservice_p.cpp
securitydialogs/Autolock/bld.inf
securitydialogs/Autolock/bwins/autolockuseractivityserviceu.def
securitydialogs/Autolock/conf/autolock.confml
securitydialogs/Autolock/conf/autolock_102824AE.crml
securitydialogs/Autolock/data/Autolock.rss
securitydialogs/Autolock/data/Autolock_reg.rss
securitydialogs/Autolock/eabi/autolockuseractivityserviceu.def
securitydialogs/Autolock/group/Autolock.mmp
securitydialogs/Autolock/group/Autolock_Icons_dc.mk
securitydialogs/Autolock/group/bld.inf
securitydialogs/Autolock/iconnotifier.svg
securitydialogs/Autolock/inc/AutoKeyguardCenRepI.h
securitydialogs/Autolock/inc/AutoKeyguardObserver.h
securitydialogs/Autolock/inc/AutoLockCenRepI.h
securitydialogs/Autolock/inc/AutoLockLockObserverPS.h
securitydialogs/Autolock/inc/AutoLockModelPS.h
securitydialogs/Autolock/inc/AutoLockValueObserverPS.h
securitydialogs/Autolock/inc/AutolockApp.h
securitydialogs/Autolock/inc/AutolockAppUiInterface.h
securitydialogs/Autolock/inc/AutolockAppUiPS.h
securitydialogs/Autolock/inc/AutolockContainer.h
securitydialogs/Autolock/inc/AutolockDocument.h
securitydialogs/Autolock/inc/AutolockFpsStatusObserver.h
securitydialogs/Autolock/inc/AutolockGripStatusObserver.h
securitydialogs/Autolock/inc/AutolockView.h
securitydialogs/Autolock/inc/AutolockWait.h
securitydialogs/Autolock/inc/autolock.hrh
securitydialogs/Autolock/indicatorplugin/qmakepluginstubs/indicatorautolockplugin.qtplugin
securitydialogs/Autolock/indicatorplugin/rom/indicatorautolockplugin.iby
securitydialogs/Autolock/loc/autolock.loc
securitydialogs/Autolock/qtg_large_device_lock.svg
securitydialogs/Autolock/resources/Keyguard_enabled_test.svg
securitydialogs/Autolock/resources/iconnotifier.svg
securitydialogs/Autolock/resources/qtg_large_device_lock.svg
securitydialogs/Autolock/rom/Autolock.iby
securitydialogs/Autolock/rom/AutolockResources.iby
securitydialogs/Autolock/rom/AutolockSrv.iby
securitydialogs/Autolock/service_conf.xml
securitydialogs/Autolock/service_conf_new.xml
securitydialogs/Autolock/service_conf_old_format.xml
securitydialogs/Autolock/src/AutoKeyGuardCenRepI.cpp
securitydialogs/Autolock/src/AutoKeyguardObserver.cpp
securitydialogs/Autolock/src/AutoLockCenRepI.cpp
securitydialogs/Autolock/src/AutoLockLockObserver.cpp
securitydialogs/Autolock/src/AutoLockModel.cpp
securitydialogs/Autolock/src/AutoLockValueObserver.cpp
securitydialogs/Autolock/src/AutoLockView.cpp
securitydialogs/Autolock/src/Autolock.cpp
securitydialogs/Autolock/src/Autolock.h
securitydialogs/Autolock/src/Autolock.pri
securitydialogs/Autolock/src/AutolockApp.cpp
securitydialogs/Autolock/src/AutolockAppUi.cpp
securitydialogs/Autolock/src/AutolockContainer.cpp
securitydialogs/Autolock/src/AutolockDocument.cpp
securitydialogs/Autolock/src/AutolockFpsStatusObserver.cpp
securitydialogs/Autolock/src/AutolockGripStatusObserver.cpp
securitydialogs/Autolock/src/AutolockWait.cpp
securitydialogs/Autolock/src/lockapp.hrh
securitydialogs/Autolock/src/main.cpp
securitydialogs/SecUi/BWinsCw/SECUI_EKA2U.def
securitydialogs/SecUi/EABI/Secuiu.def
securitydialogs/SecUi/GSSimSecPlugin/Data/10207438.rss
securitydialogs/SecUi/GSSimSecPlugin/Data/GSSimSecPluginRsc.rss
securitydialogs/SecUi/GSSimSecPlugin/GSSimSecPlugin.mmp
securitydialogs/SecUi/GSSimSecPlugin/Inc/GSPubSubsListener.h
securitydialogs/SecUi/GSSimSecPlugin/Inc/GSSimSecPlugin.h
securitydialogs/SecUi/GSSimSecPlugin/Inc/GSSimSecPlugin.hrh
securitydialogs/SecUi/GSSimSecPlugin/Inc/GSSimSecPlugin.rh
securitydialogs/SecUi/GSSimSecPlugin/Inc/GSSimSecPluginContainer.h
securitydialogs/SecUi/GSSimSecPlugin/Inc/GSSimSecPluginModel.h
securitydialogs/SecUi/GSSimSecPlugin/Inc/MGSSettingPSObserver.h
securitydialogs/SecUi/GSSimSecPlugin/Src/GSPubSubsListener.cpp
securitydialogs/SecUi/GSSimSecPlugin/Src/GSSimSecPlugin.cpp
securitydialogs/SecUi/GSSimSecPlugin/Src/GSSimSecPluginContainer.cpp
securitydialogs/SecUi/GSSimSecPlugin/Src/GSSimSecPluginImplementationTable.cpp
securitydialogs/SecUi/GSSimSecPlugin/Src/GSSimSecPluginModel.cpp
securitydialogs/SecUi/GSSimSecPlugin/loc/gssecurity.loc
securitydialogs/SecUi/Inc/SecQueryUi.h
securitydialogs/SecUi/Inc/SecUiAutoLockSettingPage.h
securitydialogs/SecUi/Inc/SecUiRemoteLockSettingPage.h
securitydialogs/SecUi/Inc/SecUiWait.h
securitydialogs/SecUi/Src/SecQueryUi.cpp
securitydialogs/SecUi/Src/SecUi.cpp
securitydialogs/SecUi/Src/SecUiAutoLockSettingPage.cpp
securitydialogs/SecUi/Src/SecUiCodeQueryControl.cpp
securitydialogs/SecUi/Src/SecUiCodeQueryDialog.cpp
securitydialogs/SecUi/Src/SecUiManualSecuritySettings.cpp
securitydialogs/SecUi/Src/SecUiRemoteLockSettingPage.cpp
securitydialogs/SecUi/Src/SecUiSecurityHandler.cpp
securitydialogs/SecUi/Src/SecUiSecuritySettings.cpp
securitydialogs/SecUi/Src/SecUiSystemLock.cpp
securitydialogs/SecUi/Src/SecUiWait.cpp
securitydialogs/SecUi/group/SecUi.mmp
securitydialogs/SecUi/group/bld.inf
securitydialogs/SecUi/rom/GSSimSecPlugin.iby
securitydialogs/SecUi/rom/GSSimSecPluginResources.iby
securitydialogs/Securitynotifier/Group/Securitynotifier.mmp
securitydialogs/Securitynotifier/Src/SecurityNotifier.cpp
securitydialogs/Securitynotifier/Src/Securitynotifierwrapper.cpp
securitydialogs/group/bld.inf
securitydialogs/lockapp/cenrep/AutolockPrivateCRKeys.h
securitydialogs/lockapp/data/lockapp.rss
securitydialogs/lockapp/data/lockapp_reg.rss
securitydialogs/lockapp/group/ABLD.BAT
securitydialogs/lockapp/group/bld.inf
securitydialogs/lockapp/group/lockapp.mmp
securitydialogs/lockapp/group/lockapp_icons_dc.mk
securitydialogs/lockapp/inc/lockapp.hrh
securitydialogs/lockapp/inc/lockappapplication.h
securitydialogs/lockapp/inc/lockappappui.h
securitydialogs/lockapp/inc/lockappbasecontrol.h
securitydialogs/lockapp/inc/lockappcenrepobserver.h
securitydialogs/lockapp/inc/lockappdevicelockcontainer.h
securitydialogs/lockapp/inc/lockappdevicelockcontrol.h
securitydialogs/lockapp/inc/lockappdocument.h
securitydialogs/lockapp/inc/lockappecsdetector.h
securitydialogs/lockapp/inc/lockappecsnote.h
securitydialogs/lockapp/inc/lockappidlecontrol.h
securitydialogs/lockapp/inc/lockappkeycapturecontroller.h
securitydialogs/lockapp/inc/lockappkeyguardcontrol.h
securitydialogs/lockapp/inc/lockappkeypattern.h
securitydialogs/lockapp/inc/lockapplockednote.h
securitydialogs/lockapp/inc/lockappobserverinterface.h
securitydialogs/lockapp/inc/lockappobserverlist.h
securitydialogs/lockapp/inc/lockapppubsubobserver.h
securitydialogs/lockapp/inc/lockappserver.h
securitydialogs/lockapp/inc/lockappsession.h
securitydialogs/lockapp/inc/lockappsleepingnote.h
securitydialogs/lockapp/inc/lockappstatecontrol.h
securitydialogs/lockapp/inc/lockappstatecontrolinterface.h
securitydialogs/lockapp/inc/lockappstateobserver.h
securitydialogs/lockapp/inc/lockappstatepublisher.h
securitydialogs/lockapp/inc/lockapptrace.h
securitydialogs/lockapp/inc/lockapptraceconfiguration.hrh
securitydialogs/lockapp/inc/lockapputils.h
securitydialogs/lockapp/inc/lockappwait.h
securitydialogs/lockapp/loc/lockapp.loc
securitydialogs/lockapp/pubsub/SecurityUIsPrivatePSKeys.h
securitydialogs/lockapp/rom/lockapp.iby
securitydialogs/lockapp/rom/lockappresources.iby
securitydialogs/lockapp/sis/lockapp.pkg
securitydialogs/lockapp/sis/lockapp_stub.sis
securitydialogs/lockapp/sis/make_stubsis.bat
securitydialogs/lockapp/sis/rd-key.pem
securitydialogs/lockapp/sis/rd.cer
securitydialogs/lockapp/src/lockapp.cpp
securitydialogs/lockapp/src/lockappapplication.cpp
securitydialogs/lockapp/src/lockappappui.cpp
securitydialogs/lockapp/src/lockappbasecontrol.cpp
securitydialogs/lockapp/src/lockappcenrepobserver.cpp
securitydialogs/lockapp/src/lockappdevicelockcontainer.cpp
securitydialogs/lockapp/src/lockappdevicelockcontrol.cpp
securitydialogs/lockapp/src/lockappdocument.cpp
securitydialogs/lockapp/src/lockappecsdetector.cpp
securitydialogs/lockapp/src/lockappecsnote.cpp
securitydialogs/lockapp/src/lockappidlecontrol.cpp
securitydialogs/lockapp/src/lockappkeycapturecontroller.cpp
securitydialogs/lockapp/src/lockappkeyguardcontrol.cpp
securitydialogs/lockapp/src/lockappkeypattern.cpp
securitydialogs/lockapp/src/lockapplockednote.cpp
securitydialogs/lockapp/src/lockappobserverlist.cpp
securitydialogs/lockapp/src/lockapppubsubobserver.cpp
securitydialogs/lockapp/src/lockappserver.cpp
securitydialogs/lockapp/src/lockappsession.cpp
securitydialogs/lockapp/src/lockappsleepingnote.cpp
securitydialogs/lockapp/src/lockappstatecontrol.cpp
securitydialogs/lockapp/src/lockappstatepublisher.cpp
securitydialogs/lockapp/src/lockapputils.cpp
securitydialogs/lockapp/src/lockappwait.cpp
securitydialogs/lockclient/eabi/lockclientu.def
securitydialogs/lockclient/group/ABLD.BAT
securitydialogs/lockclient/group/bld.inf
securitydialogs/lockclient/group/bwins/lockclientu.def
securitydialogs/lockclient/group/eabi/lockclientu.def
securitydialogs/lockclient/group/lockclient.pro
securitydialogs/lockclient/inc/lockaccessextension.h
securitydialogs/lockclient/lockclient.pro
securitydialogs/lockclient/rom/lockclient.iby
securitydialogs/lockclient/src/devicelockaccessapi.cpp
securitydialogs/lockclient/src/keyguardaccessapi.cpp
securitydialogs/lockclient/src/lockaccessextension.cpp
securitydialogs/secuinotifications/secuinotificationdialogplugin/inc/secuinotificationcontentwidget.h
securitydialogs/secuinotifications/secuinotificationdialogplugin/inc/secuinotificationdebug.h
securitydialogs/secuinotifications/secuinotificationdialogplugin/inc/secuinotificationdialog.h
securitydialogs/secuinotifications/secuinotificationdialogplugin/inc/secuinotificationdialogplugin.h
securitydialogs/secuinotifications/secuinotificationdialogplugin/inc/secuinotificationdialogpluginkeys.h
securitydialogs/secuinotifications/secuinotificationdialogplugin/resources/cert.svg
securitydialogs/secuinotifications/secuinotificationdialogplugin/resources/drm.svg
securitydialogs/secuinotifications/secuinotificationdialogplugin/resources/qgn_indi_midp_trusted.svg
securitydialogs/secuinotifications/secuinotificationdialogplugin/resources/qgn_menu_am_midlet.svg
securitydialogs/secuinotifications/secuinotificationdialogplugin/resources/qgn_menu_am_sis.svg
securitydialogs/secuinotifications/secuinotificationdialogplugin/resources/qgn_menu_am_widget.svg
securitydialogs/secuinotifications/secuinotificationdialogplugin/resources/qgn_prop_drm_rights_valid.svg
securitydialogs/secuinotifications/secuinotificationdialogplugin/rom/secuinotificationdialogplugin.iby
securitydialogs/secuinotifications/secuinotificationdialogplugin/rom/secuinotificationdialogplugin_resources.iby
securitydialogs/secuinotifications/secuinotificationdialogplugin/secui.ts
securitydialogs/secuinotifications/secuinotificationdialogplugin/secuinotificationdialogplugin.pro
securitydialogs/secuinotifications/secuinotificationdialogplugin/secuinotificationdialogplugin.qcrml
securitydialogs/secuinotifications/secuinotificationdialogplugin/secuinotificationdialogplugin.qrc
securitydialogs/secuinotifications/secuinotificationdialogplugin/src/secuinotificationcontentwidget.cpp
securitydialogs/secuinotifications/secuinotificationdialogplugin/src/secuinotificationdialog.cpp
securitydialogs/secuinotifications/secuinotificationdialogplugin/src/secuinotificationdialogplugin.cpp
securitydialogs/secuinotifications/secuinotifications.pro
securitydialogs/securitydialogs.pro
securitydialogs/simlockui/data/SimLockUI.rss
securitydialogs/simlockui/data/SimLockUI_reg.rss
securitydialogs/simlockui/group/SimLockUI.mmp
securitydialogs/simlockui/group/bld.inf
securitydialogs/simlockui/inc/SimLockDataHandlingDelegate.h
securitydialogs/simlockui/inc/SimLockISAServerDefinitions.h
securitydialogs/simlockui/inc/SimLockTelephonyProxy.h
securitydialogs/simlockui/inc/SimLockUI.hrh
securitydialogs/simlockui/inc/SimLockUI.loc
securitydialogs/simlockui/inc/SimLockUI.pan
securitydialogs/simlockui/inc/SimLockUIApplication.h
securitydialogs/simlockui/inc/SimLockUIAppui.h
securitydialogs/simlockui/inc/SimLockUIBackgroundControl.h
securitydialogs/simlockui/inc/SimLockUIDocument.h
securitydialogs/simlockui/inc/SimLockUiKeys.h
securitydialogs/simlockui/rom/simlockui.iby
securitydialogs/simlockui/rom/simlockui_resources.iby
securitydialogs/simlockui/src/SimLockDataHandlingDelegate.cpp
securitydialogs/simlockui/src/SimLockTelephonyProxy.cpp
securitydialogs/simlockui/src/SimLockUI.cpp
securitydialogs/simlockui/src/SimLockUIApplication.cpp
securitydialogs/simlockui/src/SimLockUIAppui.cpp
securitydialogs/simlockui/src/SimLockUIBackgroundControl.cpp
securitydialogs/simlockui/src/SimLockUIDocument.cpp
securitysrv.pro
sysdef_1_4_0.dtd
sysdef_1_5_1.dtd
wim/Scard/src/ScardReaderRegistry.cpp
wim/WimSoft/armv5/udeb/wimi.lib
wim/WimSoft/armv5/urel/wimi.lib
wim/WimSoft/winscw/udeb/WIMI.LIB
wim/WimSoft/winscw/urel/WIMI.LIB
--- a/boottimeintegritycheck/TrkDummy/group/TrkDummy.mmp	Thu Aug 19 10:45:23 2010 +0300
+++ b/boottimeintegritycheck/TrkDummy/group/TrkDummy.mmp	Tue Aug 31 16:04:40 2010 +0300
@@ -12,7 +12,7 @@
 * Contributors:
 *
 * Description:  Dummy exe to prevent installing too liberal TrkApp
-*  Version     : %version: tr1sido#9 %
+*  Version     : %version: tr1sido#10 %
 *
 */
 
@@ -26,9 +26,9 @@
 // This component is built-in'.
 
 
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
-  #include <platform_paths.hrh>
-#endif
+
+#include <platform_paths.hrh>
+
 
 CAPABILITY      None
 
@@ -45,13 +45,9 @@
 SOURCE          TrkDummy.cpp
 SOURCE          TrkDummyApplication.cpp
 
-USERINCLUDE     ../inc 
-#if defined (__SERIES60_30__) || defined(__SERIES60_31__)
-	SYSTEMINCLUDE	/epoc32/include  
-#else
-    MW_LAYER_SYSTEMINCLUDE    
-#endif
+USERINCLUDE     ../inc
 
+MW_LAYER_SYSTEMINCLUDE    
 
 LIBRARY         euser.lib
 LIBRARY         apparc.lib
--- a/boottimeintegritycheck/TrkDummy/group/TrkDummy1.mmp	Thu Aug 19 10:45:23 2010 +0300
+++ b/boottimeintegritycheck/TrkDummy/group/TrkDummy1.mmp	Tue Aug 31 16:04:40 2010 +0300
@@ -12,7 +12,7 @@
 * Contributors:
 *
 * Description:  Dummy exe to prevent installing too liberal TrkApp
-*  Version     : %version: 7 %
+*  Version     : %version: 8 %
 *
 */
 
@@ -26,9 +26,9 @@
 // This component is built-in'.
 
 
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
-  #include <platform_paths.hrh>
-#endif
+
+#include <platform_paths.hrh>
+
 
 CAPABILITY      None
 
@@ -45,12 +45,9 @@
 SOURCE          TrkDummy.cpp
 SOURCE          TrkDummyApplication.cpp
 
-USERINCLUDE     ../inc 
-#if defined (__SERIES60_30__) || defined(__SERIES60_31__)
-	SYSTEMINCLUDE	/epoc32/include  
-#else
-    MW_LAYER_SYSTEMINCLUDE    
-#endif
+USERINCLUDE     ../inc
+
+MW_LAYER_SYSTEMINCLUDE    
 
 LIBRARY         euser.lib
 LIBRARY         apparc.lib
--- a/boottimeintegritycheck/TrkDummy/group/TrkDummy2.mmp	Thu Aug 19 10:45:23 2010 +0300
+++ b/boottimeintegritycheck/TrkDummy/group/TrkDummy2.mmp	Tue Aug 31 16:04:40 2010 +0300
@@ -12,7 +12,7 @@
 * Contributors:
 *
 * Description:  Dummy exe to prevent installing too liberal TrkApp
-*  Version     : %version: 7 %
+*  Version     : %version: 8 %
 *
 */
 
@@ -26,9 +26,8 @@
 // This component is built-in'.
 
 
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
-  #include <platform_paths.hrh>
-#endif
+
+#include <platform_paths.hrh>
 
 
 CAPABILITY      None
@@ -46,13 +45,9 @@
 SOURCE          TrkDummy.cpp
 SOURCE          TrkDummyApplication.cpp
 
-USERINCLUDE     ../inc 
-#if defined (__SERIES60_30__) || defined(__SERIES60_31__)
-	SYSTEMINCLUDE	/epoc32/include  
-#else
-    MW_LAYER_SYSTEMINCLUDE    
-#endif
+USERINCLUDE     ../inc
 
+MW_LAYER_SYSTEMINCLUDE    
 
 LIBRARY         euser.lib
 LIBRARY         apparc.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/common.pri	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,66 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: controlpanel project - common qmake settings
+#
+
+CONFIG += debug_and_release 
+
+# On win32 and mac, debug and release libraries are named differently.
+# We must follow the debug and release settings Qt was compiled with:
+# build debug iff Qt built debug, build release iff Qt built release.
+
+win32|mac {
+    !contains(QT_CONFIG,debug)|!contains(QT_CONFIG,release) {
+        CONFIG -= debug_and_release debug release
+        contains(QT_CONFIG,debug):  CONFIG+=debug
+        contains(QT_CONFIG,release):CONFIG+=release
+    }
+}
+
+CONFIG(debug, debug|release) {
+    SUBDIRPART = debug
+} else {
+    SUBDIRPART = release
+}
+
+win32 { 
+    DESTDIR = C:/ControlPanel/$$SUBDIRPART/bin
+    OBJECTS_DIR = $$PWD/../$$SUBDIRPART/tmp/$$TARGET
+}
+
+# Add the output dirs to the link path too
+LIBS += -L$$DESTDIR
+
+MOC_DIR = moc
+OBJECT_DIR = obj
+RCC_DIR = rcc
+
+#For some reason the default include path doesn't include MOC_DIR on symbian
+symbian {
+    INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+    INCLUDEPATH += $$MW_LAYER_PLATFORM_EXPORT_PATH(cplogger)
+    INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+    INCLUDEPATH += $$MOC_DIR
+    TARGET.CAPABILITY = ALL -TCB
+    TARGET.EPOCALLOWDLLDATA = 1
+}
+
+INCLUDEPATH += $$PWD/inc
+win32 {
+    # add platfrom API for windows
+    INCLUDEPATH += $$PWD/../../controlpanel/controlpanel_plat/inc
+}
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/cpadvancedsecplugin/group/advancedsecplugin.pri	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,39 @@
+# 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: advancedsecplugin source files
+
+# Input
+HEADERS += ../inc/cpcertdatacontainer.h \
+	../inc/cpcertdetailview.h \
+	../inc/cpcertmanuisyncwrapper.h \
+	../inc/cpcerttrustview.h \
+	../inc/cpcertview.h \
+	../inc/cpcertpluginloader.h \
+	../inc/cpsecurityview.h \
+	../inc/cpuitrustids.h \
+	../inc/cpsecmodview.h \
+	../inc/cpsecmodmodel.h \
+	../inc/cpsecmodsyncwrapper.h \
+	../inc/cpmoduleview.h \
+	../inc/cpsecmoduleinfoview.h
+
+SOURCES += ../src/cpcertdatacontainer.cpp \
+	../src/cpcertdetailview.cpp \
+	../src/cpcertmanuisyncwrapper.cpp \
+	../src/cpcerttrustview.cpp \
+	../src/cpcertview.cpp \
+	../src/cpcertpluginloader.cpp \
+	../src/cpsecurityview.cpp \
+	../src/cpsecmodview.cpp \
+	../src/cpsecmodsyncwrapper.cpp \
+	../src/cpsecmodmodel.cpp \
+	../src/cpmoduleview.cpp \
+	../src/cpsecmoduleinfoview.cpp
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/cpadvancedsecplugin/group/advancedsecplugin.pro	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,58 @@
+
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+TEMPLATE = lib
+TARGET = cpadvancedsecplugin
+
+CONFIG += hb plugin
+
+LIBS += -lcpframework
+
+include ( advancedsecplugin.pri )
+include ( ../rom/cpsecplugins_rom.pri )
+
+symbian: { 
+	TARGET.CAPABILITY = CAP_ECOM_PLUGIN
+	TARGET.UID3 = 0X2002E684
+	INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+	INCLUDEPATH += ../inc
+	TARGET.EPOCALLOWDLLDATA = 1
+	LIBS += -lcertstore
+	LIBS += -lCTFramework
+	LIBS += -lX509
+	LIBS += -lpkixcert
+	LIBS += -lx509certnameparser
+	LIBS += -lhash
+	LIBS += -lcryptography
+	LIBS += -lDevTokenClient
+	LIBS += -lcrypto
+	LIBS += -lefsrv
+
+	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)" 
+	}
+
+TRANSLATIONS= certificate_manager.ts
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/cpadvancedsecplugin/inc/cpcertdatacontainer.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,216 @@
+/*
+* 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:   Declaration of the CCertManUIKeeper class
+*
+*/
+
+#ifndef  CPCERTDATACONTAINER_H
+#define  CPCERTDATACONTAINER_H
+
+// INCLUDES
+#include <unifiedcertstore.h>
+#include <mctwritablecertstore.h>
+#include <unifiedkeystore.h>
+
+// FORWARD DECLARATIONS
+class CpCertManUISyncWrapper;
+class CpCertManUICertData;
+
+// CONSTANTS
+const TUid KCMDeviceCertStoreTokenUid = { 0x101FB668 };
+const TUid KCMDeviceKeyStoreTokenUid = { 0x101FB66A };
+const TUid KCMTrustedServerTokenUid = { 0x101FB66F };
+const TUid KCMFileKeyStoreTokenUid = { 0x101F7333 };
+const TUid KCMFileCertStoreTokenUid = { 0x101F501A };
+
+
+// CLASS DECLARATION
+
+/**
+*  CpCertDataContainer retrieves and holds certificates.
+*
+*/
+class CpCertDataContainer : public CBase
+    {
+    public: // functions
+
+        /**
+        * Default constructor
+        */
+		CpCertDataContainer();
+
+        /**
+        * Destructor.
+        */
+        ~CpCertDataContainer();
+
+        /**
+        * NewL
+        */
+        static class CpCertDataContainer* NewL();
+
+        /**
+        * NewLC
+        */
+        static class CpCertDataContainer* NewLC();
+
+        CUnifiedCertStore*& CertManager();
+
+        CUnifiedKeyStore*& KeyManager();
+
+        /**
+        * Checks that cacerts.dat file is not corrupt
+        * and returns CA certificates from it.
+        */
+        void RefreshCAEntriesL();
+
+        /**
+        * Checks that cacerts.dat file is not corrupt
+        * and returns user certificates from it.
+        */
+        void RefreshUserCertEntriesL();
+
+        /**
+        * Returns peer certificates.
+        */
+        void RefreshPeerCertEntriesL();
+
+        /**
+        * Returns peer certificates.
+        */
+        void RefreshDeviceCertEntriesL();
+
+        /**
+        * Shows error note
+        */
+        void ShowErrorNoteL(TInt aError);
+
+    public: //data
+
+        /**
+        * To store CA certificate entries for Authority and Trust view
+        * Includes label from x509certnameparser.
+        */
+        RMPointerArray<CpCertManUICertData>     iCALabelEntries;
+
+        /**
+        * To store CA certificate entries for Authority and Trust view
+        * Includes label from x509certnameparser.
+        */
+        RMPointerArray<CpCertManUICertData>     iUserLabelEntries;
+
+        /**
+        * To store Peer certificate entries for Trusted Site view
+        * Includes label from x509certnameparser.
+        */
+        RMPointerArray<CpCertManUICertData>     iPeerLabelEntries;
+
+        /**
+        * To store Peer certificate entries for Device certificate view
+        * Includes label from x509certnameparser.
+        */
+        RMPointerArray<CpCertManUICertData>     iDeviceLabelEntries;
+
+        /**
+        * Used to wrap asynchronous calls
+        */
+        CpCertManUISyncWrapper*          iWrapper;
+
+        /**
+        * File session handle.
+        */
+        RFs                             iRfs;
+
+    private: // functions
+
+        void ConstructL();
+
+    private: //data
+
+        /**
+        * To list certificates with criteria.
+        */
+        CCertAttributeFilter*   iFilter;
+
+        /**
+        * To list keys with criteria.
+        */
+
+        TCTKeyAttributeFilter*    iKeyFilter;
+
+        /**
+        * UnifiedCertStore
+        */
+        CUnifiedCertStore*    iStore;
+
+        /**
+        * UnifiedKeyStore
+        */
+        CUnifiedKeyStore*   iKeyStore;
+
+        /**
+        * To store CA certificate entries.
+        */
+        RMPointerArray<CCTCertInfo>     iCAEntries;
+
+        /**
+        * To store User certificate entries.
+        */
+        RMPointerArray<CCTCertInfo>     iUserEntries;
+
+        /**
+        * To store Peer certificate entries.
+        */
+        RMPointerArray<CCTCertInfo>     iPeerEntries;
+
+        /**
+        * To store Device certificate entries.
+        */
+        RMPointerArray<CCTCertInfo>     iDeviceEntries;
+
+        /**
+        * To store Key entries
+        */
+        RMPointerArray<CCTKeyInfo>      iKeyEntries;
+
+   };
+
+/**
+*  Small helper class to put label and certificate in same class.
+*
+*/
+class CpCertManUICertData : public CBase
+    {
+    public:
+
+	CpCertManUICertData();
+
+        void Release();
+
+        HBufC* iCAEntryLabel;
+        HBufC* iUserEntryLabel;
+        HBufC* iPeerEntryLabel;
+        HBufC* iDeviceEntryLabel;
+        CCTCertInfo* iCAEntry;
+        CCTCertInfo* iUserEntry;
+        CCTCertInfo* iPeerEntry;
+        CCTCertInfo* iDeviceEntry;
+
+    private:
+        ~CpCertManUICertData();
+
+    };
+
+
+#endif // CPCERTDATACONTAINER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/cpadvancedsecplugin/inc/cpcertdetailview.h	Tue Aug 31 16:04:40 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:  
+*
+*/
+
+#ifndef CPCERTDETAILVIEW_H
+#define CPCERTDETAILVIEW_H
+
+#include <cpbasesettingview.h>
+#include <cpcertview.h>
+#include <pkixcertchain.h>
+#include <cctcertinfo.h>
+
+class CpCertDataContainer;
+class CX509Certificate;
+class CCertificate;
+class HbListWidget;
+class HbAbstractViewItem;
+class CCTCertInfo;
+
+class QString;
+class QSizeF;
+
+class CpCertDetailView : public CpBaseSettingView
+{
+    Q_OBJECT
+public:
+    explicit CpCertDetailView(	CpCertView::TCertificateViews currentView, TInt pos, 
+										CpCertDataContainer& certDataContainer, 
+										QGraphicsItem *parent = 0 );
+    virtual ~CpCertDetailView();
+    
+private:
+    void viewCertificateDetailsL( TInt index, CpCertView::TCertificateViews type );
+    void validateCertificateL(TInt index, const CCertificate& certDetails, const CCTCertInfo& certInfo, CpCertView::TCertificateViews type );
+    CArrayFixFlat<TValidationError>* validateX509CertificateL( const CX509Certificate& certDetails );
+    TKeyUsagePKCS15 keyUsageAndLocationL( const CCTCertInfo& certEntry, TUid* keyLocation );
+    void setLocationInfo( TBool certificate, TUid locUid, HbListWidget& certDisplayDetails );
+    void divideIntoBlocks( const TDesC8& input, TPtr& output );
+
+    void addToListWidget(	HbListWidget& certDisplayDetails, const QString& data );
+    void addToListWidget(	HbListWidget& certDisplayDetails, 
+							const QString& displayString, const QString& displayDetails );
+        
+    const CCTCertInfo* certInfo( TInt index, CpCertView::TCertificateViews certView );
+    void addTrustedSitesL( const CCertificate& certDetails, HbListWidget& certDisplayDetails);
+    void addLabel( const CCTCertInfo& certInfo, HbListWidget& certDisplayDetails);
+    void addIssuerL( const CCertificate& certDetails, HbListWidget& certDisplayDetails );
+    void addSubjectL( const CCertificate& certDetails, HbListWidget& certDisplayDetails );
+    void addCertUsage( TKeyUsagePKCS15 usage, HbListWidget& certDisplayDetails );
+    void addValidityPeriod( const CCertificate& certDetails, HbListWidget& certDisplayDetails);
+    void setURLLocation( HBufC8& urlDetails, HbListWidget& certDisplayDetails );
+    void addCertFormat( TCertificateFormat certFormat, HbListWidget& certDisplayDetails );
+    void addAlgoDetails( const CCertificate& certificate, HbListWidget& certDisplayDetails );
+    void addSerialNo( const CCertificate& certificate,	HbListWidget& certDisplayDetails );
+    void addFingerprint( const CCertificate& certificate, HbListWidget& certDisplayDetails );
+    void addPublicKeyDetailsL(	const CCertificate& certificate, HbListWidget& certDisplayDetails );
+    QString asymmetricAlgoId( const CCertificate& certificate );
+    
+private:
+   CpCertDataContainer& mCertDataContainer;
+  
+};
+
+#endif // CPCERTDETAILVIEW_H 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/cpadvancedsecplugin/inc/cpcertmanuisyncwrapper.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,319 @@
+/*
+* 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:   Wrapper class for Symbian's Security Framework's calls
+*
+*/
+
+
+#ifndef     CPCERTMANUISYNCWRAPPER_H
+#define     CPCERTMANUISYNCWRAPPER_H
+
+
+// INCLUDES
+#include <e32base.h>
+
+// FORWARD DECLERATIONS
+class CCertificate;
+class CPKIXValidationResult;
+class CPKIXCertChain;
+class CUnifiedCertStore;
+
+// CLASS DECLARATION
+
+/**
+*  Wrapper class for Symbian's Security Framework's calls.
+*  Shows error notes if an error happenes.
+*
+*  @lib certmanui.dll
+*  @since S60 2.0
+*/
+class CpCertManUISyncWrapper : public CActive
+    {
+    public:
+
+        /**
+        * Two-phased constructor.
+        */
+        static CpCertManUISyncWrapper* NewLC();
+
+        /**
+        * Two-phased constructor.
+        */
+        static CpCertManUISyncWrapper* NewL();
+
+        /**
+        * Destructor.
+        */
+        ~CpCertManUISyncWrapper();
+
+    public: // New functions
+
+        /**
+        * TInt ListL
+        * @param aStore reference to store where operation is done.
+        * @param aArray Keys are stored here.
+        * @param aFilter Information on what kind keys are looked.
+        */
+
+        void ListL( CUnifiedKeyStore*& aStore,
+            RMPointerArray<CCTKeyInfo>* aArray,
+            const TCTKeyAttributeFilter& aFilter );
+
+        /**
+        * TInt ListL
+        * @param aStore reference to store where operation is done.
+        * @param aArray Keys are stored here.
+        * @param aFilter Information on what kind keys are looked.
+        * @param aTokenUid Token UID of key store
+        */
+
+        void ListL( CUnifiedKeyStore*& aStore,
+            RMPointerArray<CCTKeyInfo>* aArray,
+            const TCTKeyAttributeFilter& aFilter,
+            const TUid aTokenUid );
+
+        /**
+        * TInt ListL
+        * @param aStore reference to store where operation is done.
+        * @param aArray certificates are stored here.
+        * @param aFilter Information on what kind certificates are looked.
+        */
+        void ListL( CUnifiedCertStore*& aStore,
+            RMPointerArray<CCTCertInfo>* aArray,
+            const CCertAttributeFilter& aFilter );
+
+        /**
+        * TInt ListL
+        * @param aStore reference to store where operation is done.
+        * @param aArray certificates are stored here.
+        * @param aFilter Information on what kind certificates are looked.
+        * @param aTokenUid Token UID of certificate store
+        */
+        void ListL( CUnifiedCertStore*& aStore,
+            RMPointerArray<CCTCertInfo>* aArray,
+            const CCertAttributeFilter& aFilter,
+            const TUid aTokenUid );
+
+
+        /**
+        * TInt GetCertificateL
+        * @param aStore reference to store where operation is done.
+        * @param aCertInfo Certificate that's detailed information is fetched.
+        * @param aCert Fetched certificate.
+        */
+        void GetCertificateL( CUnifiedCertStore*& aStore,
+            const CCTCertInfo& aCertInfo, CCertificate*& aCert );
+
+        /**
+        * TInt GetCertificateL
+        * @param aStore reference to store where operation is done.
+        * @param aCertInfo Certificate that's detailed information is fetched.
+        * @param aCert Fetched certificate.
+        */
+        void GetCertificateL( CUnifiedCertStore*& aStore,
+            const CCTCertInfo& aCertInfo, CCertificate*& aCert, TUid aTokenUid );
+
+
+        /**
+        * TInt GetUrlCertificateL
+        * @param aStore reference to store where operation is done.
+        * @param aCertInfo Certificate that's detailed information is fetched.
+        * @param aUrl Fetched URL.
+        */
+        void GetUrlCertificateL(
+            CUnifiedCertStore*& aStore,
+            const CCTCertInfo& aCertInfo,
+            TDes8& aUrl)            ;
+
+        /**
+        * TInt GetApplicationsL
+        * @param aStore reference to store where operation is done.
+        * @param aCertInfo Certificate that applications are fetched.
+        * @param Certificates applications are stoted here.
+        */
+        void GetApplicationsL( CUnifiedCertStore*& aStore,
+            const CCTCertInfo& aCertInfo, RArray<TUid>& aApps );
+
+        /**
+        * TInt ValidateX509RootCertificateL
+        * @param aValidationResult Result of validation.
+        * @param aValidationTime Time of validation.
+        * @param aChain Chain to be validated.
+        */
+        void ValidateX509RootCertificateL(
+            CPKIXValidationResult*& aValidationResult,
+            const TTime& aValidationTime, CPKIXCertChain*& aChain );
+
+        /**
+        * TInt InitStoreL
+        * @param aStore reference to store to be initialized.
+        */
+        void InitStoreL( CUnifiedCertStore*& aStore );
+
+        /**
+        * void InitStoreL
+        * @param aStore reference to store to be initialized.
+        */
+        void InitStoreL( CUnifiedKeyStore*& aStore );
+
+        /**
+        * TInt DeleteCertL
+        * @param aStore reference to store where operation is done.
+        * @param aCertInfo Certificate to be deleted.
+        */
+        void DeleteCertL( CUnifiedCertStore*& aStore,
+            const CCTCertInfo& aCertInfo );
+
+        /**
+        * TInt DeleteCertL
+        * @param aStore reference to store where operation is done.
+        * @param aCertInfo Certificate to be deleted.
+        */
+        void DeleteCertL( CUnifiedCertStore*& aStore,
+            const CCTCertInfo& aCertInfo,
+            TUid aTokenUid );
+
+        /**
+        * TInt IsApplicableL
+        * @since S60 2.0
+        * @param aStore reference to store where operation is done.
+        * @param aCertInfo Certificate thats applicability is queried.
+        * @param aApplication Application that's status is queried.
+        * @param aIsApplicable ETrue if applcable.
+        * @return TInt Status Symbian's API's call.
+        */
+        TInt IsApplicableL( CUnifiedCertStore*& aStore,
+            const CCTCertInfo& aCertInfo, TUid aApplication,
+        TBool& aIsApplicable );
+
+        /**
+        * TInt IsTrustedL
+        * @since S60 2.0
+        * @param aStore reference to store where operation is done.
+        * @param aCertInfo Certificate that's trust status is queried.
+        * @param aTrusted ETrue if trusted.
+        * @return TInt Status Symbian's API's call.
+        */
+        TInt IsTrustedL( CUnifiedCertStore*& aStore,
+            const CCTCertInfo& aCertInfo, TBool& aTrusted );
+
+        /**
+        * TInt SetApplicabilityL
+        * @param aStore reference to store where operation is done.
+        * @param aCertInfo Certificate thats applicability is set.
+        * @param aApplications New applicability settings.
+        */
+        void SetApplicabilityL( CUnifiedCertStore*& aStore,
+            const CCTCertInfo& aCertInfo,
+            RArray<TUid>& aApplications );
+
+      /**
+        * void MoveCertL
+        * @since S60 3.2
+        * @param aStore reference to store where operation is done
+        * @param aCertInfo Certificate info
+        * @param aSourceStore UID of source certificate store
+        * @param aTargetStore UID of source certificate store
+        * @return TInt Number of moved certificates
+        */
+        TInt MoveCertL( CUnifiedCertStore*& aStore,
+            const CCTCertInfo& aCertInfo,
+            const TUid aSourceTokenId,
+            const TUid aTargetTokenId );
+
+      /**
+        * void MoveKeyL
+        * @param aStore reference to store where operation is done
+        * @param CCTKeyInfo Key info
+        * @param aSourceStore UID of source key store
+        * @param aTargetStore UID of source key store
+        */
+        void MoveKeyL( CUnifiedKeyStore*& aStore,
+            const TCTKeyAttributeFilter& aFilter,
+            const TUid aSourceTokenId,
+            const TUid aTargetTokenId );
+
+        /**
+        * TInt GetInterface
+        * @since S60 3.0
+        * @param aToken reference to token
+        * @param aTokenInterface Pointer to returned interface
+        * @return TInt Status Symbian's API's call.
+        */
+        TInt GetInterface( TUid aRequiredInterface,
+            MCTToken& aToken,
+            MCTTokenInterface*& aReturnedInterface );
+
+    protected:
+
+        void DoCancel();
+        void RunL();
+
+    private:
+
+        CpCertManUISyncWrapper();
+        void ConstructL();
+
+        void HandleErrorL();
+
+    private:    //Data
+
+        // Internal operation states.
+        enum TOperation
+            {
+            EOperationNone,
+            EOperationInit,
+            EOperationList,
+            EGetCertificate,
+            EAddCertificate,
+            ERetriveURLCertificate,
+            EOperationDelete,
+            EOperationGetApps,
+            EOperationIsApplicable,
+            EOperationIsTrusted,
+            EOperationSetApplicability,
+            EOperationSetToTrusted,
+            EOperationValidateX509Root,
+            EShowErrorNote,
+            EOperationInitKeyStore,
+            EOperationKeyList,
+            EOperationGetInterface,
+            EOperationExportKey,
+            EOperationImportKey,
+            EOperationDeleteKey
+            };
+
+        // For wrapping asynchronous calls.
+        CActiveSchedulerWait    iWait;
+
+        // Internal state of operation.
+        TOperation              iOperation;
+
+        // Just for cancelling a operation. Does not own.
+        CUnifiedCertStore*      iStore;
+
+        // Just for cancelling a operation. Does not own.
+        CUnifiedKeyStore*       iKeyStore;
+
+        // Just for cancelling a operation. Does not own.
+        CPKIXCertChain*         iChain;
+
+        // For retrieving a certificate.
+        TPtr8                   iCertPtr;
+
+    };
+
+#endif // CPCERTMANUISYNCWRAPPER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/cpadvancedsecplugin/inc/cpcertpluginloader.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,35 @@
+/*
+ * 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	CPCERTPLUGINLOADER_H
+#define	CPCERTPLUGINLOADER_H
+
+#include <qobject.h>
+#include <cpplugininterface.h>
+#include <QTranslator>
+class CpCertPluginLoader : public QObject, public CpPluginInterface
+{
+    Q_OBJECT
+    Q_INTERFACES(CpPluginInterface)
+public:
+    CpCertPluginLoader();
+    virtual ~CpCertPluginLoader();
+      virtual QList<CpSettingFormItemData*>createSettingFormItemData(CpItemDataHelper &itemDataHelper) const;
+private:
+	  QTranslator* mTranslator;
+};
+
+#endif	//CPCERTPLUGINLOADER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/cpadvancedsecplugin/inc/cpcerttrustview.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,100 @@
+/*
+* 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:   Declaration of the CCertManUIContainerTrust class
+*                Maintains correct list of trusted clients depending
+*                on the certificate that was in focus in Authority
+*                certificates view when Trust Settings view was entered.
+*                Shows and changes correct Yes/No text for the Trusted client.
+*
+*/
+
+
+#ifndef  CPCERTTRUSTVIEW_H
+#define  CPCERTTRUSTVIEW_H
+
+// INCLUDES
+#include <cpbasesettingview.h>
+#include <QList>
+
+// CONSTANTS
+const TInt KTrustSettingsResourceIndexWAP = 0;
+const TInt KTrustSettingsResourceIndexMailAndImageConn = 1;
+const TInt KTrustSettingsResourceIndexAppCtrl = 2;
+const TInt KTrustSettingsResourceIndexJavaInstall = 3;
+const TInt KTrustSettingsResourceIndexOCSPCheck = 4;
+const TInt KTrustSettingsResourceIndexVPN = 5;
+const TInt KTrustSettingsResourceIndexWidget = 6;
+const TInt KTrustSettingsResourceIndexValueYes = 0;
+const TInt KTrustSettingsResourceIndexValueNo = 1;
+
+// FORWARD DECLARATIONS
+class CCertificateAppInfoManager;
+class CpCertDataContainer;
+class TCertificateAppInfo;
+class CCTCertInfo;
+
+class QString;
+
+class HbDataFormModel;
+
+// CLASS DECLARATION
+class CpCertTrustView : public CpBaseSettingView
+    {
+	Q_OBJECT
+	
+	public:
+	    explicit CpCertTrustView( 	TInt certificateIndex,	
+									CpCertDataContainer& certDataContainer,
+									QGraphicsItem *parent = 0 );
+	    virtual ~CpCertTrustView();
+	    void saveTrustSettings();
+	    
+	private:
+	    void viewTrustSettings();
+	    void updateListBoxL();
+	    TInt trustIdIndex( TUid aTrusterUid ) const;
+	    TBool checkCertificateClientTrustL( const TUid clientUid, const CCTCertInfo& entry ) const;
+	    TUid trusterId(const QString& clientDescription) const;
+	    
+	private:
+	    CpCertDataContainer& mCertDataContainer;
+	    /**
+		* Application manager class, used to get applications in system.
+		*/
+		CCertificateAppInfoManager*   mAppInfoManager;
+        
+		/**
+        * Client Uids of the certstore
+        */
+        RArray<TUid> mClientUids;
+
+        /**
+		* To get the names of the trusted clients from the resources
+		*/
+		QList<QString>   mTrustedClients;
+
+		/**
+		* To get the yes/no trust texts from the resources
+		*/
+		QList<QString>   mTrustValues;
+		
+		TInt mCertificateIndex;
+		
+		HbDataFormModel* mFormModel; 
+
+    };
+
+#endif // CPCERTTRUSTVIEW_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/cpadvancedsecplugin/inc/cpcertview.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,96 @@
+/*
+* 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 CPCERTVIEW_H
+#define CPCERTVIEW_H
+
+#include <cpbasesettingview.h>
+
+class HbAbstractViewItem;
+class CpCertDataContainer;
+class CCTCertInfo;
+class HbListView;
+class HbAction;
+class HbDialog;
+class HbMessageBox;
+class CpCertView : public CpBaseSettingView
+	{
+	Q_OBJECT
+	
+	public:
+		explicit CpCertView(const QModelIndex& index, QGraphicsItem *parent = 0);
+		virtual ~CpCertView();
+	
+	public:
+		enum TCertificateViews
+			{
+			EAuthorityView=0,
+			ETrustedView,
+			EPersonalView,
+			EDeviceView			
+			};
+		
+	public slots:
+		void displayPreviousView();
+		
+	private slots:
+		void openCertificate();
+		void openCertFromList(const QModelIndex& modelIndex);
+		void showTrustSettings();
+		void saveTrustSettings();
+		void indicateLongPress(HbAbstractViewItem*, QPointF);
+			
+		void deleteCertificate();
+		TInt refreshListL();
+		void refreshView( TInt aCount );
+		
+		void moveSelectedCert();
+		void deleteList();  
+		void selectAll();
+		void moveCert();
+		void viewDone();
+		void handleMultipleDelete(HbAction* action);
+		void handleMoveDialog(HbAction* action);
+		void handleDeleteDialog(HbAction* action);
+		void handleMoveCertDialog(HbAction* action);
+	private:
+		const CCTCertInfo* certAt(TInt index) const;
+		QString certLabel(TInt index) const;
+		void deleteCertsL( RArray<TInt>& indexList );
+		void setDetails(CpCertView::TCertificateViews currentView);
+		void moveCertList( RArray<TInt>& indexList );
+
+	private:
+		CpCertView::TCertificateViews mCertView;
+		TInt mPos;
+		CpCertDataContainer* mCertDataContainer;
+		TBool mSelectAll;
+		RArray<TInt> mSelectionIndex;
+		RArray<TInt> mIndexList;
+		
+		HbDialog* mPopup;
+		HbView* mPrevView;
+		HbView* mCurrentView;
+		CpBaseSettingView* mRefreshedView;
+		HbListView* mListView;	
+		HbListView* mSelectAllView;	
+		HbView* mOriginalView;
+		HbMessageBox* mNote;
+		HbMenu* mContextMenu;
+	};
+
+#endif /* CPCERTVIEW_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/cpadvancedsecplugin/inc/cpmoduleview.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,75 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0""
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+#ifndef CPMODULEVIEW_H
+#define CPMODULEVIEW_H
+
+#include <cpbasesettingview.h>
+#include "cpsecmodview.h"
+
+class HbAbstractViewItem;
+class CpItemDataHelper;
+class CSecModUIModel;
+class CpSecModView;
+
+class CpModuleView : public CpBaseSettingView
+{
+    Q_OBJECT
+public:
+    explicit CpModuleView( 	CpSecModView::TSecModViews currentView, 
+							CSecModUIModel& secModUIModel,
+							QGraphicsItem *parent = 0 );
+    virtual ~CpModuleView();
+    
+private slots:
+    void handleAccessView( const QModelIndex& modelIndex );
+	void handleAccessView();
+	void handleSigView();
+	void handleSigViewCommand();
+	void indicateLongPress(HbAbstractViewItem *item,QPointF coords);
+   
+private:
+    void showAccessView();
+    void showSignatureView(TBool showBlockedNote);
+
+private:
+    enum TSecModAccessCodeCommandIds
+        {
+        EIndexCodeLabel = 0,
+        EIndexCodeRequest,
+        EIndexCodeStatus 
+        };
+    
+    enum TSecModSignatureCommandIds
+        {
+        ESecModUICmdOpen = 0,
+        ESecModUICmdModuleInfo,
+        ESecModUICmdDelKeyStore,
+        ESecModUICmdChange,
+        ESecModUICmdUnblock,
+        ESecModUICmdClose,    
+        ESecModUICmdAppTest    
+        };
+
+private:
+    CpSecModView::TSecModViews mCurrentView;
+    CSecModUIModel& mSecModUIModel;
+    TInt mPos;
+    HbMenu* mContextMenu;
+};
+
+#endif /* CPMODULEVIEW_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/cpadvancedsecplugin/inc/cpsecmodmodel.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,341 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Declaration of the CSecModUIModel class 
+*
+*/
+
+
+#ifndef CSECMODUIMODEL_H
+#define CSECMODUIMODEL_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <bamdesca.h>
+#include <ct/rmpointerarray.h>
+#include <f32file.h> 
+
+#include <qlist.h>
+#include <qlabel.h>
+#include <qvector.h>
+#include <qpair.h>
+
+class QString;
+class HbListWidget;
+
+// CONSTANTS
+const TInt KMaxSettItemSize = 200;
+
+const TInt KPinGSettIndex = 0;
+const TInt KPinNrSettIndex = 1;
+
+const TUid KUidSecMod = { 0x101F8668 };
+
+// Panic strings
+_LIT(KPanicNullPointer, "SecModUI: invalid pointer");
+_LIT(KPanicIndexOutOfRange, "SecModUI: array indexed out of range");
+
+// FORWARD DECLARATIONS
+class CUnifiedKeyStore;
+class MCTAuthenticationObject;
+class MCTAuthenticationObjectList;
+class CSecModUISyncWrapper;
+class MCTKeyStore;
+class MCTToken;
+
+class QString;
+
+// FUNCTION PROTOTYPES
+GLREF_C void Panic( TInt aPanic );
+
+// CLASS DECLARATION
+
+/**
+*  class CSecModUIModel
+*  Model of the application
+*
+*  @lib SecModUI.lib
+*  @since Series 60 3.0
+*/
+class CSecModUIModel : public CBase
+    {
+    public:  // Constructors and destructLoadTokenLabelsLor
+        
+        /**
+        * Two-phased constructor.
+        */        
+        static CSecModUIModel* NewL();
+                
+        /**
+        * Destructor.
+        */
+        virtual ~CSecModUIModel();
+    
+    public: // New functions
+        /**
+		* Initializes unified keystore
+		*/
+		void InitializeKeyStoreL();
+		
+		/**
+		* Retrieves the description and location of all tokens.        
+		* @return Map containing the label and the appripriate location.
+		*/        
+		QMap<QString,QString> LoadTokenLabelsL();
+		
+		/**
+		* Shows error note if needed.        
+		* @param aError 
+		* @return void
+		*/
+		void ShowErrorNote(TInt aError) const;
+		
+		/**
+		* Retrieves the appropriate token based on the index.        
+		* @param aTokenIndex Index of the token to be opened.
+		* @return void
+		*/
+		void OpenTokenL(TInt aTokenIndex);
+		
+		/**
+		* Initialize the auth objects and return the total count.
+		* @param aItemArray contains localised stings 
+		* @return void
+		*/
+		TInt CheckCodeViewStringsL();
+		
+		/**
+		* Retrieves description of the token based on UID of the current active keystore.                
+		* @return Description
+		*/
+		QString TokenLabelForTitle() const;
+		
+		/**
+		 * Returns status of the selected auth object.
+		 * @param index
+		 * @return status
+		 */
+		TUint32 AuthStatus(TInt aIndex) const;
+		
+		/**
+		* Returns status of the auth object based on its persistent properties set
+		* by security module implementation.        
+		* @param aIndex Index of the authentication object
+		* @param aShowBlockedNote If ETrue, shows code blocked if code is blocked.
+		* @return status of the pin.
+		*/
+		QString PINStatus( TInt aIndex, TBool aShowBlockedNote ) const;
+		
+		/**
+		* Checks whether the Pin is still available.
+		* @param aIndex Index of the authentication object.
+		* @return status
+		*/
+		TBool PinOpen(TInt aIndex) const;
+		
+		/**
+		* Based on the property of auth object the pin can be 
+		* changed or unblocked.        
+		* @param aIndex Index of the auth object
+		* @return ?description
+		*/
+		void ChangeOrUnblockPinL(TInt aIndex);
+		
+		 /**
+		* Changes the value of the PIN.
+		* @param aIndex Index of the AO
+		* @return void
+		*/
+		void ChangePinL(TInt aIndex);
+		
+		/**
+		* Toggles the value of auth object if possible.        
+		* @param ?arg1 ?description
+		* @return ?description
+		*/
+		TInt ChangeCodeRequest(TInt aIndex);
+
+		/**
+		* If the auth object is open then closes it.       
+		* @param aIndex Index of the AO to be closed.
+		* @return void
+		*/
+		void CloseAuthObjL(TInt aIndex);
+	     
+		 /**
+		* Unblocks PIN
+		* @param aIndex Index of the AO
+		* @return void
+		*/
+		void UnblockPinL(TInt aIndex);
+		
+		/**
+		* Deletes key from the appropriate keystore.      
+		* @param aTokenIndex Index of the token to be deleted.
+		* @return ETrue if keystore was deleted.
+		*/
+		void DeleteKeysL(TInt aTokenIndex);
+		 
+		/**
+		* Returns ETrue if PIN is changeable.        
+		* @param aIndex Index of the AO
+		* @return ETrue / EFalse
+		*/
+		TBool PinChangeable(TInt aIndex) const;
+				
+		/**
+		* Displays security module details dialog.        
+		* @param aTokenIndex Index of the token, which details are shown.
+		* @return void
+		*/
+		QVector< QPair<QString,QString> > SecModDetailsL(TInt aTokenIndex);
+		
+		/**
+		* Displays details dialog of the active security module .                        
+		* @return void
+		*/
+		QVector< QPair<QString,QString> > GetSecModDetailsL();
+		
+		/**
+		* Appends the location of the keystore.                        
+		* @return void
+		*/
+		void AppendLocation( QVector< QPair<QString,QString> >& aSecModDetails, 
+							 TUid aLocUid, 
+							 QString aCertDisplayDetails );
+		
+		/**
+		* Appends the value of a label if present otherwise appends empty descriotion.                        
+		* @return void
+		*/
+		void AppendItem( 	QVector< QPair<QString,QString> >& aSecModDetails, 
+							QString aLabel, 
+							const TDesC& aValue, 
+							QString aNullDescription );
+		
+		/**
+		* Generate details of signing security module.                        
+		* @return void
+		*/
+		void AppendPinNRs(QVector< QPair<QString,QString> >& aSecModDetails);
+
+		QVector< QPair<QString, TUint32> > AuthDetails();
+		
+		/**
+		* Changes PIN-NR
+		* @param aIndex Index of the AO
+		* @return void
+		*/
+		void ChangePinNrL(TInt aIndex);
+		       
+		/**
+		* Unblocks PIN-NR
+		* @param aIndex Index of the AO
+		* @return void
+		*/
+		void UnblockPinNrL(TInt aIndex);
+		
+		/**
+		 * Retrieves the UID of the current active keystore.
+		 * @return uid
+		 */
+		TInt KeyStoreUID();     
+		
+		/**
+		 * Retrieves the auth object at the speficied index.
+		 * @return auth object
+		 */
+		const MCTAuthenticationObject& AuthObj(TInt aIndex);
+		
+		/**
+		* Returns ETrue if PIN is unblockable.        
+		* @param aIndex Index of the AO
+		* @return ETrue / EFalse
+		*/
+		TBool PinUnblockable(TInt aIndex) const;
+		        
+		        
+		/**
+		* Returns ETrue if PIN request can be disabled / enabled.        
+		* @param aIndex Index of the AO
+		* @return ETrue / EFalse
+		*/
+		TBool PinRequestChangeable(TInt aIndex) const;
+		
+		/**
+		* Returns ETrue if token is deletable.
+		* @param aTokenIndex Index of the token to be deleted.
+		* @return ETrue / EFalse
+		*/
+		TBool IsTokenDeletable(TInt aTokenIndex);
+		        
+		
+    private:
+
+        /**
+        * C++ default constructor.
+        */        
+        CSecModUIModel();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();        
+        
+        void ResetAndDestroyCTObjects();
+        
+        void ResetAndDestroyAOs();
+        
+        void InitAuthObjectsL();
+        
+        void ListAuthObjectsL();
+        
+        void CreateSettingItem(const TDesC& aTitle, 
+                               const TDesC& aValue,  
+                               TDes& aItem) const;
+        
+        QString Location( TUid aUid ) const;         
+        
+        void AppendPinNRsL( TDes& aMessage ) const;   
+
+    private:
+        // DATA TYPES
+        enum TSecModPanicCode
+            {
+            EPanicNullPointer,
+            EPanicIndexOutOfRange
+            };
+
+    private:    // Data
+        // Resource file offsets		
+		TInt		iResourceFileOffset;
+		TInt        iResourceFileOffset2;
+		TInt        iResourceFileOffset3;
+		
+		CSecModUISyncWrapper* iWrapper; // owned
+		RFs iRfs;
+		
+		/**
+        * Crypto Token objects
+        */
+        CUnifiedKeyStore* iUnifiedKeyStore; // owned
+        MCTKeyStore* iKeyStore; // not owned
+        MCTAuthenticationObjectList*  iAOList; // owned, items not owned
+        RMPointerArray<MCTAuthenticationObject> iAOArray; // items not owned		
+		                                         
+        RMPointerArray<MCTKeyStore> iAOKeyStores; // items not owned       		                                         
+    };
+
+#endif      // CSECMODUIMODEL_H   
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/cpadvancedsecplugin/inc/cpsecmodsyncwrapper.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,125 @@
+/*
+* Copyright (c) 2005-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:   Wrapper class for Symbian's Security Framework's calls.
+*
+*/
+
+#ifndef CPSECMODUISYNCWRAPPER_H
+#define CPSECMODUISYNCWRAPPER_H
+
+#include <e32base.h>
+#include <f32file.h>
+#include <ct/rcpointerarray.h>
+#include <ct/rmpointerarray.h>
+#include <mctkeystore.h>
+
+class MCTToken;
+class MCTAuthenticationObject;
+class MCTAuthenticationObjectList;
+class CUnifiedKeyStore;
+class MCTTokenInterface;
+class TCTTokenObjectHandle;
+
+
+
+/**
+*  class CSecModUISyncWrapper
+*  Wrapper class for Symbian's Security Framework's calls.
+*
+*  @lib wimmanui.dll
+*  @since Series 60 2.0
+*/
+class CSecModUISyncWrapper : public CActive
+    {
+    public:     // Constructors and destructor
+
+        static CSecModUISyncWrapper* NewLC();
+        static CSecModUISyncWrapper* NewL();
+        virtual ~CSecModUISyncWrapper();
+
+    public:     // New functions
+
+        TInt Initialize(CUnifiedKeyStore& aKeyStore );
+
+        TInt OpenWIM();
+
+        TInt GetAuthObjectInterface(
+            MCTToken& aToken,
+            MCTTokenInterface*& aTokenInterface);
+
+        TInt ListAuthObjects(
+            MCTAuthenticationObjectList& aAuthObjList,
+            RMPointerArray<MCTAuthenticationObject>& aAuthObjects );
+
+        TInt ListKeys(
+            MCTKeyStore& aKeyStore,
+            RMPointerArray<CCTKeyInfo>& aKeysInfos,
+		    const TCTKeyAttributeFilter& aFilter);
+
+	    TInt DeleteKey(
+	        CUnifiedKeyStore& aKeyStore,
+	        TCTTokenObjectHandle aHandle);
+
+        TInt ChangeReferenceData( MCTAuthenticationObject& aAuthObject );
+
+        TInt UnblockAuthObject( MCTAuthenticationObject& aAuthObject );
+
+        TInt EnableAuthObject( MCTAuthenticationObject& aAuthObject );
+
+        TInt DisableAuthObject( MCTAuthenticationObject& aAuthObject );
+
+        TInt CloseAuthObject( MCTAuthenticationObject& aAuthObject );
+
+        TInt TimeRemaining( MCTAuthenticationObject& aAuthObject, TInt& aStime );
+
+    protected:      // From CActive
+
+        void DoCancel();
+	    void RunL();
+
+    private:        // New functions
+
+        CSecModUISyncWrapper();
+
+    private:        // Data
+
+        // Internal operation states.
+        enum TOperation
+            {
+            EOperationInit,
+            EOperationGetAOInterface,
+            EOperationListAOs,
+            EOperationListKeys,
+            EOperationDelKey,
+            EOperationChangeReferenceData,
+            EOperationUnblockAO,
+            EOperationEnableAO,
+            EOperationDisableAO,
+            EOperationCloseAO,
+            EOperationTimeRemAO,
+            EOperationNone
+            };
+
+        // For wrapping asynchronous calls.
+        CActiveSchedulerWait    iWait;
+
+        // Internal state of operation.
+        TOperation              iOperation;
+
+        // CT objects
+        TAny* iObject;
+    };
+
+
+#endif // CPSECMODUISYNCWRAPPER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/cpadvancedsecplugin/inc/cpsecmoduleinfoview.h	Tue Aug 31 16:04:40 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:  
+*
+*/
+
+#ifndef CPSECMODULEINFOIEW_H
+#define CPSECMODULEINFOIEW_H
+
+#include <cpbasesettingview.h>
+
+
+
+class CpSecmoduleInfoView : public CpBaseSettingView
+{
+    Q_OBJECT
+public:
+    explicit CpSecmoduleInfoView(const QVector< QPair<QString,QString> >& securityDetails,QGraphicsItem *parent = 0);
+    virtual ~CpSecmoduleInfoView();
+		
+public slots:
+
+    
+private:
+
+
+};
+
+#endif // CPSECMODULEINFOIEW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/cpadvancedsecplugin/inc/cpsecmodview.h	Tue Aug 31 16:04:40 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 CPSECMODVIEW_H
+#define CPSECMODVIEW_H
+
+#include <cpbasesettingview.h>
+
+class HbAbstractViewItem;
+class CpItemDataHelper;
+class CSecModUIModel;
+
+class CpSecModView : public CpBaseSettingView
+{
+    Q_OBJECT
+public:
+    explicit CpSecModView(TInt aCurrentPos, CSecModUIModel& aSecModUIModel, QGraphicsItem *parent = 0);
+    virtual ~CpSecModView();
+    
+private slots:
+	void displayPrevious();
+	void showNextView( const QModelIndex& modelIndex );
+	
+public:
+    enum TSecModViews
+    	{
+    	EAccessView=0,
+    	ESignatureView
+    	};
+    
+    
+private:
+    CSecModUIModel& mSecModUIModel;  
+    TInt mPos;
+    TSecModViews mCurrentView;
+    HbView* mAccessView;
+    HbView* mPrevView;
+ 
+};
+
+#endif /* CPPLACEHOLDERENTRYITEMDATA_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/cpadvancedsecplugin/inc/cpsecurityview.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,63 @@
+/*
+* 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 CPSECURITYVIEW_H
+#define CPSECURITYVIEW_H
+
+#include <cpbasesettingview.h>
+
+class HbAbstractViewItem;
+class CpItemDataHelper;
+class CpSecModView;
+class CpCertView;
+class CSecModUIModel;
+class QModelIndex;
+class CpSecmoduleInfoView;
+class HbMessageBox;
+class CpSecurityView : public CpBaseSettingView
+{
+    Q_OBJECT
+public:
+    explicit CpSecurityView(QGraphicsItem *parent = 0);
+    virtual ~CpSecurityView();
+		
+public slots:
+    void viewDone();
+    void showWIMview();
+    void displayCert(const QModelIndex& modelIndex);
+    void displayPrevious();
+    void showCodeView();
+    void showCodeView( const QModelIndex& modelIndex);
+    void indicateLongPress(HbAbstractViewItem *item,QPointF coords);
+    void deleteModule();
+    void moduleDetails();
+    void displayPreviousFromModInfo();
+    void dialogClosed(HbAction* action);
+private:
+    CSecModUIModel* mSecModUIModel;  
+    CpSecModView* mSecModView;
+	HbView* mPreView;
+	CpCertView* mCertView;
+	CpSecmoduleInfoView* mModuleinfoView;
+	HbView* mCurrentView;
+	TInt mPos;
+	HbMessageBox* mNote;
+	HbMenu* mContextMenu;
+
+};
+
+#endif // CPSECURITYVIEW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/cpadvancedsecplugin/inc/cpuitrustids.h	Tue Aug 31 16:04:40 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:   Contains the TUids of supported clients for certificate's Trust Setting View
+*
+*/
+
+
+#ifndef  CPUITRUSTIDS_H
+#define  CPUITRUSTIDS_H
+
+// CONSTANTS
+const TUid KCertManUINullId = {0};
+const TUid KCertManUIViewTrustWapConnectionId = {268479059};
+const TUid KCertManUIViewTrustApplicationControllerId = {268452523};
+const TUid KCertManUIViewTrustMailAndImageConnId = {268441661};
+const TUid KCertManUIViewTrustJavaInstallingId = {270506792};
+const TUid KCertManUIViewOCSPCheckInstallingId = {268478646};
+const TUid KCertManUIViewTrustVPNId = {270498195};
+const TUid KCertManUIViewTrustWidgetInstallId = {537028562};
+
+#endif // CPUITRUSTIDS_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/cpadvancedsecplugin/rom/advancedsecurity_resources.iby	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,21 @@
+/*
+* 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:   Translation string details
+*
+*/
+
+
+#include <data_caging_paths_for_iby.hrh>
+
+data=DATAZ_\QT_TRANSLATIONS_DIR\certificate_management.qm QT_TRANSLATIONS_DIR\certificate_management.qm 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/cpadvancedsecplugin/rom/cpsecplugins.iby	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef CPSECPLUGINS_IBY
+#define CPSECPLUGINS_IBY
+
+file=ABI_DIR\BUILD_DIR\cpadvancedsecplugin.dll       SHARED_LIB_DIR\cpadvancedsecplugin.dll
+
+data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpadvancedsecplugin.qtplugin             resource\qt\plugins\controlpanel\cpadvancedsecplugin.qtplugin
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/cpadvancedsecplugin/rom/cpsecplugins_rom.pri	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,21 @@
+#
+# 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: 
+#
+
+
+symbian {
+BLD_INF_RULES.prj_exports += "../rom/cpsecplugins.iby CORE_APP_LAYER_IBY_EXPORT_PATH(cpsecplugins.iby)"
+BLD_INF_RULES.prj_exports += "../rom/advancedsecurity_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(advancedsecurity_resources.iby )"
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/cpadvancedsecplugin/src/cpcertdatacontainer.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,757 @@
+/*
+* 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 class CCertManUIKeeper
+*                Creates and destroys all the views CertManUI uses.
+*                Handles changing CertManUI views.
+*
+*/
+
+
+// INCLUDE FILES
+#include <unifiedcertstore.h>
+#include <unifiedkeystore.h>
+#include <mctwritablecertstore.h>
+#include <X509CertNameParser.h>
+
+#include <HbMessageBox>
+
+#include <QErrorMessage>
+#include <../../inc/cpsecplugins.h>
+#include "cpcertdatacontainer.h"
+#include "cpcertmanuisyncwrapper.h"
+
+// CONSTANTS
+_LIT( KNameSeparator, " " );
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// TInt CompareCALabels( const CCTCertInfo& cert1, const CCTCertInfo& cert2 )
+// Compares two labels.
+// -----------------------------------------------------------------------------
+//
+TInt CompareCALabels(
+    const CpCertManUICertData& cert1,
+    const CpCertManUICertData& cert2 )
+    {
+    return ( (cert1.iCAEntryLabel->Des()).
+        CompareF( cert2.iCAEntryLabel->Des() ) );
+    }
+
+// -----------------------------------------------------------------------------
+// TInt CompareUserLabels( const CCTCertInfo& cert1, const CCTCertInfo& cert2 )
+// Compares two labels.
+// -----------------------------------------------------------------------------
+//
+TInt CompareUserLabels(
+    const CpCertManUICertData& cert1,
+    const CpCertManUICertData& cert2 )
+    {
+    return ( (cert1.iUserEntryLabel->Des()).
+        CompareF( cert2.iUserEntryLabel->Des() ) );
+    }
+
+// -----------------------------------------------------------------------------
+// TInt ComparePeerLabels( const CCTCertInfo& cert1, const CCTCertInfo& cert2 )
+// Compares two labels.
+// -----------------------------------------------------------------------------
+//
+TInt ComparePeerLabels(
+    const CpCertManUICertData& cert1,
+    const CpCertManUICertData& cert2 )
+    {
+    return ( (cert1.iPeerEntryLabel->Des()).
+        CompareF( cert2.iPeerEntryLabel->Des() ) );
+    }
+
+// -----------------------------------------------------------------------------
+// TInt CompareDeviceLabels( const CCTCertInfo& cert1, const CCTCertInfo& cert2 )
+// Compares two labels.
+// -----------------------------------------------------------------------------
+//
+TInt CompareDeviceLabels(
+    const CpCertManUICertData& cert1,
+    const CpCertManUICertData& cert2 )
+    {
+    return ( (cert1.iDeviceEntryLabel->Des()).
+        CompareF( cert2.iDeviceEntryLabel->Des() ) );
+    }
+
+
+// ================= HELPER CLASS ===========================
+
+// Constructor.
+CpCertManUICertData::CpCertManUICertData()
+    {
+    }
+
+// Destructor.
+CpCertManUICertData::~CpCertManUICertData()
+    {
+    delete iCAEntryLabel;
+    delete iUserEntryLabel;
+    delete iPeerEntryLabel;
+    delete iDeviceEntryLabel;
+    }
+
+// Releases Certificate entries.
+void CpCertManUICertData::Release()
+    {
+    RDEBUG("0", 0);
+    if ( iCAEntry )
+        {
+        iCAEntry->Release();
+        }
+
+    if ( iUserEntry )
+        {
+        iUserEntry->Release();
+        }
+
+    if ( iPeerEntry )
+        {
+        iPeerEntry->Release();
+        }
+
+    if ( iDeviceEntry )
+        {
+        iDeviceEntry->Release();
+        }
+
+    delete this;
+    }
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CCertManUIKeeper::CCertManUIKeeper()
+// Constructor with parent
+// ---------------------------------------------------------
+//
+CpCertDataContainer::CpCertDataContainer()
+    {
+    }
+
+// ---------------------------------------------------------
+// CCertManUIKeeper::~CCertManUIKeeper()
+// Destructor
+// ---------------------------------------------------------
+//
+CpCertDataContainer::~CpCertDataContainer()
+    {
+	iCALabelEntries.Close();
+	iUserLabelEntries.Close();
+	iPeerLabelEntries.Close();
+	iDeviceLabelEntries.Close();
+	
+    if ( iWrapper )
+        {
+        iWrapper->Cancel();
+        }
+    delete iWrapper;
+
+    delete iFilter;
+    delete iKeyFilter;
+    delete iStore;
+    delete iKeyStore;
+
+    iCAEntries.Close();
+    iUserEntries.Close();
+    iPeerEntries.Close();
+    iDeviceEntries.Close();
+    iKeyEntries.Close();
+    
+    iRfs.Close();
+    }
+
+// ---------------------------------------------------------
+// CCertManUIKeeper* CCertManUIKeeper::NewL(const TRect& aRect, TUid aViewId)
+// ---------------------------------------------------------
+//
+
+CpCertDataContainer* CpCertDataContainer::NewL()
+    {
+	CpCertDataContainer* self = new ( ELeave ) CpCertDataContainer;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CCertManUIKeeper* CCertManUIKeeper::NewLC(
+//      const TRect& aRect, TUid aViewId)
+// ---------------------------------------------------------
+//
+CpCertDataContainer* CpCertDataContainer::NewLC()
+    {
+	CpCertDataContainer* self = new ( ELeave ) CpCertDataContainer;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+
+// ---------------------------------------------------------
+// CCertManUIKeeper::ConstructL(
+ //     const TRect& aRect, TUid aViewId
+//
+// ---------------------------------------------------------
+//
+void CpCertDataContainer::ConstructL()
+    {
+    RDEBUG("0", 0);
+    // Ensure that file server session is succesfully created
+    User::LeaveIfError( iRfs.Connect() );
+
+    TRAPD ( error, iStore = CUnifiedCertStore::NewL( iRfs, ETrue ) );
+        
+	if ( error == KErrNotSupported || error == KErrNotReady
+	   || error == KErrArgument || error == KErrNotFound )
+		{
+		// Something may be wrong with the databases
+		ShowErrorNoteL( error );
+		}
+        
+	User::LeaveIfError( error );
+    
+    iWrapper = CpCertManUISyncWrapper::NewL();
+    iWrapper->InitStoreL( iStore );
+
+    iFilter = CCertAttributeFilter::NewL();
+
+    TRAP( error, iKeyStore = CUnifiedKeyStore::NewL( iRfs ) );
+    
+	if (error == KErrNotSupported || error == KErrNotReady
+		|| error == KErrArgument || error == KErrNotFound)
+		{
+		// Something is wrong with key stores
+		ShowErrorNoteL( error );
+		}
+	
+	User::LeaveIfError( error );
+    
+    iWrapper->InitStoreL( iKeyStore );
+    iKeyEntries.Close();
+    
+    }
+
+
+// ---------------------------------------------------------
+// CCertManUIKeeper::CertManager()
+// ---------------------------------------------------------
+//
+CUnifiedCertStore*& CpCertDataContainer::CertManager()
+    {
+    return iStore;
+    }
+
+// ---------------------------------------------------------
+// CCertManUIKeeper::KeyManager()
+// ---------------------------------------------------------
+//
+CUnifiedKeyStore*& CpCertDataContainer::KeyManager()
+    {
+    return iKeyStore;
+    }
+
+// ---------------------------------------------------------
+// CCertManUIKeeper::RefreshCAEntriesL()
+// Checks that cacerts.dat file is not corrupted and
+// returns CA certificates from it
+// ---------------------------------------------------------
+//
+void CpCertDataContainer::RefreshCAEntriesL()
+    {
+    RDEBUG("0", 0);
+    iFilter->SetOwnerType( ECACertificate );
+    iCAEntries.Close();
+    CUnifiedCertStore*& store = CertManager();
+    iWrapper->ListL( store, &iCAEntries, *iFilter );
+
+    iCALabelEntries.Close();
+    for ( TInt ii = 0; ii < iCAEntries.Count(); ii++ )
+        {
+        switch ( iCAEntries[ii]->CertificateFormat() )
+            {
+            case EX509Certificate:
+                {
+                CpCertManUICertData* data = new ( ELeave ) CpCertManUICertData();
+                CleanupStack::PushL( data );
+                data->iCAEntry = CCTCertInfo::NewL( *iCAEntries[ii] );
+                
+                HBufC* pri = NULL;
+                HBufC* sec = NULL;
+
+                CCertificate* cert;
+
+                TRAPD(err, iWrapper->GetCertificateL( CertManager(), *iCAEntries[ii], cert ));
+                if (( err == KErrArgument ) || ( err == KErrCorrupt ))
+                    {
+                    // This indicates that certificate is not according to X509
+                    // specification or it is corrupted. Ignore certificate
+                    if(data->iCAEntry)
+                       {
+                       data->iCAEntry->Release();
+                       }
+                    CleanupStack::PopAndDestroy( data ); // data
+                    continue;
+                    }
+                else
+                    {
+                    User::LeaveIfError( err );
+                    }
+
+                CleanupStack::PushL( cert );
+
+                X509CertNameParser::PrimaryAndSecondaryNameL
+                    ( *((CX509Certificate*)cert), pri, sec, iCAEntries[ii]->Label());
+
+                CleanupStack::PushL( pri );
+                CleanupStack::PushL( sec );
+
+                TInt lenght = 0;
+
+                lenght += iCAEntries[ii]->Label().Length();
+
+                if ( pri )
+                    {
+                    lenght += pri->Length();
+                    }
+                if ( sec && !(iCAEntries[ii]->Label().Length()) )
+                    {
+                    lenght += sec->Length();
+                    }
+                lenght += KNameSeparator.iTypeLength;
+
+                HBufC* label = HBufC::NewL( lenght );
+                label->Des().Append( iCAEntries[ii]->Label() );
+
+                if ( pri )
+                    {
+                    label->Des().Append( KNameSeparator );
+                    label->Des().Append( pri->Des() );
+                    }
+                if ( sec && !(iCAEntries[ii]->Label().Length()) )
+                    {
+                    label->Des().Append( sec->Des() );
+                    }
+
+                data->iCAEntryLabel = label;
+                iCALabelEntries.Append( data );
+
+                CleanupStack::PopAndDestroy( 3, cert ); // pri, sec
+                CleanupStack::Pop( data ); 
+                break;
+                } // EX509Certificate
+
+            case EWTLSCertificate:
+                // Do nothing for wtls certificates
+                break;
+            default:
+                {
+                User::Leave( KErrNotSupported );
+                }
+            }   // switch
+
+        }   // for
+
+    // Sort the certificates.
+    TLinearOrder<CpCertManUICertData> order( CompareCALabels );
+    iCALabelEntries.Sort( order );
+
+    }
+
+// ---------------------------------------------------------
+// CCertManUIKeeper::RefreshPeerCertEntriesL()
+// Checks that Trusted site certificate store is
+// not corrupted and returns Peer certificates from it
+// ---------------------------------------------------------
+//
+void CpCertDataContainer::RefreshPeerCertEntriesL()
+    {
+    RDEBUG("0", 0);
+    iFilter->SetOwnerType( EPeerCertificate );
+    iPeerEntries.Close();
+    CUnifiedCertStore*& store = CertManager();
+
+    iWrapper->ListL( store, &iPeerEntries, *iFilter, KCMTrustedServerTokenUid );
+
+    iPeerLabelEntries.Close();
+    
+    for ( TInt ii = 0; ii < iPeerEntries.Count(); ii++ )
+        {
+        switch ( iPeerEntries[ii]->CertificateFormat() )
+            {
+            case EX509Certificate:
+                {
+                CpCertManUICertData* data = new (ELeave) CpCertManUICertData();
+                CleanupStack::PushL( data );
+                data->iPeerEntry = CCTCertInfo::NewL( *iPeerEntries[ii] );
+
+                CCertificate* cert;
+
+                TRAPD( err, iWrapper->GetCertificateL( CertManager(), *iPeerEntries[ii], cert, KCMTrustedServerTokenUid ));
+                if (( err == KErrArgument ) || ( err == KErrCorrupt ))
+                    {
+                    // This indicates that certificate is not according to X509
+                    // specification or it is corrupted. Ignore certificate
+                    if( data->iPeerEntry )
+                       {
+                       data->iPeerEntry->Release();
+                       }
+                    CleanupStack::PopAndDestroy( data ); // data
+                    continue;
+                    }
+                else
+                    {
+                    User::LeaveIfError( err );
+                    }
+
+                CleanupStack::PushL( cert );
+
+                TInt lenght = 0;
+
+                lenght += iPeerEntries[ii]->Label().Length();
+
+                HBufC* label = HBufC::NewL( lenght );
+                label->Des().Append( iPeerEntries[ii]->Label() );
+
+                data->iPeerEntryLabel = label;
+                iPeerLabelEntries.Append( data );
+
+                CleanupStack::PopAndDestroy( cert ); // cert
+                CleanupStack::Pop( data ); // data
+                break;
+                } // EX509Certificate
+
+            case EWTLSCertificate:
+                // Do nothing for wtls certificates
+                break;
+            default:
+                {
+                User::Leave( KErrNotSupported );
+                }
+            }   // switch
+
+        }   // for
+
+    // Sort the certificates.
+    TLinearOrder<CpCertManUICertData> order( ComparePeerLabels );
+    iPeerLabelEntries.Sort( order );
+
+    }
+
+
+// ---------------------------------------------------------
+// CCertManUIKeeper::RefreshUserCertEntriesL()
+// Checks that cacerts.dat file is not corrupted and
+// returns User certificates from it
+// ---------------------------------------------------------
+//
+void CpCertDataContainer::RefreshUserCertEntriesL()
+    {
+    RDEBUG("0", 0);
+    iFilter->SetOwnerType( EUserCertificate );
+    iUserEntries.Close();
+    CUnifiedCertStore*& store = CertManager();
+    iWrapper->ListL( store, &iUserEntries, *iFilter );
+
+    iUserLabelEntries.Close();
+    
+    for ( TInt i = 0; i < iUserEntries.Count(); i++ )
+        {
+
+       if ( iUserEntries[i]->Handle().iTokenHandle.iTokenTypeUid == KCMDeviceCertStoreTokenUid )
+            {
+            // User certificates from DeviceCertStore are not
+            // shown in Personal certificate view. Ignore this certificate.
+            break;
+            }
+
+        switch ( iUserEntries[i]->CertificateFormat() )
+            {
+            case EX509Certificate:
+                {
+                CpCertManUICertData* data = new (ELeave) CpCertManUICertData();
+                CleanupStack::PushL( data );
+                data->iUserEntry = CCTCertInfo::NewL( *iUserEntries[i] );
+                
+                HBufC* pri = NULL;
+                HBufC* sec = NULL;
+
+                CCertificate* cert = NULL;
+                TRAPD(error, iWrapper->GetCertificateL( CertManager(), *iUserEntries[i], cert ));
+
+                if( error == KErrArgument)
+                    {
+                    CleanupStack::PopAndDestroy( data );
+                    break;
+                    }
+                else if ( error != KErrNone )
+                    {
+                    User::Leave( error );
+                    }
+                else
+                    {
+                    CleanupStack::PushL( cert );
+                    }
+
+                X509CertNameParser::PrimaryAndSecondaryNameL
+                    ( *((CX509Certificate*)cert), pri, sec, iUserEntries[i]->Label());
+
+                CleanupStack::PushL( pri );
+                CleanupStack::PushL( sec );
+
+                TInt lenght = 0;
+
+                lenght += iUserEntries[i]->Label().Length();
+
+                if ( pri )
+                    {
+                    lenght += pri->Length();
+                    }
+                if ( sec && !(iUserEntries[i]->Label().Length()) )
+                    {
+                    lenght += sec->Length();
+                    }
+                lenght += KNameSeparator.iTypeLength;
+
+                HBufC* label = HBufC::NewL( lenght );
+                label->Des().Append( iUserEntries[i]->Label() );
+
+                if ( pri )
+                    {
+                    label->Des().Append( KNameSeparator );
+                    label->Des().Append( pri->Des() );
+                    }
+                if ( sec && !(iUserEntries[i]->Label().Length()) )
+                    {
+                    label->Des().Append( sec->Des() );
+                    }
+
+                data->iUserEntryLabel = label;
+                iUserLabelEntries.Append( data );
+
+                CleanupStack::PopAndDestroy( 3, cert ); // pri, sec
+                CleanupStack::Pop( data ); // data
+                break;
+                } // EX509Certificate
+
+            case EX509CertificateUrl:
+                {
+                CpCertManUICertData* urlCertData = new (ELeave) CpCertManUICertData();
+                CleanupStack::PushL( urlCertData );
+                urlCertData->iUserEntry = CCTCertInfo::NewL( *iUserEntries[i] );
+            
+                CCertificate* cert = NULL;
+                TRAPD(error, iWrapper->GetCertificateL( CertManager(), *iUserEntries[i], cert ));
+                if( error == KErrArgument )
+                    {
+                    CleanupStack::PopAndDestroy( urlCertData ); // urlCertData
+                    break;
+                    }
+                else if ( error != KErrNone )
+                    {
+                    User::Leave(error);
+                    }
+                else
+                    {
+                    CleanupStack::PushL( cert );
+                    }
+
+				_LIT(KUrlUserCert, "URL UserCert");
+                HBufC* UrlLabel = HBufC::NewL( KUrlUserCert().Length() );
+                UrlLabel->Des().Append( KUrlUserCert());
+
+                urlCertData->iUserEntryLabel = UrlLabel;
+                iUserLabelEntries.Append( urlCertData );
+
+                CleanupStack::PopAndDestroy( cert ); // cert
+                CleanupStack::Pop( urlCertData ); // data
+                break;
+                }
+            }   // switch
+
+        }   // for
+
+    // Sort the certificates.
+    TLinearOrder<CpCertManUICertData> order( CompareUserLabels );
+    iUserLabelEntries.Sort( order );
+
+    }
+
+// ---------------------------------------------------------
+// CCertManUIKeeper::RefreshDeviceCertEntriesL()
+// returns device certificates
+// ---------------------------------------------------------
+//
+void CpCertDataContainer::RefreshDeviceCertEntriesL()
+    {
+    RDEBUG("0", 0);
+    iFilter->SetOwnerType( EUserCertificate );
+    iDeviceEntries.Close();
+    CUnifiedCertStore*& store = CertManager();
+
+    iWrapper->ListL( store, &iDeviceEntries, *iFilter, KCMDeviceCertStoreTokenUid );
+
+    iDeviceLabelEntries.Close();
+    for ( TInt i = 0; i < iDeviceEntries.Count(); i++ )
+        {
+        switch ( iDeviceEntries[i]->CertificateFormat() )
+            {
+            case EX509Certificate:
+                {
+                CpCertManUICertData* data = new (ELeave) CpCertManUICertData();
+                CleanupStack::PushL( data );
+                data->iDeviceEntry = CCTCertInfo::NewL( *iDeviceEntries[i] );
+                
+                HBufC* pri = NULL;
+                HBufC* sec = NULL;
+
+                CCertificate* cert = NULL;
+                TRAPD(error, iWrapper->GetCertificateL( CertManager(), *iDeviceEntries[i], cert, KCMDeviceCertStoreTokenUid ));
+
+                if( error == KErrArgument)
+                    {
+                    CleanupStack::PopAndDestroy( data );
+                    break;
+                    }
+                else if ( error != KErrNone )
+                    {
+                    User::Leave( error );
+                    }
+                else
+                    {
+                    CleanupStack::PushL( cert );
+                    }
+
+                X509CertNameParser::PrimaryAndSecondaryNameL
+                    ( *((CX509Certificate*)cert), pri, sec, iDeviceEntries[i]->Label());
+
+                CleanupStack::PushL( pri );
+                CleanupStack::PushL( sec );
+
+                TInt lenght = 0;
+
+                lenght += iDeviceEntries[i]->Label().Length();
+
+                if ( pri )
+                    {
+                    lenght += pri->Length();
+                    }
+                if ( sec && !(iDeviceEntries[i]->Label().Length()) )
+                    {
+                    lenght += sec->Length();
+                    }
+                lenght += KNameSeparator.iTypeLength;
+
+                HBufC* label = HBufC::NewL( lenght );
+                label->Des().Append( iDeviceEntries[i]->Label() );
+
+                if ( pri )
+                    {
+                    label->Des().Append( KNameSeparator );
+                    label->Des().Append( pri->Des() );
+                    }
+                if ( sec && !(iDeviceEntries[i]->Label().Length()) )
+                    {
+                    label->Des().Append( sec->Des() );
+                    }
+
+                data->iDeviceEntryLabel = label;
+                iDeviceLabelEntries.Append( data );
+
+                CleanupStack::PopAndDestroy( 3, cert ); // pri, sec
+                CleanupStack::Pop( data ); // data
+                break;
+                } // EX509Certificate
+
+            case EX509CertificateUrl:
+                {
+                CpCertManUICertData* urlCertData = new (ELeave) CpCertManUICertData();
+                CleanupStack::PushL( urlCertData );
+                urlCertData->iDeviceEntry = CCTCertInfo::NewL( *iDeviceEntries[i] );
+
+                CCertificate* cert = NULL;
+                TRAPD(error, iWrapper->GetCertificateL( CertManager(), *iDeviceEntries[i], cert, KCMDeviceCertStoreTokenUid ));
+                if( error == KErrArgument)
+                    {
+                    CleanupStack::PopAndDestroy( urlCertData ); // urlCertData
+                    break;
+                    }
+                else if ( error != KErrNone )
+                    {
+                    User::Leave(error);
+                    }
+                else
+                    {
+                    CleanupStack::PushL( cert );
+                    }
+
+                _LIT(KUrlUserCert, "URL UserCert");
+                HBufC* UrlLabel = HBufC::NewL( KUrlUserCert().Length() );
+                UrlLabel->Des().Append( KUrlUserCert());
+
+
+                urlCertData->iDeviceEntryLabel = UrlLabel;
+                iDeviceLabelEntries.Append( urlCertData );
+
+                CleanupStack::PopAndDestroy( cert ); // cert
+                CleanupStack::Pop( urlCertData ); // data
+                break;
+                }
+            }   // switch
+
+        }   // for
+
+    // Sort the certificates.
+    TLinearOrder<CpCertManUICertData> order( CompareDeviceLabels );
+    iDeviceLabelEntries.Sort( order );
+
+    }
+
+// ---------------------------------------------------------
+// CCertManUIKeeper::ShowErrorNoteL( TInt aError )
+// Shows error note
+// ---------------------------------------------------------
+//
+void CpCertDataContainer::ShowErrorNoteL( TInt aError )
+    {
+	QString sError;
+    switch ( aError )
+        {
+        case KErrCorrupt:
+            {
+            sError = "Database corrupted. Some data might have been lost.";
+            break;
+            }
+        case KErrCancel:
+            {
+            // Show nothing
+            break;
+            }
+         default:
+            {
+            sError = "Internal error";
+            break;
+            }
+        }
+
+    if ( sError.length() != 0 )
+        {
+		HbMessageBox::information(sError);
+        }
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/cpadvancedsecplugin/src/cpcertdetailview.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,887 @@
+/*
+* 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 <cctcertinfo.h>
+#include <x509cert.h>
+#include <unifiedcertstore.h>
+#include <X509CertNameParser.h>
+#include <securitydefs.h>
+#include <hash.h>                   // MD5 fingerprint
+#include <asymmetrickeys.h>
+
+#include <e32math.h>                // Pow
+#include <e32cmn.h>
+
+#include <QDateTime>
+#include <QStringList>
+#include <QGraphicsLinearLayout>
+
+#include <hblineedit.h>
+#include <hbdataform.h>
+#include <hbdataformmodel.h>
+#include <hbdataformmodelitem.h>
+#include <hblabel.h>
+#include <hbpushbutton.h>
+#include <hbmenu.h>
+#include <hbaction.h>
+#include <hbmessagebox.h>
+#include <HbListWidget>
+#include <HbListWidgetItem>
+#include <HbGroupBox>
+#include <hbpushbutton.h>
+#include <hbdataform.h>
+#include <hbdataformmodel.h>
+#include <hbdataformmodelitem.h>
+#include <../../inc/cpsecplugins.h>
+#include "cpcertdetailview.h"
+#include "cpcertview.h"
+#include "cpcertdatacontainer.h"
+#include "cpcertmanuisyncwrapper.h"
+#include "../../../pkiutilities/DeviceToken/Inc/TrustedSitesStore.h"
+
+const TInt KFileCertStoreUid( 0x101F501A );
+const TInt KTrustedServerCertStoreUid( 0x101FB66F );
+const TInt KDeviceCertStoreUid( 0x101FB668 );
+const TInt KDeviceKeyStoreUid( 0x101FB66A );
+const TInt KWIMCertStoreUid ( 0x101F79D9 );
+
+const TInt KMaxLengthTextSerialNumberFormatting = 3;
+_LIT( KCertManUIDetailsViewHexaFormat, "%02X" );
+_LIT( KBlockSeparator, " " );
+
+template <class T>
+class CleanupResetAndDestroy
+    {
+public:
+    inline static void PushL( T& aRef );
+private:
+    static void ResetAndDestroy( TAny *aPtr );
+    };
+
+template <class T>
+inline void CleanupResetAndDestroyPushL( T& aRef );
+
+template <class T>
+inline void CleanupResetAndDestroy<T>::PushL( T& aRef )
+    {
+    CleanupStack::PushL( TCleanupItem( &ResetAndDestroy, &aRef ) );
+    }
+
+template <class T>
+void CleanupResetAndDestroy<T>::ResetAndDestroy( TAny *aPtr )
+    {
+    if( aPtr )
+        {
+        static_cast<T*>( aPtr )->ResetAndDestroy();
+        }
+    }
+
+template <class T>
+inline void CleanupResetAndDestroyPushL( T& aRef )
+    {
+    CleanupResetAndDestroy<T>::PushL( aRef );
+    }
+
+CpCertDetailView::CpCertDetailView(CpCertView::TCertificateViews aCurrentView,TInt aPos, CpCertDataContainer& aCertDataContainer, QGraphicsItem *parent /*= 0*/)
+: CpBaseSettingView(0,parent), mCertDataContainer(aCertDataContainer)
+	{
+	setTitle(tr("Certificate Details"));
+	
+	try
+		{
+		QT_TRAP_THROWING(viewCertificateDetailsL(aPos, aCurrentView));
+		}
+	catch(const std::exception& exception)
+		{
+		HbMessageBox::information(exception.what());
+		throw(exception);
+		}
+	}
+
+
+CpCertDetailView::~CpCertDetailView()
+	{}
+
+void CpCertDetailView::viewCertificateDetailsL( TInt aIndex, CpCertView::TCertificateViews aType )
+	{
+	RDEBUG("0", 0);
+	QGraphicsLinearLayout *layout = q_check_ptr(new QGraphicsLinearLayout(Qt::Vertical));	
+	setLayout(layout);
+	
+	HbListWidget* mCertDetails = q_check_ptr(new HbListWidget(this));
+		
+    HBufC8* urlBuf = NULL;
+    CCertificate* details = NULL;
+    CUnifiedCertStore*& store = mCertDataContainer.CertManager();
+
+    const CCTCertInfo* entry = certInfo(aIndex, aType);
+    TCertificateFormat certificateFormat = entry->CertificateFormat();
+
+    if( certificateFormat != EX509CertificateUrl )
+        {
+        mCertDataContainer.iWrapper->GetCertificateL( store, *entry, details );
+        CleanupStack::PushL( details );
+        validateCertificateL( aIndex, *details, *entry, aType );
+        }
+    else
+        {
+        urlBuf = HBufC8::NewLC( entry->Size() );
+        TPtr8 urlPtr = urlBuf->Des();
+        mCertDataContainer.iWrapper->GetUrlCertificateL( store, *entry, urlPtr );
+        }
+
+    if( aType == CpCertView::ETrustedView )
+        {
+		addTrustedSitesL(*details, *mCertDetails);
+        }
+    else
+        {
+		addLabel(*entry, *mCertDetails);
+        }
+		RDEBUG("0", 0);
+    // certificate issuer and owner
+    if( certificateFormat == EX509Certificate )
+        {
+		addIssuerL(*details, *mCertDetails);
+		addSubjectL(*details, *mCertDetails);
+        }
+
+    // Get key usage and location. This is done only client certificates.
+    const TInt KLocationUnknown = 0;
+    TUid keyLocation = { KLocationUnknown };
+
+    if(( aType == CpCertView::EPersonalView ) || ( aType == CpCertView::EDeviceView ))
+        {
+		TKeyUsagePKCS15 usage = keyUsageAndLocationL( *entry, &keyLocation );
+        addCertUsage(usage, *mCertDetails);		
+        }
+		RDEBUG("0", 0);
+    if( certificateFormat == EX509Certificate )
+        {
+		addValidityPeriod( *details, *mCertDetails );                
+        TUid certLoc;
+        certLoc.iUid = entry->Token().TokenType().Type().iUid;
+        // add the location of the certificate
+        setLocationInfo( ETrue, certLoc, *mCertDetails );
+        }
+    else if( certificateFormat == EX509CertificateUrl )
+        {
+        setURLLocation( *urlBuf, *mCertDetails );
+        }
+    else
+        {
+        // nothing
+        }
+
+    addCertFormat(certificateFormat, *mCertDetails);
+            
+    // Private key location, only for user and device certicates
+    if(( aType == CpCertView::EPersonalView ) || ( aType == CpCertView::EDeviceView ))
+        {
+        setLocationInfo( EFalse, keyLocation, *mCertDetails );
+        }
+
+    if( certificateFormat == EX509Certificate )
+        {
+		addAlgoDetails( *details, *mCertDetails);
+        addSerialNo( *details, *mCertDetails );
+        addFingerprint( *details, *mCertDetails);
+        addPublicKeyDetailsL( *details, *mCertDetails );
+        }
+    else
+        {
+        // SetUrlCertAlgorihm()
+        }
+		RDEBUG("0", 0);
+    if( certificateFormat != EX509CertificateUrl )
+        {
+        CleanupStack::PopAndDestroy( details );
+        }
+    else
+        {
+        CleanupStack::PopAndDestroy( urlBuf );
+        }
+
+    layout->addItem(mCertDetails);
+    }
+
+const CCTCertInfo* CpCertDetailView::certInfo( TInt index, CpCertView::TCertificateViews certView )
+	{
+	RDEBUG("0", 0);
+	const CCTCertInfo* certinfo = NULL;
+	
+	if( certView == CpCertView::EAuthorityView )
+		{
+		certinfo = ( mCertDataContainer.iCALabelEntries )[ index ]->iCAEntry;
+		}
+	else if( certView == CpCertView::ETrustedView )
+		{
+		certinfo = ( mCertDataContainer.iPeerLabelEntries )[ index ]->iPeerEntry;
+		}
+	else if( certView == CpCertView::EDeviceView )
+		{
+		certinfo = ( mCertDataContainer.iDeviceLabelEntries )[ index ]->iDeviceEntry;
+		}
+	else if( certView == CpCertView::EPersonalView )
+		{
+		certinfo = ( mCertDataContainer.iUserLabelEntries )[ index ]->iUserEntry;
+		}
+	return certinfo;
+	}
+
+void CpCertDetailView::addTrustedSitesL( const CCertificate& certDetails, HbListWidget& certDisplayDetails )
+	{
+	RDEBUG("0", 0);
+	CTrustSitesStore* trustedSitesStore = CTrustSitesStore::NewL();
+	CleanupStack::PushL( trustedSitesStore );
+
+	RPointerArray<HBufC> trustedSites;
+	CleanupResetAndDestroyPushL( trustedSites );
+	trustedSitesStore->GetTrustedSitesL( certDetails.Encoding(), trustedSites );
+
+	QString sTrustedSites = "Site:";
+	if( trustedSites.Count() > 0 )
+		{
+		// display trusted sites
+		sTrustedSites = "Site:";
+		}
+	addToListWidget(certDisplayDetails, sTrustedSites);
+	
+	for(int index=0;index<trustedSites.Count(); ++index)
+		{
+		QString trustedSiteDetail = QString((QChar*)(trustedSites[index]->Ptr()), trustedSites[index]->Length());
+		addToListWidget(certDisplayDetails, trustedSiteDetail);
+		}
+	
+	CleanupStack::PopAndDestroy( &trustedSites );
+	CleanupStack::PopAndDestroy( trustedSitesStore );
+
+	}
+
+void CpCertDetailView::addLabel( const CCTCertInfo& aCertInfo, HbListWidget& certDisplayDetails )
+	{
+	RDEBUG("0", 0);
+	QString sLabel("Label:");
+	QString sLabelDetails = "(No label)"; 
+	if(aCertInfo.Label().Length()  != 0)
+		{
+		sLabelDetails = QString((QChar*)(aCertInfo.Label().Ptr()),aCertInfo.Label().Length());
+		}
+	addToListWidget(certDisplayDetails, sLabel, sLabelDetails);
+	}
+
+void CpCertDetailView::addIssuerL( 	const CCertificate& aCertDetails, 
+									HbListWidget& certDisplayDetails )
+	{
+	HBufC* issuer = NULL;
+	X509CertNameParser::IssuerFullNameL( (CX509Certificate&)aCertDetails, issuer );
+	CleanupStack::PushL( issuer );
+
+	QString sIssuer = "Issuer:";
+	QString sIssuerDetails = "(Not defined)"; 
+	if(issuer->Des().Length() != 0)
+		{
+		sIssuerDetails = QString((QChar*)issuer->Des().Ptr(),issuer->Des().Length());
+		}
+	addToListWidget(certDisplayDetails, sIssuer, sIssuerDetails);
+		
+	CleanupStack::PopAndDestroy( issuer ); 
+	}
+
+void CpCertDetailView::addSubjectL( const CCertificate& aCertDetails, 
+									HbListWidget& certDisplayDetails )
+	{
+	RDEBUG("0", 0);
+	HBufC* subject = NULL;
+	X509CertNameParser::SubjectFullNameL( (CX509Certificate&)aCertDetails, subject );
+	CleanupStack::PushL( subject );
+
+	QString sSubject = "Subject:";
+	QString sSubjectDetails = "(No subject)";
+	if(subject->Des().Length() != 0)
+		{
+		sSubjectDetails = QString((QChar*)subject->Des().Ptr(),subject->Des().Length());
+		}
+	
+	addToListWidget(certDisplayDetails, sSubject, sSubjectDetails);
+	
+	CleanupStack::PopAndDestroy( subject );
+	}
+
+void CpCertDetailView::addCertUsage( TKeyUsagePKCS15 usage, HbListWidget& certDisplayDetails )
+	{
+	RDEBUG("0", 0);
+	QString strUsage;
+	switch( usage )
+		{
+		case EPKCS15UsageSignSignRecover:
+		case EPKCS15UsageSignDecrypt:
+		case EPKCS15UsageSign:
+			strUsage = "Client authentication";
+			break;
+		case EPKCS15UsageNonRepudiation:
+			strUsage = "Digital signing";
+			break;
+		default:
+			strUsage = "(Not defined)";
+			break;
+		}
+	addToListWidget(certDisplayDetails, strUsage );     
+	}
+
+
+void CpCertDetailView::addValidityPeriod( 	const CCertificate& aCertDetails, 
+											HbListWidget& certDisplayDetails)
+	{
+	RDEBUG("0", 0);
+	// Certificate validity period
+	// Hometime's offset to UTC
+	TLocale locale;
+	TTimeIntervalSeconds offSet = locale.UniversalTimeOffset();
+	
+	QString sValidFrom("Valid from: ");
+	const CValidityPeriod& validityPeriod = aCertDetails.ValidityPeriod();
+	TTime startValue = validityPeriod.Start();
+	startValue += offSet;
+	TDateTime dateTime = startValue.DateTime();
+	TMonth month = dateTime.Month();
+	TInt day = dateTime.Day();
+	TInt year = dateTime.Year();
+	QDateTime qValidityPeriod(QDate(year, month, day));
+	QString sValidFromDetail = qValidityPeriod.toString("MM\\dd\\yyyy");
+	
+	addToListWidget(certDisplayDetails, sValidFrom, sValidFromDetail);
+		
+	QString sValidUntil("Valid until: ");
+	TTime finishValue = validityPeriod.Finish();
+	finishValue += offSet;
+	dateTime = finishValue.DateTime();
+	month = dateTime.Month();
+	day = dateTime.Day();
+	year = dateTime.Year();
+	qValidityPeriod.setDate(QDate(year, month, day));
+	QString sValidUntilDetail = qValidityPeriod.toString("MM\\dd\\yyyy");
+	
+	addToListWidget(certDisplayDetails, sValidUntil, sValidUntilDetail);
+		
+	}
+
+void CpCertDetailView::setURLLocation( HBufC8& urlDetails, HbListWidget& certDisplayDetails )
+	{
+	RDEBUG("0", 0);
+	TPtr8 urlPtr = urlDetails.Des();
+		
+	QString certUrl = "Location:"; 
+	QString certURLDetail = "(Not defined)";
+	TInt length = urlPtr.Length();
+	if(length != 0)
+		{
+		certURLDetail = QString((QChar*)urlPtr.Ptr(),urlPtr.Length());
+		}
+	addToListWidget(certDisplayDetails, certUrl, certURLDetail);
+	}
+
+void CpCertDetailView::addCertFormat( TCertificateFormat aCertFormat, HbListWidget& certDisplayDetails )
+	{
+	RDEBUG("0", 0);
+	// certificate format
+	QString certFormat = "Certificate format:";
+	QString certFormatDetails = "(Not defined)";
+	if( aCertFormat == EX509Certificate || aCertFormat == EX509CertificateUrl)
+		{
+		certFormatDetails = "X509";
+		}
+	addToListWidget(certDisplayDetails, certFormat, certFormatDetails);
+	}
+
+void CpCertDetailView::addAlgoDetails( 	const CCertificate& certificate, 
+										HbListWidget& certDisplayDetails )
+	{
+	RDEBUG("0", 0);
+	// certificate algorithms
+	QString sDgstAlgoDetails = "Unknown";
+	// digest algorithm
+	TAlgorithmId algorithmId = certificate.SigningAlgorithm().DigestAlgorithm().Algorithm();
+	switch( algorithmId )
+		{
+		case EMD2:
+			{
+			sDgstAlgoDetails = "MD2";
+			break;
+			}
+		case EMD5:
+			{
+			sDgstAlgoDetails = "MD5";
+			break;
+			}
+		case ESHA1:
+			{
+			sDgstAlgoDetails = "SHA1";
+			break;
+			}
+		}
+
+	QString sAsymmetricAlgoDetails = asymmetricAlgoId(certificate);
+	QString sAlgorithm("Algorithm:");
+	QString sAlgoDetails = "Unknown";
+	// If other algorithm is unknown
+	if( sDgstAlgoDetails != "Unknown" && sAsymmetricAlgoDetails != "Unknown" )
+		{
+		sAlgoDetails = sDgstAlgoDetails;
+		sAlgoDetails.append(sAsymmetricAlgoDetails);
+		}
+	addToListWidget(certDisplayDetails, sAlgorithm, sAlgoDetails);
+	}
+
+void CpCertDetailView::addSerialNo( const CCertificate& certificate, 
+									HbListWidget& certDisplayDetails )
+	{
+	RDEBUG("0", 0);
+	// certificate serial number
+	QString sCertSerialNo("Serial number:");
+	QString sCertSerialNoDetails = 0;
+	TPtrC8 serialNumber = certificate.SerialNumber();
+	TBuf<KMaxLengthTextSerialNumberFormatting> buf2;
+
+	for( TInt i = 0; i < serialNumber.Length(); i++ )
+	   {
+	   buf2.Format( KCertManUIDetailsViewHexaFormat, serialNumber[i] );
+	   sCertSerialNoDetails.append( QString( (QChar*)buf2.Ptr(),buf2.Length() ) );
+	   }
+	addToListWidget(certDisplayDetails, sCertSerialNo, sCertSerialNoDetails);
+	}
+
+void CpCertDetailView::addFingerprint(	const CCertificate& certificate, 
+										HbListWidget& certDisplayDetails)
+	{
+	RDEBUG("0", 0);
+	// certificate fingerprint SHA-1
+	QString sSha1("Fingerprint (SHA1):");
+	TPtrC8 sha1_fingerprint = certificate.Fingerprint();
+	HBufC* finalSha1 = NULL;
+	QString sSha1Details = NULL;
+	
+	QT_TRAP_THROWING
+		(	 
+		finalSha1 = HBufC::NewLC(100);
+		TPtr finalShaPtr = finalSha1->Des();
+		divideIntoBlocks( sha1_fingerprint, finalShaPtr );
+		sSha1Details = QString( (QChar*)finalShaPtr.Ptr(), finalShaPtr.Length() );
+		CleanupStack::PopAndDestroy(finalSha1);
+		)
+	
+	addToListWidget(certDisplayDetails, sSha1, sSha1Details);
+		
+	// certificate fingerprint MD5
+	QString sMd5("Fingerprint (MD5):");
+	CMD5* md5= NULL;
+	QT_TRAP_THROWING
+		(	 
+		md5 = CMD5::NewL();
+		CleanupStack::PushL( md5 );
+		TBuf8<20> fingerprint = md5->Hash( certificate.Encoding() );
+		CleanupStack::PopAndDestroy( md5 );
+		HBufC* finalMd5 = NULL;
+		finalMd5 = HBufC::NewLC(100);
+		TPtr finalMd5Ptr = finalMd5->Des();
+		divideIntoBlocks( fingerprint, finalMd5Ptr );
+		QString sMd5Details = QString( (QChar*)finalMd5Ptr.Ptr(), finalMd5Ptr.Length());
+		CleanupStack::PopAndDestroy(finalMd5);
+		addToListWidget(certDisplayDetails, sMd5, sMd5Details);
+		)
+	}
+
+void CpCertDetailView::addPublicKeyDetailsL(	const CCertificate& certificate, 
+											HbListWidget& certDisplayDetails )
+	{
+	RDEBUG("0", 0);
+	// Public key
+    // Should look like: "Public key (%0U %1N bit):"
+        
+	QString sPublicKey("Public key ("); // %S %d bits):");
+	sPublicKey.append(asymmetricAlgoId(certificate));
+	
+	// Get public key already here to get length of it for string loader.
+	const CSubjectPublicKeyInfo& publicKey = certificate.PublicKey();
+	TPtrC8 keyData = publicKey.KeyData();
+	TInt size = keyData.Size();  // %1N
+
+	// To get key size decode DER encoded key got from the certificate.
+	TX509KeyFactory key;
+
+	// There doesn't seem to be definition of MAX_INT anywhere so calculate it.
+	TReal maxInt;
+	TReal intBits = sizeof( TInt ) * 8;
+	Math::Pow( maxInt, 2, intBits );
+	maxInt = ( maxInt / 2 ) - 1;
+
+	TAlgorithmId algorithmId = certificate.SigningAlgorithm().AsymmetricAlgorithm().Algorithm();
+	switch( algorithmId )
+		{
+		case ERSA:
+			{
+			const CRSAPublicKey* keyRSA = key.RSAPublicKeyL( keyData );
+
+			const TInteger& n = keyRSA->N();
+
+			TUint keySizeN = n.BitCount();
+
+			// Play it safe.
+			if( keySizeN < maxInt )
+				{
+				size = keySizeN;
+				}
+
+			delete keyRSA;
+
+			break;
+			}
+		case EDSA:
+			{
+			TPtrC8 params = publicKey.EncodedParams();
+			const CDSAPublicKey* keyDSA = key.DSAPublicKeyL( params, keyData );
+
+			const TInteger& y = keyDSA->Y();
+
+			TUint keySizeY = y.BitCount();
+
+			// Play it safe.
+			if( keySizeY < maxInt )
+				{
+				size = keySizeY;
+				}
+
+			delete keyDSA;
+
+			break;
+			}
+		// There doesn't seem to be TX509KeyFactory function for DH keys.
+		// If the key is DH or unknown, just multiply length of the key
+		// in bytes with 8. It is not correct but at least gives an idea.
+		// Without setting something to size 'unknown' text should be used
+		// below for the string which is much more error prone than setting
+		// at least something.
+		case EDH:
+		default:
+			{
+			size = 8 * keyData.Size();
+			}
+		}
+
+	sPublicKey.append(" ").append(QString::number(size)).append(" bits):");
+	
+	// Finally append the public key.
+	HBufC* pubKey = HBufC::NewLC(size*3);
+	TPtr pubKeyPtr = pubKey->Des();
+	divideIntoBlocks( keyData, pubKeyPtr );
+	QString sPublicKeyDetails = QString ( (QChar*)pubKeyPtr.Ptr(), pubKeyPtr.Length());
+	CleanupStack::PopAndDestroy(pubKey);
+	addToListWidget(certDisplayDetails, sPublicKey, sPublicKeyDetails);
+	}
+
+QString CpCertDetailView::asymmetricAlgoId( const CCertificate& certificate )
+	{
+	RDEBUG("0", 0);
+	QString sAsymmetricAlgoId = 0;
+	// public-key algorithm
+	TAlgorithmId algorithmId = certificate.SigningAlgorithm().AsymmetricAlgorithm().Algorithm();
+	switch( algorithmId )
+		{
+		case ERSA:
+			{
+			sAsymmetricAlgoId = "RSA";
+			break;
+			}
+		case EDSA:
+			{
+			sAsymmetricAlgoId = "DSA";
+			break;
+			}
+		case EDH:
+			{
+			sAsymmetricAlgoId = "DH";
+			break;
+			}
+		default:
+			{
+			sAsymmetricAlgoId = "Unknown";
+			}
+		}
+	return sAsymmetricAlgoId;
+	}
+
+void CpCertDetailView::addToListWidget(HbListWidget& certDisplayDetails, const QString& data )
+	{
+	HbListWidgetItem* wItem = q_check_ptr(new HbListWidgetItem());
+	wItem->setText(data);
+	certDisplayDetails.addItem(wItem);	
+	}
+
+void CpCertDetailView::addToListWidget(	HbListWidget& certDisplayDetails, 
+										const QString& displayString, 
+										const QString& displayDetails )
+	{
+	HbListWidgetItem* wDisplayString = q_check_ptr(new HbListWidgetItem());
+	wDisplayString->setText(displayString);
+	certDisplayDetails.addItem(wDisplayString);
+		
+	HbListWidgetItem* wDisplayDetails = q_check_ptr(new HbListWidgetItem());
+	wDisplayDetails->setText(displayDetails);
+	certDisplayDetails.addItem(wDisplayDetails);
+	}
+
+void CpCertDetailView::validateCertificateL(
+    TInt aIndex, const CCertificate& certDetails, const CCTCertInfo& aCertInfo, CpCertView::TCertificateViews aType )
+    {
+    RDEBUG("0", 0);
+    TInt poppableItems = 0;
+    // Check allways first the validity period
+    // Show Expired/Not yet valid notes
+    const CValidityPeriod& validityPeriod = certDetails.ValidityPeriod();
+    const TTime& startValue = validityPeriod.Start();
+    const TTime& finishValue = validityPeriod.Finish();
+    TTime current;
+    current.UniversalTime();
+
+    if ( startValue > current )
+        {
+        // certificate is not valid yet
+        HbMessageBox::warning("The certificate is not valid yet");
+        }
+    else if ( finishValue < current )
+        {
+        // certificate is expired
+        HbMessageBox::warning("The certificate has expired");
+        }
+    else
+        {
+        // put here check for certificate status, show warning notes if needed
+        TBool noValidationError = ETrue;
+        CArrayFixFlat<TValidationError>* validationError = NULL;
+        // set it to the most common cert format
+        TCertificateFormat certificateFormat = EX509Certificate;
+
+        if ( aType == CpCertView::EAuthorityView )
+            {
+            certificateFormat = mCertDataContainer.iCALabelEntries[aIndex]->
+                                        iCAEntry->CertificateFormat();
+            }
+        else if ( aType == CpCertView::ETrustedView )
+            {
+            certificateFormat = mCertDataContainer.iPeerLabelEntries[aIndex]->
+                                        iPeerEntry->CertificateFormat();
+            }
+        else if ( aType == CpCertView::EDeviceView )
+            {
+            certificateFormat = mCertDataContainer.iDeviceLabelEntries[aIndex]->
+                                        iDeviceEntry->CertificateFormat();
+            }
+        else if( aType == CpCertView::EPersonalView )
+            {
+            certificateFormat = mCertDataContainer.iUserLabelEntries[aIndex]->
+                                        iUserEntry->CertificateFormat();
+            }
+
+        switch ( certificateFormat )
+            {
+            case EX509Certificate:
+                {
+                validationError = validateX509CertificateL((CX509Certificate&)certDetails );
+                break;
+                }
+            default:
+                {
+                validationError = new ( ELeave) CArrayFixFlat<TValidationError>( 1 );
+                break;
+                }
+            }
+        CleanupStack::PushL( validationError );
+        poppableItems++;
+
+        TInt errorCount = validationError->Count();
+        TBool ready = EFalse;
+        for ( TInt i = 0; i < errorCount && !ready; i++ )
+            {
+            TValidationError errorType = validationError->At(i);
+
+            switch ( errorType )
+                {
+                case EValidatedOK:
+                case EChainHasNoRoot:
+                case EBadKeyUsage:
+                // Ignore these errors
+                    //LOG_WRITE( "Ignored certificate validation error" );
+                    break;
+
+                default:
+                // certificate is corrupted
+                noValidationError = EFalse;
+                HbMessageBox::warning("The certificate is corrupted");
+                ready = ETrue;
+                    break;
+                }
+            }
+
+        if ( noValidationError  && (aType == CpCertView::EAuthorityView ))
+        // Check for last if the CA certificate has no clients,
+        // ie. the trust state of every client is No
+        // For user certificates we don't do the check
+            {
+
+            RArray<TUid> trusterUids;
+            CleanupClosePushL( trusterUids );
+            poppableItems++;
+
+            mCertDataContainer.iWrapper->GetApplicationsL(
+                mCertDataContainer.CertManager(), aCertInfo, trusterUids );
+
+            if ( trusterUids.Count() == 0)
+                {
+                HbMessageBox::warning("Certificate not trusted");
+                }
+            }
+        }
+    CleanupStack::PopAndDestroy( poppableItems );
+    }
+
+CArrayFixFlat<TValidationError>* CpCertDetailView::validateX509CertificateL( const CX509Certificate& certDetails )
+    {
+    RDEBUG("0", 0);
+    TInt poppableItems = 0;
+    CArrayFixFlat<TValidationError>* validationError =
+        new ( ELeave ) CArrayFixFlat<TValidationError>( 1 );
+    CleanupStack::PushL( validationError ); //This is returned, so it isn't destroyed at the end.
+        
+    TTime GMTTime;
+    GMTTime.UniversalTime(); // Get Universal Time
+    RPointerArray<CX509Certificate> certArray;
+    certArray.Append( &certDetails );
+
+    CPKIXCertChain* chain = CPKIXCertChain::NewLC(
+        mCertDataContainer.iRfs, certDetails.Encoding(), certArray );
+    ++poppableItems;
+
+    CPKIXValidationResult* result = CPKIXValidationResult::NewLC();
+    ++poppableItems;
+    mCertDataContainer.iWrapper->ValidateX509RootCertificateL( result, GMTTime, chain );
+
+    TValidationStatus validationStatus = result->Error();
+    //Set reserve space. One for error, other for warnings.
+    validationError->SetReserveL( 1 + result->Warnings().Count() );
+    validationError->AppendL(validationStatus.iReason);
+    for ( TUint8 i = 0; i < result->Warnings().Count(); i++ )
+        {
+		validationError->AppendL( result->Warnings().At(0).iReason );
+        }
+
+    CleanupStack::PopAndDestroy( poppableItems, chain );    //  All but validationError.
+    CleanupStack::Pop(validationError); 
+    return validationError;
+    }
+
+TKeyUsagePKCS15 CpCertDetailView::keyUsageAndLocationL( const CCTCertInfo& certEntry,
+                                                        TUid* keyLocation )
+    {
+    TKeyUsagePKCS15 keyUsage;
+		RDEBUG("0", 0);
+    // Check whether we have key for this certificate
+    RMPointerArray<CCTKeyInfo> keyEntry;
+    TCTKeyAttributeFilter filter;
+    filter.iKeyId = certEntry.SubjectKeyId();
+
+    mCertDataContainer.iWrapper->ListL( mCertDataContainer.KeyManager(), &keyEntry, filter );
+
+    if (keyEntry.Count())
+        {
+        keyUsage = keyEntry[0]->Usage();
+        // Get Location
+        keyLocation->iUid = keyEntry[0]->Token().TokenType().Type().iUid ;
+        }
+    else
+        {
+        keyUsage = EPKCS15UsageNone;
+        }
+
+    keyEntry.Close();
+    return keyUsage;
+    }
+
+// ---------------------------------------------------------
+// CCertManUICertificateHelper::setLocationInfo( (HBufC& aMessage,
+//                                               TBool certificate,
+//                                               TUid* aLocUid)
+// Adds certificate/private key's location info to certificate details
+// ---------------------------------------------------------
+//
+void CpCertDetailView::setLocationInfo(TBool certificate, TUid locUid, HbListWidget& certDisplayDetails)
+    {
+    RDEBUG("0", 0);
+    QString locationDetails = "(Not defined)";
+
+    switch ( locUid.iUid )
+        {
+        case KFileCertStoreUid:
+        case KTrustedServerCertStoreUid:
+        case KDeviceCertStoreUid:
+        case KDeviceKeyStoreUid:
+        case KTokenTypeFileKeystore:
+        	locationDetails = "Phone memory";
+            break;
+
+        case KWIMCertStoreUid:
+        	locationDetails = "Smart card";
+            break;
+
+        default:
+            if ( !certificate )
+                {
+				locationDetails = "No private key";
+                }
+            break;
+        }
+
+    QString location = "Location:";
+    if ( !certificate )
+        {
+		location = "Private key location:";
+        }
+
+    addToListWidget(certDisplayDetails, location, locationDetails );
+            
+    }
+
+// ---------------------------------------------------------
+// CCertManUICertificateHelper::divideIntoBlocks
+// ---------------------------------------------------------
+//
+void CpCertDetailView::divideIntoBlocks( const TDesC8& input, TPtr& output )
+    {
+    RDEBUG("0", 0);
+    const TInt KBlockLength = 2;
+    TInt blockIndex = 0;
+    for ( TInt j = 0 ; j < input.Length() ; j++ )
+        {
+        if ( blockIndex == KBlockLength )
+            {
+			output.Append( KBlockSeparator );
+            blockIndex = 0;
+            }
+        output.AppendNumFixedWidthUC( (TUint)(input[ j ]), EHex, 2 );
+        ++blockIndex;
+        }
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/cpadvancedsecplugin/src/cpcertmanuisyncwrapper.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,777 @@
+/*
+* 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:   Implements a synchronous wrapper for easier use of Symbian's
+*                Security Frameworks's API's.
+*
+*/
+
+
+// INCLUDE FILES
+#include <unifiedcertstore.h>
+#include <unifiedkeystore.h>
+#include <mctwritablecertstore.h>
+#include <x509cert.h>
+#include <pkixcertchain.h>
+#include <../../inc/cpsecplugins.h>
+#include "cpcertmanuisyncwrapper.h"
+
+// CONSTANTS
+_LIT_SECURITY_POLICY_C1( KKeyStoreUsePolicy, ECapabilityReadUserData );
+// Maximum length of a certificate
+const TInt KMaxCertificateLength = 5000;
+const TInt KMaxKeyLength = 10000;
+
+// -----------------------------------------------------------------------------
+// CpCertManUISyncWrapper::ListL
+// -----------------------------------------------------------------------------
+//
+void CpCertManUISyncWrapper::ListL(
+    CUnifiedCertStore*& aStore,
+    RMPointerArray<CCTCertInfo>* aArray,
+    const CCertAttributeFilter& aFilter,
+    const TUid aTokenUid )
+    {
+    RDEBUG("0", 0);
+    if ( IsActive() )
+        {
+        // Wrapper is active. Don't go further
+        User::Leave(KErrGeneral);
+        }
+
+    TInt count = aStore->CertStoreCount();
+    for ( TInt ii = 0; ii < count; ii++ )
+        {
+        MCTCertStore& certstore = aStore->CertStore( ii );
+        MCTToken& token = certstore.Token();
+        TUid tokenuid = token.Handle().iTokenTypeUid;
+        if ( tokenuid == aTokenUid )
+            {
+            certstore.List( *aArray, aFilter, iStatus );
+            iOperation = EOperationList;
+            iStore = aStore;
+            SetActive();
+            iWait.Start();
+            User::LeaveIfError( iStatus.Int() );
+            break;
+            }
+        }
+    iOperation = EOperationNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CpCertManUISyncWrapper::ListL
+// -----------------------------------------------------------------------------
+//
+void CpCertManUISyncWrapper::ListL(
+    CUnifiedKeyStore*& aStore,
+    RMPointerArray<CCTKeyInfo>* aArray,
+    const TCTKeyAttributeFilter& aFilter )
+    {
+    RDEBUG("0", 0);
+    if ( IsActive() )
+        {
+        // Wrapper is active. Don't go further
+		User::Leave(KErrGeneral);
+        }
+
+    aStore->List( *aArray, aFilter, iStatus );
+    iOperation = EOperationKeyList;
+    iKeyStore = aStore;
+    SetActive();
+    iWait.Start();
+    User::LeaveIfError( iStatus.Int() );
+    iOperation = EOperationNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CpCertManUISyncWrapper::GetCertificateL
+// -----------------------------------------------------------------------------
+//
+void CpCertManUISyncWrapper::GetCertificateL( CUnifiedCertStore*& aStore,
+    const CCTCertInfo& aCertInfo,
+    CCertificate*& aCert,
+    TUid aTokenUid )
+    {
+    aCert = NULL;
+    RDEBUG("0", 0);
+    HBufC8* buf = HBufC8::NewLC( KMaxCertificateLength );
+    iCertPtr.Set( buf->Des() );
+
+    TInt count = aStore->CertStoreCount();
+    for (TInt i = 0; i < count; i++)
+        {
+        MCTCertStore& certstore = aStore->CertStore( i );
+        MCTToken& token = certstore.Token();
+        TUid tokenuid = token.Handle().iTokenTypeUid;
+        if ( tokenuid == aTokenUid )
+            {
+            certstore.Retrieve( aCertInfo, iCertPtr, iStatus );
+            iOperation = EGetCertificate;
+            iStore = aStore;
+            SetActive();
+            iWait.Start();
+            User::LeaveIfError( iStatus.Int() );
+            break;
+            }
+        }
+
+    
+	switch ( aCertInfo.CertificateFormat() )
+		{
+		case EX509Certificate:
+			{
+			aCert = CX509Certificate::NewL( iCertPtr );
+			break;
+			}
+		case EX509CertificateUrl:
+			{
+			break;
+			}
+		default:
+			{
+			break;
+			}
+		}
+        
+    CleanupStack::PopAndDestroy(buf);  
+    iOperation = EOperationNone;
+
+    }
+
+// -----------------------------------------------------------------------------
+// CpCertManUISyncWrapper::DeleteCertL
+// -----------------------------------------------------------------------------
+//
+void CpCertManUISyncWrapper::DeleteCertL( CUnifiedCertStore*& aStore,
+    const CCTCertInfo& aCertInfo )
+    {
+    RDEBUG("0", 0);
+    aStore->Remove( aCertInfo, iStatus );
+    iOperation = EOperationDelete;
+    iStore = aStore;
+    SetActive();
+    iWait.Start();
+    User::LeaveIfError( iStatus.Int() );
+    iOperation = EOperationNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CpCertManUISyncWrapper::DeleteCertL
+// -----------------------------------------------------------------------------
+//
+void CpCertManUISyncWrapper::DeleteCertL( CUnifiedCertStore*& aStore,
+    const CCTCertInfo& aCertInfo,
+    TUid aTokenUid )
+    {
+    RDEBUG("0", 0);
+    TInt count = aStore->WritableCertStoreCount();
+    for (TInt i = 0; i < count; i++)
+        {
+        MCTWritableCertStore& writablestore = aStore->WritableCertStore( i );
+        MCTToken& token = writablestore.Token();
+        TUid tokenuid = token.Handle().iTokenTypeUid;
+        if ( tokenuid == aTokenUid )
+            {
+            writablestore.Remove( aCertInfo, iStatus );
+            iOperation = EOperationDelete;
+            iStore = aStore;
+            SetActive();
+            iWait.Start();
+            User::LeaveIfError( iStatus.Int() );
+            break;
+            }
+        }
+    iOperation = EOperationNone;
+    }
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CpCertManUISyncWrapper::CpCertManUISyncWrapper()
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CpCertManUISyncWrapper::CpCertManUISyncWrapper() : CActive( EPriorityStandard ), iCertPtr(0,0)
+    {
+    CActiveScheduler::Add( this );
+    }
+
+// -----------------------------------------------------------------------------
+// CpCertManUISyncWrapper::ConstructL()
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CpCertManUISyncWrapper::ConstructL()
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CpCertManUISyncWrapper::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CpCertManUISyncWrapper* CpCertManUISyncWrapper::NewLC()
+    {
+    CpCertManUISyncWrapper* wrap = new ( ELeave ) CpCertManUISyncWrapper();
+    CleanupStack::PushL( wrap );
+    wrap->ConstructL();
+    return wrap;
+    }
+
+// -----------------------------------------------------------------------------
+// CpCertManUISyncWrapper::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CpCertManUISyncWrapper* CpCertManUISyncWrapper::NewL()
+    {
+    CpCertManUISyncWrapper* wrap = CpCertManUISyncWrapper::NewLC();
+    CleanupStack::Pop(wrap);
+    return wrap;
+    }
+
+// Destructor
+CpCertManUISyncWrapper::~CpCertManUISyncWrapper()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CpCertManUISyncWrapper::RunL
+// If no errors happened, stop. Show an error note if needed.
+// -----------------------------------------------------------------------------
+//
+
+void CpCertManUISyncWrapper::RunL()
+    {
+    RDEBUG("0", 0);
+    if ( iWait.IsStarted() )
+        {
+        iWait.AsyncStop();
+        }
+
+    }
+
+// -----------------------------------------------------------------------------
+// CpCertManUISyncWrapper::DoCancel
+// Cancels the ongoing operation if possible.
+// -----------------------------------------------------------------------------
+//
+void CpCertManUISyncWrapper::DoCancel()
+    {
+    RDEBUG("iOperation", iOperation);
+    switch ( iOperation )
+        {
+        case EOperationInit:
+            {
+            iStore->CancelInitialize();
+            break;
+            }
+        case EOperationList:
+            {
+            iStore->CancelList();
+            break;
+            }
+        case EGetCertificate:
+            {
+            iStore->CancelRetrieve();
+            break;
+            }
+        case EAddCertificate:
+            {
+            iStore->Cancel();
+            break;
+            }
+        case ERetriveURLCertificate:
+            {
+            iStore->CancelRetrieve();
+            break;
+            }
+        case EOperationDelete:
+            {
+            iStore->CancelRemove();
+            break;
+            }
+        case EOperationGetApps:
+            {
+            iStore->CancelApplications();
+            break;
+            }
+        case EOperationValidateX509Root:
+            {
+            iChain->CancelValidate();
+            break;
+            }
+        case EShowErrorNote:
+            {
+            break;
+            }
+        case EOperationInitKeyStore:
+            {
+            iKeyStore->CancelInitialize();
+            break;
+            }
+        case EOperationKeyList:
+            {
+            iKeyStore->CancelList();
+            break;
+            }
+        case EOperationExportKey:
+            {
+            iKeyStore->CancelExportKey();
+            break;
+            }
+        case EOperationImportKey:
+            {
+            iKeyStore->CancelImportKey();
+            break;
+            }
+        case EOperationDeleteKey:
+            {
+            iKeyStore->CancelDeleteKey();
+            break;
+            }
+        default:
+            {
+            break;
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CpCertManUISyncWrapper::InitStoreL
+// -----------------------------------------------------------------------------
+//
+void CpCertManUISyncWrapper::InitStoreL( CUnifiedCertStore*& aStore )
+    {
+    aStore->Initialize( iStatus );
+    iOperation = EOperationInit;
+    iStore = aStore;
+    SetActive();
+    iWait.Start();
+    User::LeaveIfError( iStatus.Int() );
+    iOperation = EOperationNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CpCertManUISyncWrapper::InitStoreL
+// -----------------------------------------------------------------------------
+//
+void CpCertManUISyncWrapper::InitStoreL( CUnifiedKeyStore*& aStore  )
+    {
+    aStore->Initialize( iStatus );
+    iOperation = EOperationInitKeyStore;
+    iKeyStore = aStore;
+    SetActive();
+    iWait.Start();
+    User::LeaveIfError( iStatus.Int() );
+    iOperation = EOperationNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CpCertManUISyncWrapper::ListL
+// -----------------------------------------------------------------------------
+//
+void CpCertManUISyncWrapper::ListL(
+    CUnifiedCertStore*& aStore,
+    RMPointerArray<CCTCertInfo>* aArray,
+    const CCertAttributeFilter& aFilter )
+    {
+    
+    if ( IsActive() )
+        {
+        // Wrapper is active. Don't go further
+		User::Leave(KErrGeneral);
+        }
+
+    aStore->List( *aArray, aFilter, iStatus );
+    iOperation = EOperationList;
+    iStore = aStore;
+    SetActive();
+    iWait.Start();
+    User::LeaveIfError( iStatus.Int() );
+    iOperation = EOperationNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CpCertManUISyncWrapper::ListL
+// -----------------------------------------------------------------------------
+//
+void CpCertManUISyncWrapper::ListL(
+    CUnifiedKeyStore*& aStore,
+    RMPointerArray<CCTKeyInfo>* aArray,
+    const TCTKeyAttributeFilter& aFilter,
+    const TUid aTokenUid )
+    {
+    
+    if ( IsActive() )
+        {
+        // Wrapper is active. Don't go further
+		User::Leave(KErrGeneral);
+        }
+
+    TInt count = aStore->KeyStoreManagerCount();
+    for ( TInt ii = 0; ii < count; ii++ )
+        {
+        MCTKeyStoreManager& keystoremanager = aStore->KeyStoreManager( ii );
+        MCTToken& token = keystoremanager.Token();
+        TUid tokenuid = token.Handle().iTokenTypeUid;
+        if ( tokenuid == aTokenUid )
+            {
+            keystoremanager.List( *aArray, aFilter, iStatus );
+            iOperation = EOperationKeyList;
+            iKeyStore = aStore;
+            SetActive();
+            iWait.Start();
+            User::LeaveIfError( iStatus.Int() );
+            break;
+            }
+        }
+    iOperation = EOperationNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CpCertManUISyncWrapper::GetCertificateL
+// -----------------------------------------------------------------------------
+//
+void CpCertManUISyncWrapper::GetCertificateL(
+    CUnifiedCertStore*& aStore,
+    const CCTCertInfo& aCertInfo,
+    CCertificate*& aCert )
+    {    
+    aCert = NULL;
+    HBufC8* buf = HBufC8::NewLC( KMaxCertificateLength );
+    iCertPtr.Set( buf->Des() );
+    aStore->Retrieve( aCertInfo, iCertPtr, iStatus);
+    iOperation = EGetCertificate;
+    iStore = aStore;
+    SetActive();
+    iWait.Start();
+    User::LeaveIfError( iStatus.Int() );
+    
+	switch ( aCertInfo.CertificateFormat() )
+		{
+		case EX509Certificate:
+			{
+			aCert = CX509Certificate::NewL( iCertPtr );
+			break;
+			}
+		case EX509CertificateUrl:
+			{
+			break;
+			}
+		default:
+			{
+			break;
+			}
+		}
+    CleanupStack::PopAndDestroy(buf); 
+    iOperation = EOperationNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CpCertManUISyncWrapper::ValidateX509RootCertificateL
+// -----------------------------------------------------------------------------
+//
+void CpCertManUISyncWrapper::ValidateX509RootCertificateL(
+    CPKIXValidationResult*& aValidationResult,
+    const TTime& aValidationTime, CPKIXCertChain*& aChain )
+    {
+    
+    aChain->ValidateL( *aValidationResult, aValidationTime, iStatus );
+    iOperation = EOperationValidateX509Root;
+    iChain = aChain;
+    SetActive();
+    iWait.Start();
+    iOperation = EOperationNone;
+    User::LeaveIfError(iStatus.Int());
+    }
+
+// -----------------------------------------------------------------------------
+// CpCertManUISyncWrapper::GetUrlCertificateL
+// -----------------------------------------------------------------------------
+//
+void CpCertManUISyncWrapper::GetUrlCertificateL(
+    CUnifiedCertStore*& aStore,
+    const CCTCertInfo& aCertInfo,
+    TDes8& aUrl )
+    {
+    
+    aStore->Retrieve( aCertInfo, aUrl, iStatus);
+    iOperation = ERetriveURLCertificate;
+    iStore = aStore;
+    SetActive();
+    iWait.Start();
+    User::LeaveIfError( iStatus.Int() );
+    iOperation = EOperationNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CpCertManUISyncWrapper::GetApplicationsL
+// -----------------------------------------------------------------------------
+//
+void CpCertManUISyncWrapper::GetApplicationsL( CUnifiedCertStore*& aStore,
+    const CCTCertInfo& aCertInfo, RArray<TUid>& aApps )
+    {
+    
+    aStore->Applications( aCertInfo, aApps, iStatus );
+    iOperation = EOperationGetApps;
+    iStore = aStore;
+    SetActive();
+    iWait.Start();
+    User::LeaveIfError( iStatus.Int() );
+    iOperation = EOperationNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CpCertManUISyncWrapper::SetApplicabilityL
+// -----------------------------------------------------------------------------
+//
+void CpCertManUISyncWrapper::SetApplicabilityL( CUnifiedCertStore*& aStore,
+    const CCTCertInfo& aCertInfo,
+    RArray<TUid>& aApplications )
+    {
+    
+    aStore->SetApplicability( aCertInfo, aApplications, iStatus );
+    iOperation = EOperationSetApplicability;
+    iStore = aStore;
+    SetActive();
+    iWait.Start();
+    User::LeaveIfError( iStatus.Int() );    
+	aStore->SetTrust( aCertInfo, ETrue, iStatus );
+	iOperation = EOperationSetToTrusted;
+	SetActive();
+	iWait.Start();
+	User::LeaveIfError( iStatus.Int() );
+    iOperation = EOperationNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CpCertManUISyncWrapper::MoveKeyL
+// -----------------------------------------------------------------------------
+//
+void CpCertManUISyncWrapper::MoveKeyL(
+    CUnifiedKeyStore*& aStore,
+    const TCTKeyAttributeFilter& aFilter,
+    const TUid aSourceTokenId,
+    const TUid aTargetTokenId )
+    {
+    
+    TInt sourceIndex(-1);
+    TInt targetIndex(-1);
+
+    // Find the index of key stores
+    TInt count = aStore->KeyStoreManagerCount();
+
+    for (TInt ii = 0; ii < count; ii++)
+        {
+        MCTKeyStoreManager& keystoremanager = aStore->KeyStoreManager( ii );
+        MCTToken& token = keystoremanager.Token();
+        TUid tokenuid = token.Handle().iTokenTypeUid;
+
+        if ( tokenuid == aSourceTokenId )
+            {
+            sourceIndex = ii;
+            }
+
+        if ( tokenuid == aTargetTokenId )
+            {
+            targetIndex = ii;
+            }
+        }
+
+    if (( sourceIndex == -1 ) || ( targetIndex == -1 ))
+        {
+        // Key store(s) doesn't exist
+        User::Leave( KErrNotFound );
+        }
+
+    RMPointerArray<CCTKeyInfo> keyEntries;
+
+    MCTKeyStoreManager& sourcekeystore =
+                            aStore->KeyStoreManager( sourceIndex );
+
+    MCTKeyStoreManager& targetkeystore =
+                            aStore->KeyStoreManager( targetIndex );
+
+
+    ListL( aStore, &keyEntries, aFilter, aSourceTokenId );
+
+    // Go through all matching keys and move them to
+    // target store
+    for ( TInt ii = 0; ii < keyEntries.Count(); ii++ )
+        {
+        HBufC8* keyData = HBufC8::NewLC( KMaxKeyLength );
+
+        // Retrieve key from source key store
+        sourcekeystore.ExportKey( (*keyEntries[ii]).Handle(), keyData, iStatus );
+        iOperation = EOperationExportKey;
+        SetActive();
+        iWait.Start();
+        User::LeaveIfError( iStatus.Int() );
+
+        TCTTokenObjectHandle sourceKeyHandle = (*keyEntries[ii]).Handle();
+
+        // Import key to target key store
+
+        // If key info access type indicates that key is local, then importing is
+        // not possible. The following is the workarround. Almost identical
+        // copy of keyinfo is created without CCTKeyInfo::ELocal access type flag.
+        // UsePolicy is also updated
+        TInt accessType = (*keyEntries[ii]).AccessType();
+        if ( accessType & CCTKeyInfo::ELocal )
+            {
+            // CCTKeyInfo::ELocal is set in key info
+            HBufC* label = (*keyEntries[ii]).Label().AllocLC();
+
+            // The following XOR operation will clear local bit if it is on.
+            accessType ^= CCTKeyInfo::ELocal;
+
+            CCTKeyInfo* keyInfo = CCTKeyInfo::NewL( (*keyEntries[ii]).ID(),
+                                (*keyEntries[ii]).Usage(),
+                                (*keyEntries[ii]).Size(),
+                                NULL,
+                                label,
+                                (*keyEntries[ii]).Token(),
+                                (*keyEntries[ii]).HandleID(),
+                                KKeyStoreUsePolicy,
+                                (*keyEntries[ii]).ManagementPolicy(),
+                                (*keyEntries[ii]).Algorithm(),
+                                accessType,
+                                (*keyEntries[ii]).Native(),
+                                (*keyEntries[ii]).StartDate(),
+                                (*keyEntries[ii]).EndDate() );
+
+            CleanupStack::Pop(label);
+            targetkeystore.ImportKey( *keyData, keyInfo, iStatus );
+            }
+        else
+            {
+            targetkeystore.ImportKey( *keyData, keyEntries[ii], iStatus );
+            }
+
+        iOperation = EOperationImportKey;
+        SetActive();
+        iWait.Start();
+        User::LeaveIfError( iStatus.Int() );
+
+        // Delete key from source key store
+        sourcekeystore.DeleteKey( sourceKeyHandle, iStatus );
+        iOperation = EOperationDeleteKey;
+        SetActive();
+        iWait.Start();
+        User::LeaveIfError( iStatus.Int() );
+
+        CleanupStack::PopAndDestroy(keyData);  
+        }
+
+    }
+
+// -----------------------------------------------------------------------------
+// CpCertManUISyncWrapper::MoveCertL
+// -----------------------------------------------------------------------------
+//
+TInt CpCertManUISyncWrapper::MoveCertL(
+    CUnifiedCertStore*& aStore,
+    const CCTCertInfo& aCertInfo,
+    const TUid aSourceTokenId,
+    const TUid aTargetTokenId )
+    {
+    
+    TInt sourceIndex(-1);
+    TInt targetIndex(-1);
+    TInt certCount (0);
+
+    // Find the index of certificate stores
+    TInt count = aStore->WritableCertStoreCount();
+    for (TInt ii = 0; ii < count; ii++)
+        {
+        MCTWritableCertStore& writablestore = aStore->WritableCertStore( ii );
+        MCTToken& token = writablestore.Token();
+        TUid tokenuid = token.Handle().iTokenTypeUid;
+
+        if ( tokenuid == aSourceTokenId )
+            {
+            sourceIndex = ii;
+            }
+
+        if ( tokenuid == aTargetTokenId )
+            {
+            targetIndex = ii;
+            }
+        }
+
+    if (( sourceIndex == -1 ) || ( targetIndex == -1 ))
+        {
+        // Certificate store(s) doesn't exist
+        User::Leave( KErrNotFound );
+        }
+
+
+    MCTWritableCertStore& sourcewritablestore =
+                    aStore->WritableCertStore( sourceIndex );
+
+    // All of the certificates that are associated with same
+    // private key will be moved to target certificate store.
+    CCertAttributeFilter* filter = CCertAttributeFilter::NewL();
+    filter->SetOwnerType( EUserCertificate );
+    filter->SetSubjectKeyId( aCertInfo.SubjectKeyId() );
+    RMPointerArray<CCTCertInfo> certEntries;
+
+    // List certificates from source certificate store
+    ListL( aStore, &certEntries, *filter, aSourceTokenId );
+
+    delete filter;
+
+    for ( TInt ii = 0; ii < certEntries.Count(); ii++ )
+        {
+        // Retrieve certificate from source certificate store
+        HBufC8* buf = HBufC8::NewLC( KMaxCertificateLength );
+        iCertPtr.Set( buf->Des() );
+        sourcewritablestore.Retrieve( *certEntries[ii], iCertPtr, iStatus );
+        iOperation = EGetCertificate;
+        SetActive();
+        iWait.Start();
+        User::LeaveIfError( iStatus.Int() );
+
+        // Add certificate to target certificate store
+        MCTWritableCertStore& targetwritablestore =
+                        aStore->WritableCertStore( targetIndex );
+
+        targetwritablestore.Add( (*certEntries[ii]).Label(), EX509Certificate,
+                      EUserCertificate, &((*certEntries[ii]).SubjectKeyId()),
+                      &((*certEntries[ii]).IssuerKeyId()), *buf, iStatus );
+
+        iOperation = EAddCertificate;
+        SetActive();
+        iWait.Start();
+        User::LeaveIfError( iStatus.Int() );
+
+        // Delete certificate from source certificate store
+        sourcewritablestore.Remove( *certEntries[ii], iStatus );
+        iOperation = EOperationDelete;
+        iStore = aStore;
+        SetActive();
+        iWait.Start();
+        User::LeaveIfError( iStatus.Int() );
+        iOperation = EOperationNone;
+        certCount++;
+        CleanupStack::PopAndDestroy(buf);  
+        }
+
+    return certCount;
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/cpadvancedsecplugin/src/cpcertpluginloader.cpp	Tue Aug 31 16:04:40 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:  
+ *
+ */
+
+#include <cpsettingformentryitemdataimpl.h>
+
+#include "cpcertpluginloader.h"
+#include "cpsecurityview.h"
+#include <hbapplication.h>
+#include <../../inc/cpsecplugins.h>
+
+CpCertPluginLoader::CpCertPluginLoader()
+	{
+		RDEBUG("0", 0);
+		mTranslator = q_check_ptr( new QTranslator());
+		QString path = "z:/resource/qt/translations/";
+		QString appName = "certificate_manager_";
+		QString lang = QLocale::system().name();
+		mTranslator->load(path + appName + lang);
+		qApp->installTranslator(mTranslator);		
+	}
+
+CpCertPluginLoader::~CpCertPluginLoader()
+	{
+	    if (mTranslator)
+        {
+        if (mTranslator->isEmpty() == false)
+            qApp->removeTranslator(mTranslator);
+        delete mTranslator;
+        }	
+	}
+
+QList<CpSettingFormItemData*> CpCertPluginLoader::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const
+		{
+		RDEBUG("0", 0);
+  return QList<CpSettingFormItemData*>() 
+           << new CpSettingFormEntryItemDataImpl<CpSecurityView>(itemDataHelper,tr("Advanced Security"), QString());			
+		}
+
+Q_EXPORT_PLUGIN2(cpcertpluginloader, CpCertPluginLoader);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/cpadvancedsecplugin/src/cpcerttrustview.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,379 @@
+/*
+* 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 class CCertManUIContainerTrust.
+*                Maintains correct list of trusted clients depending
+*                on the certificate that was in focus in Authority
+*                certificates view when Trust Settings view was entered.
+*                Shows and changes correct Yes/No text for the Trusted client.
+*
+*/
+
+// INCLUDE FILES
+#include <certificateapps.h>
+#include <mctcertapps.h>
+#include <mctcertstore.h>
+
+#include <QGraphicsLinearLayout>
+#include <QString>
+#include <QList>
+
+#include <hbdataform.h>
+#include <hbdataformmodel.h>
+#include <hbdataformmodelitem.h>
+#include <hblistwidgetitem.h>
+#include <hblistwidget.h>
+
+#include <memory>
+#include <../../inc/cpsecplugins.h>
+#include "cpcerttrustview.h"
+#include "cpcertdatacontainer.h"
+#include "cpcertmanuisyncwrapper.h"
+#include "cpuitrustids.h"
+
+const TInt KMidpCertStoreUid = 0x101F5B71;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// ================= MEMBER FUNCTIONS =======================
+
+CpCertTrustView::CpCertTrustView( TInt certificateIndex, CpCertDataContainer& certDataContainer, QGraphicsItem *parent /*= 0*/)
+		: CpBaseSettingView(0,parent), mCertDataContainer(certDataContainer), mCertificateIndex(certificateIndex)
+		{
+		setTitle(tr("Trust Settings"));
+		viewTrustSettings();	 
+		}
+
+// ---------------------------------------------------------
+// CpCertTrustView::~CpCertTrustView()
+// Destructor
+// ---------------------------------------------------------
+//
+CpCertTrustView::~CpCertTrustView()
+    {
+    delete mAppInfoManager;
+    mClientUids.Close();
+    delete mFormModel;	
+    mTrustedClients.erase(mTrustedClients.begin(), mTrustedClients.end());
+    mTrustValues.erase(mTrustValues.begin(), mTrustValues.end());
+    }
+
+
+void CpCertTrustView::viewTrustSettings()
+	{
+	RDEBUG("0", 0);
+	mTrustedClients << " \tWAP connection\t\t";
+	mTrustedClients << " \tMail and Image conn.\t\t";
+	mTrustedClients << " \tNative installing\t\t";
+	mTrustedClients << " \tJava installing\t\t";
+	mTrustedClients << " \tOCSP validation\t\t";
+	mTrustedClients << " \tVPN\t\t";
+	mTrustedClients << " \tWidget Installation\t\t";
+	
+	mTrustValues << "On";
+	mTrustValues << "Off";
+		
+	try
+		{
+		QT_TRAP_THROWING( mAppInfoManager =
+			CCertificateAppInfoManager::NewL( mCertDataContainer.iRfs, EFalse );
+			updateListBoxL();)
+		}
+	catch(std::exception& exception)
+		{
+		QString error(exception.what());
+		QT_TRAP_THROWING(	mCertDataContainer.ShowErrorNoteL( error.toInt()) );
+		throw(exception);
+		}
+	}
+
+
+// ---------------------------------------------------------------------------
+// CpCertTrustView::UpdateListBoxL()
+// Puts correct Trust Settings text to listbox and correct value (yes/no)
+// to the setting, asks the value from CheckCertificateClientTrust
+// For X509 certificates, only one Application is currently supported
+// (Application controller), more applications maybe added later however,
+// so one additional application has been left in comments as an example.
+// WAP connection and Application installer have their names from resources
+// and thus localized,  other additional application get their names from
+// TCertificateAppInfo's Name() function.
+// ---------------------------------------------------------------------------
+//
+
+void CpCertTrustView::updateListBoxL()
+    {
+    RDEBUG("0", 0);
+    mClientUids.Reset();
+
+    TInt clientCount = 0;
+
+    // Use certificate index from previous view
+    CCTCertInfo* entry = mCertDataContainer.iCALabelEntries[ mCertificateIndex ]->iCAEntry;
+
+    // Here MCTCertApps should be used to get client options, but it is not properly
+    // supported in any cert store. It should be possible to get the MCTCertApps
+    // through token's GetInterface function.
+    if ( entry->Token().TokenType().Type() == TUid::Uid( KTokenTypeFileCertstore ) )
+        {
+        if ( !mAppInfoManager )
+            {
+            User::Leave( KErrArgument );
+            }
+        RArray<TCertificateAppInfo> apps;
+        apps = mAppInfoManager->Applications();
+        for ( TInt i = 0; i < apps.Count(); i++ )
+            {
+            if ( apps[i].Id() != KCertManUIViewTrustJavaInstallingId &&
+            		apps[i].Id() != KCertManUIViewTrustApplicationControllerId )
+                {
+                mClientUids.Append( apps[i].Id() );
+                }
+            }
+        }
+    else
+        {
+		mCertDataContainer.iWrapper->GetApplicationsL(
+				mCertDataContainer.CertManager(), *entry, mClientUids );
+        }
+
+    // This is needed because MIDPCertStore does not support MCTCertApps
+    if ( mClientUids.Count() == 0 &&
+        entry->Token().TokenType().Type() == TUid::Uid( KMidpCertStoreUid ) )
+        {
+        mClientUids.Append( KCertManUIViewTrustJavaInstallingId );
+        }
+    
+    if ( EX509Certificate != entry->CertificateFormat() )
+        {
+		return;
+        }
+	TInt resIndex = KErrNotFound;
+	QList <int> itemArray;
+	QList <int> trustValue;
+	clientCount = mClientUids.Count();
+	if ( clientCount > 0 )
+		{
+		for ( TInt k = 0; k < clientCount; k++ )
+			{
+			resIndex = trustIdIndex( mClientUids[k] );
+			if ( resIndex == KErrNotFound )
+				{
+				continue;
+				}
+			
+			// based on the trust list update the array
+			TBool trustState = EFalse;
+			QString item = mTrustedClients[ resIndex ];
+			trustState = checkCertificateClientTrustL( mClientUids[k], *entry );
+			// insert the index which would be used to retrieve the value from mTrustedClients
+			itemArray.insert(k,resIndex);
+			
+			if ( trustState )
+				{
+				trustValue.insert(k,1);
+				}
+			else
+				{
+				trustValue.insert(k,0);
+				}
+			}
+		}
+    // display the list
+    QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical);
+    setLayout(layout);
+    std::auto_ptr<HbDataForm> form(new HbDataForm());
+	mFormModel = new HbDataFormModel();
+	
+	HbListWidget* mCertLabelList = new HbListWidget(this); 
+	std::auto_ptr<HbListWidgetItem> certLabel(q_check_ptr(new HbListWidgetItem()));
+	const TDesC& label = entry->Label();
+	certLabel->setText(QString( (QChar*)label.Ptr(),label.Length() ) );
+	mCertLabelList->addItem(certLabel.get());
+	certLabel.release();
+	
+	RDEBUG("0", 0);
+	
+	int count = itemArray.size();
+	for( int index = 0 ;index < count; ++index)
+		{
+		std::auto_ptr<HbDataFormModelItem> item (q_check_ptr(new HbDataFormModelItem( 
+										HbDataFormModelItem::ToggleValueItem,
+										mTrustedClients[itemArray[index]] ) ));
+		
+		if( trustValue[index] == 1)
+			{
+			item->setContentWidgetData("text",mTrustValues[0]);
+			item->setContentWidgetData("additionalText",mTrustValues[1]);
+			}
+		else
+			{
+			item->setContentWidgetData("text",mTrustValues[1]);
+			item->setContentWidgetData("additionalText",mTrustValues[0]);
+			}
+		mFormModel->appendDataFormItem(item.get());
+		item.release();
+		}
+	
+	form->setModel(mFormModel);
+	layout->addItem(mCertLabelList);
+	layout->addItem(form.get());
+	form.release();
+    }
+
+
+void CpCertTrustView::saveTrustSettings()
+	{
+	RDEBUG("0", 0);
+	CCTCertInfo& entry = *( mCertDataContainer.iCALabelEntries[ mCertificateIndex ]->iCAEntry );
+	if ( entry.IsDeletable() )
+		{
+		TInt itemCount = mFormModel->rowCount();
+		RArray<TUid> newUids;
+		QT_TRAP_THROWING
+			(	
+			CleanupClosePushL( newUids );
+			
+			for(int index = 0;index<itemCount;++index)
+				{
+				HbDataFormModelItem *item = mFormModel->item(index);
+				QString trustValue = item->contentWidgetData("text").toString();
+				if(trustValue == "On")
+					{
+					newUids.Append(trusterId(mTrustedClients[index]));
+					}
+				}
+			if(newUids.Count() > 0 )
+				{
+				mCertDataContainer.iWrapper->SetApplicabilityL( mCertDataContainer.CertManager(), entry, newUids );
+				}
+			CleanupStack::PopAndDestroy(&newUids);
+			)
+		}
+	}
+
+TUid CpCertTrustView::trusterId(const QString& clientDescription) const
+	{
+	RDEBUG("0", 0);
+	TUid retValue = TUid::Uid(0);
+	if( clientDescription ==  " \tWAP connection\t\t" )
+		retValue = KCertManUIViewTrustWapConnectionId;
+	else if( clientDescription ==  " \tMail and Image conn.\t\t" )
+		retValue = KCertManUIViewTrustMailAndImageConnId;
+	else if( clientDescription ==  " \tNative installing\t\t" )
+		retValue = KCertManUIViewTrustApplicationControllerId;
+	else if( clientDescription ==  " \tJava installing\t\t" )
+		retValue = KCertManUIViewTrustJavaInstallingId;
+	else if( clientDescription ==  " \tOCSP validation\t\t" )
+		retValue = KCertManUIViewOCSPCheckInstallingId;
+	else if( clientDescription ==  " \tVPN\t\t" )
+		retValue = KCertManUIViewTrustVPNId;
+	else if( clientDescription ==  " \tWidget Installation\t\t" )
+		retValue = KCertManUIViewTrustWidgetInstallId;
+	return retValue;
+	}
+
+// ---------------------------------------------------------------------------
+// CpCertTrustView::trustIdIndex( TUid trustUid )
+// ---------------------------------------------------------------------------
+//
+TInt CpCertTrustView::trustIdIndex( TUid trustUid ) const
+    {
+    RDEBUG("0", 0);
+    TInt resIndex = KErrNotFound;
+    
+    if ( trustUid == KCertManUIViewTrustApplicationControllerId )
+        {
+        resIndex = KTrustSettingsResourceIndexAppCtrl;
+        }
+    else if( trustUid == KCertManUIViewTrustWapConnectionId )
+    	{
+		resIndex = KTrustSettingsResourceIndexWAP;
+    	}
+    else if ( trustUid == KCertManUIViewTrustMailAndImageConnId )
+        {
+        resIndex = KTrustSettingsResourceIndexMailAndImageConn;
+        }
+    else if ( trustUid == KCertManUIViewTrustJavaInstallingId )
+        {
+        resIndex = KTrustSettingsResourceIndexJavaInstall;
+        }
+    else if ( trustUid == KCertManUIViewOCSPCheckInstallingId )
+        {
+        resIndex = KTrustSettingsResourceIndexOCSPCheck;
+        }
+    else if ( trustUid == KCertManUIViewTrustVPNId )
+        {
+        resIndex = KTrustSettingsResourceIndexVPN;
+        }
+    else if ( trustUid == KCertManUIViewTrustWidgetInstallId )
+		{
+		resIndex = KTrustSettingsResourceIndexWidget;
+		}
+    return resIndex;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CpCertTrustView::CheckCertificateClientTrustL(const TUid aClientTUid,
+// CCTCertInfo& aEntry) const
+// Checks if a certificate trusts a client
+// * Certificate format == ECrX509Certificate ECrX968Certificate ECrCertificateURL
+// are not supported if certificate location == ECrCertLocationWIMCard
+// * Certificate format == ECrX968Certificate ECrCertificateURL are not supported
+// if certificate location == ECrCertLocationCertMan
+// * Certificate location == ECrCertLocationWIMURL ECrCertLocationPhoneMemory
+// ECrCertLocationPhoneMemoryURL are not supported
+// ---------------------------------------------------------------------------
+//
+TBool CpCertTrustView::checkCertificateClientTrustL(
+    const TUid clientUid, const CCTCertInfo& entry ) const
+    {
+    RDEBUG("0", 0);
+    TBool trustSettingTrusted = EFalse;
+    TCertificateFormat format = entry.CertificateFormat();
+
+    if ( format == EX509Certificate )
+        {
+
+        RArray<TUid> trusterUids;
+        CleanupClosePushL( trusterUids );
+
+        //Owned by mCertDataContainer.
+        CUnifiedCertStore*& store = mCertDataContainer.CertManager();
+        // Get trusting applications' Uids for the one selected
+        // certificate entry
+        mCertDataContainer.iWrapper->GetApplicationsL( store, entry, trusterUids );
+
+        // get the number of trusting applications for one
+        // selected certificate entry
+        TInt trusterCount = trusterUids.Count();
+        // in this loop, for every trusting application in one
+        // selected certificate entry
+        for ( TInt i = 0; i < trusterCount; ++i )
+            {
+            // put the trusting application's Uid to TUid truster
+            if ( clientUid == trusterUids[i] )
+                {
+                trustSettingTrusted = ETrue;
+                break;
+                }
+            }
+        CleanupStack::PopAndDestroy(&trusterUids);  
+        }
+    
+    return trustSettingTrusted;
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/cpadvancedsecplugin/src/cpcertview.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,922 @@
+/*
+* 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 <QStringList>
+#include <QGraphicsLinearLayout>
+#include <QModelIndex>
+
+#include <hblineedit.h>
+#include <hbdataform.h>
+#include <hbdataformmodel.h>
+#include <hbdataformmodelitem.h>
+#include <hblabel.h>
+#include <hbpushbutton.h>
+#include <hbmenu.h>
+#include <hbaction.h>
+#include <HbListWidget>
+#include <HbListWidgetItem>
+#include <HbGroupBox>
+#include <hbpushbutton.h>
+#include <hbdataform.h>
+#include <hbdataformmodel.h>
+#include <hbdataformmodelitem.h>
+#include <hbabstractviewitem.h>
+#include <hbtextitem.h>
+#include <hbmainwindow.h>
+#include <hblistview.h>
+#include <QStandardItemModel>
+#include <QModelIndexList>
+#include <hbmessagebox.h>
+#include <memory>
+#include <../../inc/cpsecplugins.h>
+#include "cpcertdetailview.h"
+#include "cpcertview.h"
+#include "cpcertdatacontainer.h"
+#include "cpcerttrustview.h"
+#include "cpcertmanuisyncwrapper.h"
+
+
+CpCertView::CpCertView(const QModelIndex& modelIndex, QGraphicsItem *parent /*= 0*/)
+	: CpBaseSettingView(0,parent),
+	  mPopup(NULL),
+	  mPrevView(NULL),
+	  mCurrentView(NULL),
+	  mRefreshedView(NULL),
+	  mListView(NULL),
+	  mSelectAllView(NULL),
+	  mOriginalView(NULL),
+	  mNote(NULL)
+	{
+	RDEBUG("0", 0);
+	mOriginalView = mainWindow()->currentView();
+	
+	HbMenu* menu = this->menu();   
+	std::auto_ptr<HbAction> deleteAction(new HbAction(hbTrId("txt_common_menu_delete")));
+	connect(deleteAction.get(), SIGNAL(triggered()), this, SLOT(deleteList()));    
+	menu->addAction(deleteAction.get());
+	deleteAction.release();
+	
+	std::auto_ptr<QGraphicsLinearLayout> layout(new QGraphicsLinearLayout(Qt::Vertical));
+	
+	HbDataForm *form = q_check_ptr(new HbDataForm(this));
+	std::auto_ptr<HbDataFormModel> formModel(q_check_ptr(new HbDataFormModel()));
+	form->setModel(formModel.get());
+	formModel.release();
+	
+	HbListWidget* certificateList = q_check_ptr(new HbListWidget(this)); 
+		
+	CpCertView::TCertificateViews currentView = (CpCertView::TCertificateViews)modelIndex.row(); 
+	QString title;
+	if(currentView == EPersonalView)
+		{
+		title = "Move to Device";
+		}
+	else if(currentView == EDeviceView)
+		{
+		title = "Move to Personal";  
+		}
+	RDEBUG("0", 0);
+	if(currentView == EPersonalView || currentView == EDeviceView)
+		{
+		std::auto_ptr<HbAction> moveToDeviceAction(q_check_ptr(new HbAction(title)));   
+		connect(moveToDeviceAction.get(), SIGNAL(triggered()), this, SLOT(moveCert()));    
+		menu->addAction(moveToDeviceAction.get());
+		moveToDeviceAction.release();
+		}	
+	
+	setDetails(currentView);
+	TInt count = 0;
+	try
+		{
+		QT_TRAP_THROWING(mCertDataContainer = CpCertDataContainer::NewL());
+		QT_TRAP_THROWING(count = refreshListL());
+		}
+	catch(const std::exception& exception)
+		{
+		HbMessageBox::information(exception.what());
+		throw(exception);
+		}
+	RDEBUG("0", 0);
+	for(int index = 0; index< count; index++)
+		{
+		QString certificateLabel = certLabel(index);
+		std::auto_ptr<HbListWidgetItem> singleCert(q_check_ptr(new HbListWidgetItem()));
+		singleCert->setText(certificateLabel);
+		certificateList->addItem(singleCert.get());
+		singleCert.release();
+		}  // End of FOR loop
+	
+	connect(certificateList, SIGNAL(activated(QModelIndex)), this, SLOT(openCertFromList(QModelIndex)));   
+	connect(certificateList, SIGNAL(longPressed(HbAbstractViewItem*, QPointF )), this, SLOT(indicateLongPress(HbAbstractViewItem*, QPointF))); 
+	
+	layout->addItem(certificateList);
+	setLayout(layout.get());
+	layout.release();
+	
+	mPopup = q_check_ptr(new HbDialog());
+	mContextMenu = q_check_ptr(new HbMenu());
+	
+	RDEBUG("0", 0);
+	}
+
+CpCertView::~CpCertView()
+	{
+	delete mCertDataContainer;
+	mCertDataContainer = NULL;
+	RDEBUG("0", 0);
+	if(mPrevView)
+		{
+		mPrevView->deleteLater();
+		mPrevView= NULL;
+		}
+	if(mCurrentView)
+		{
+		mCurrentView->deleteLater();
+		mCurrentView= NULL;
+		}
+	if(mRefreshedView)
+		{
+		mRefreshedView->deleteLater();
+		mRefreshedView= NULL;
+		}
+	if(mListView)
+		{
+		mListView->deleteLater();
+		mListView= NULL;
+		}
+		
+	if(mSelectAllView)
+	{
+	mSelectAllView->deleteLater();
+	mSelectAllView = NULL;
+	}
+	
+	mSelectionIndex.Close();
+	
+	mIndexList.Close();
+	
+	delete mPopup;
+	
+	delete mNote;
+	mNote = NULL;
+	
+	delete mContextMenu;
+	
+	}
+	
+void CpCertView::setDetails(CpCertView::TCertificateViews currentView)
+	{
+	RDEBUG("0", 0);
+	switch(currentView)
+		{
+		case EAuthorityView:
+		setTitle(hbTrId("txt_certificate_manager_list_authority_certificate"));
+		mCertView = EAuthorityView;
+		break;
+		
+		case ETrustedView:
+		setTitle(hbTrId("txt_certificate_manager_list_trusted_site_certific"));
+		mCertView = ETrustedView;
+		break;
+		
+		case EPersonalView:
+		setTitle(hbTrId("txt_certificate_manager_list_personal_certificates"));
+		mCertView = EPersonalView;
+		break;
+		
+		case EDeviceView:
+		setTitle(hbTrId("txt_certificate_manager_list_device_certificates"));
+		mCertView = EDeviceView;
+		break;
+		}
+	}
+
+void CpCertView::indicateLongPress(HbAbstractViewItem *item,QPointF coords)
+	{
+	RDEBUG("0", 0);
+	mPos = item->modelIndex().row();   // Pos will tell you what is the certificate clicked in particular view.
+	
+	mContextMenu->clearActions();
+	std::auto_ptr<HbAction> open(q_check_ptr(new HbAction(hbTrId("txt_common_menu_open"))));
+	connect(open.get(), SIGNAL(triggered()), this, SLOT( openCertificate()));
+	mContextMenu->addAction(open.get());			
+	open.release();
+	
+	QString moveTitle;
+	
+	if(mCertView == EAuthorityView)
+		{
+		std::auto_ptr<HbAction> trustSettings(q_check_ptr(new HbAction(hbTrId("txt_certificate_manager_menu_trust_settings")))); 
+		connect(trustSettings.get(), SIGNAL(triggered()), this, SLOT(showTrustSettings()));    
+		mContextMenu->addAction(trustSettings.get());
+		trustSettings.release();
+		}
+	else if(mCertView == EPersonalView)
+		{
+		moveTitle = hbTrId("txt_certificate_manager_menu_move_to_device_certif");
+		}
+	else if(mCertView == EDeviceView)
+		{
+		moveTitle = hbTrId("txt_certificate_manager_menu_move_to_personal_cert");
+		}	
+	
+	if(mCertView == EPersonalView || mCertView == EDeviceView )
+		{
+		std::auto_ptr<HbAction> moveCert(q_check_ptr(new HbAction(moveTitle)));     
+		connect(moveCert.get(), SIGNAL(triggered()), this, SLOT(moveSelectedCert()));    
+		mContextMenu->addAction(moveCert.get());
+		moveCert.release();
+		}
+	
+	RDEBUG("0", 0);
+	if( certAt(mPos)->IsDeletable() )
+		{
+		std::auto_ptr<HbAction> menuDelete(q_check_ptr(new HbAction(hbTrId("txt_common_menu_delete")))); 
+		connect(menuDelete.get(), SIGNAL(triggered()), this, SLOT(deleteCertificate()));    
+		mContextMenu->addAction(menuDelete.get());
+		menuDelete.release();
+		}
+	mContextMenu->setPreferredPos(coords);
+	mContextMenu->open();
+	}
+
+void CpCertView::openCertFromList(const QModelIndex& modelIndex)
+	{	
+	RDEBUG("0", 0);
+	// Pos will tell you what is the certificate clicked in particular view.
+	mPos = modelIndex.row();   
+	openCertificate();
+	}
+
+void CpCertView::openCertificate()
+	{
+	RDEBUG("0", 0);
+	mCurrentView = q_check_ptr(new CpCertDetailView(mCertView,mPos,*mCertDataContainer));    
+	connect(mCurrentView, SIGNAL(aboutToClose()), this, SLOT(displayPreviousView()));
+	mPrevView = mainWindow()->currentView();   
+	mainWindow()->addView(mCurrentView);
+	mainWindow()->setCurrentView(mCurrentView);  		
+	}
+	
+void CpCertView::displayPreviousView()  
+	{
+	RDEBUG("0", 0);
+	mainWindow()->removeView(mCurrentView);    
+	mCurrentView->deleteLater();
+	mCurrentView= NULL;
+	mainWindow()->setCurrentView(mPrevView);  	
+	}
+	
+void CpCertView::deleteCertificate()
+	{
+	RDEBUG("0", 0);
+	RArray<TInt> pos;
+	pos.Append(mPos);
+	QT_TRAP_THROWING(deleteCertsL(pos));
+	}		
+	
+void CpCertView::deleteList()
+	{
+	RDEBUG("0", 0);
+	mSelectAll = EFalse;
+	mPopup->setDismissPolicy(HbDialog::NoDismiss);
+	// Set the label as heading widget
+	mPopup->setHeadingWidget(q_check_ptr(new HbLabel(hbTrId("txt_certificate_manager_setlabel_certificates"))));
+	
+	std::auto_ptr<QGraphicsLinearLayout> layout(q_check_ptr(new QGraphicsLinearLayout(Qt::Vertical)));
+		
+	mSelectAllView = q_check_ptr(new HbListView(this));
+	QStandardItemModel* selectAllModel = q_check_ptr(new QStandardItemModel(this));
+	// Populate the model with content
+	std::auto_ptr<QStandardItem> selectAllItem(q_check_ptr(new QStandardItem()));
+	selectAllItem->setData(QString("Select All"),Qt::DisplayRole);
+	selectAllModel->appendRow(selectAllItem.get());
+	selectAllItem.release();
+	
+	connect(mSelectAllView, SIGNAL(activated(QModelIndex)), this, SLOT(selectAll()));
+	mSelectAllView->setModel(selectAllModel);
+	mSelectAllView->setSelectionMode(HbListView::MultiSelection);
+	layout->addItem(mSelectAllView);
+	
+	mListView = q_check_ptr(new HbListView(this));
+	// Connect to "activated" signal
+	connect(mListView, SIGNAL(activated(QModelIndex)), this, SLOT(itemActivated(QModelIndex)));
+	
+	// Create a model
+	QStandardItemModel* model = q_check_ptr(new QStandardItemModel(this));
+	TInt count=0;
+	QT_TRAP_THROWING( count = refreshListL());
+	RDEBUG("0", 0);
+	for(TInt index = 0; index < count ; ++index)
+		{
+		const CCTCertInfo* cert = certAt(index);
+		if( cert->IsDeletable() )
+			{
+			// Populate the model with content
+			std::auto_ptr<QStandardItem> certItem(q_check_ptr(new QStandardItem()));
+			QString certificateLabel = certLabel(index);
+			certItem->setData( certificateLabel, Qt::DisplayRole);
+			model->appendRow(certItem.get());
+			mSelectionIndex.Append(index);
+			certItem.release();
+			}
+		}	
+	// Set the model to the list view
+	mListView->setModel(model);
+	mListView->setSelectionMode(HbListView::MultiSelection);
+	layout->addItem(mListView);
+	
+	std::auto_ptr<HbWidget> widget( q_check_ptr(new HbWidget()));
+	widget->setLayout(layout.get());
+	layout.release();
+	mPopup->setContentWidget(widget.get());
+	widget.release();
+	
+	mPopup->setPrimaryAction(q_check_ptr(new HbAction(hbTrId("txt_common_opt_delete"))));
+	mPopup->setSecondaryAction(q_check_ptr(new HbAction(hbTrId("txt_common_button_cancel"))));
+	mPopup->setTimeout(HbPopup::NoTimeout);
+	RDEBUG("0", 0);
+	// Launch popup syncronously
+	mPopup->open(this, SLOT(handleMultipleDelete(HbAction*)));
+
+}
+
+void CpCertView::handleMultipleDelete(HbAction* action)
+{
+	RDEBUG("0", 0);
+	if(action == mPopup->primaryAction())
+		{
+		QItemSelectionModel *selectionModel = mListView->selectionModel();
+		QModelIndexList mWidgetItemsToRemove = selectionModel->selectedIndexes();
+		TInt deleteCount = mWidgetItemsToRemove.count();
+		// start deleting from end of array so that the indexes do not changes of the ones
+		// at the front.
+		RArray<TInt> actualIndex;
+		QT_TRAP_THROWING
+			(
+			CleanupClosePushL(actualIndex);
+			for (TInt index = deleteCount-1; index>= 0 ; --index) 
+				{
+				TInt selectedItemIndex = mWidgetItemsToRemove[index].row();
+				actualIndex.Append( mSelectionIndex[selectedItemIndex] );
+				}
+			deleteCertsL(actualIndex);
+			CleanupStack::PopAndDestroy(&actualIndex);
+			) // QT_TRAP_THROWING
+		}
+	RDEBUG("0", 0);
+	mListView->deleteLater();
+	mListView = NULL;
+	mSelectAllView->deleteLater();
+	mSelectAllView = NULL; 
+	}
+
+void CpCertView::moveCert()
+	{
+	RDEBUG("0", 0);
+	mSelectAll = EFalse;
+	mPopup->setDismissPolicy(HbDialog::NoDismiss);
+	// Set the label as heading widget
+	if(mCertView == EPersonalView)
+		{
+		mPopup->setHeadingWidget(q_check_ptr(new HbLabel(tr("Move To Device"))));
+		}
+	else if(mCertView == EDeviceView)
+		{
+		mPopup->setHeadingWidget(q_check_ptr(new HbLabel(tr("Move To Personal"))));
+		}
+		
+	std::auto_ptr<QGraphicsLinearLayout> layout(q_check_ptr(new QGraphicsLinearLayout(Qt::Vertical)));
+			
+	mSelectAllView = q_check_ptr(new HbListView(this));
+	QStandardItemModel* selectAllModel = q_check_ptr(new QStandardItemModel(this));
+	// Populate the model with content
+	std::auto_ptr<QStandardItem> selectAllItem(q_check_ptr(new QStandardItem()));
+	selectAllItem->setData(QString("Select All"),Qt::DisplayRole);
+	selectAllModel->appendRow(selectAllItem.get());
+	selectAllItem.release();
+	connect(mSelectAllView, SIGNAL(activated(QModelIndex)), this, SLOT(selectAll()));
+	mSelectAllView->setModel(selectAllModel);
+	mSelectAllView->setSelectionMode(HbListView::MultiSelection);
+	layout->addItem(mSelectAllView);
+	
+	mListView = q_check_ptr(new HbListView(this));
+	// Connect to "activated" signal
+	connect(mListView, SIGNAL(activated(QModelIndex)), this, SLOT(itemActivated(QModelIndex)));
+	
+	// Create a model
+	QStandardItemModel* model = q_check_ptr(new QStandardItemModel(this));
+	TInt count =0;
+	RDEBUG("0", 0);
+	QT_TRAP_THROWING(count = refreshListL());
+	for(TInt index = 0; index < count ; ++index)
+		{
+		// Populate the model with content
+		std::auto_ptr<QStandardItem> certItem(q_check_ptr(new QStandardItem()));
+		QString certificateLabel = certLabel(index);
+		certItem->setData( certificateLabel, Qt::DisplayRole);
+		model->appendRow(certItem.get());
+		mSelectionIndex.Append(index);
+		certItem.release();
+		}	
+	
+	// Set the model to the list view
+	mListView->setModel(model);
+	mListView->setSelectionMode(HbListView::MultiSelection);
+	layout->addItem(mListView);
+	
+	std::auto_ptr<HbWidget> widget(q_check_ptr(new HbWidget()));
+	widget->setLayout(layout.get());	
+	layout.release();
+	mPopup->setContentWidget(widget.get());
+	widget.release();
+	RDEBUG("0", 0);
+	mPopup->setPrimaryAction(q_check_ptr(new HbAction(tr("Yes"))));
+	mPopup->setSecondaryAction(q_check_ptr(new HbAction(tr("No"))));
+	mPopup->setTimeout(HbPopup::NoTimeout);
+	
+	// Launch popup syncronously
+	 mPopup->open(this, SLOT(handleMoveCertDialog(HbAction*)));
+	 RDEBUG("0", 0);
+}
+
+void CpCertView::handleMoveCertDialog(HbAction* action)
+{	
+	RDEBUG("0", 0);
+	if(action == mPopup->primaryAction())
+		{
+		QItemSelectionModel *selectionModel = mListView->selectionModel();
+		QModelIndexList mWidgetItemsToRemove = selectionModel->selectedIndexes();
+		TInt deleteCount = mWidgetItemsToRemove.count();
+		// start deleting from end of array so that the indexes do not changes of the ones
+		// at the front.
+		RArray<TInt> actualIndex;
+		RDEBUG("0", 0);
+		QT_TRAP_THROWING
+			(
+			CleanupClosePushL(actualIndex);
+			 for (TInt index = deleteCount-1; index>= 0 ; --index) 
+				 {
+				 TInt selectedItemIndex = mWidgetItemsToRemove[index].row();
+				 actualIndex.Append(mSelectionIndex[selectedItemIndex]);	 
+				 }
+			 moveCertList(actualIndex);
+			 CleanupStack::PopAndDestroy(&actualIndex);
+			 )
+		}
+	mListView->deleteLater();
+	mListView = NULL;	
+	mSelectAllView->deleteLater();
+	mSelectAllView = NULL;
+	RDEBUG("0", 0);
+	}
+
+void CpCertView::selectAll()
+	{
+	RDEBUG("0", 0);
+	if(mSelectAll == EFalse)
+		{
+		mListView->selectAll();
+		mSelectAll= ETrue;
+		}
+	else
+		{
+		mListView->clearSelection();
+		mSelectAll= EFalse;
+		}
+	}
+
+void CpCertView::deleteCertsL( RArray<TInt>& indexList )
+    {
+    RDEBUG("0", 0);
+    TInt count = indexList.Count();
+    for(int index = 0;index <count;++index )
+    	{
+		mIndexList.Append(indexList[index]);
+    	}
+    
+  	mNote = new HbMessageBox(HbMessageBox::MessageTypeQuestion);
+	QString deleteMsg;
+	QString sCount;
+	if(count == 1)
+		{
+		deleteMsg = "Delete %1?";
+		const CCTCertInfo* entry = certAt(indexList[0]);
+		sCount = QString((QChar*)entry->Label().Ptr(),entry->Label().Length());
+		}
+	else
+		{
+		deleteMsg = "Delete %1 items?";
+		sCount.setNum(count);
+		}
+	RDEBUG("0", 0);
+	deleteMsg = deleteMsg.arg(sCount);
+	mNote->setText(deleteMsg);
+	mNote->setTimeout(HbPopup::NoTimeout);
+	mNote->open(this,SLOT(handleDeleteDialog(HbAction*)));
+
+}
+
+void CpCertView::handleDeleteDialog(HbAction* action)
+{
+	RDEBUG("0", 0);
+	TInt count = mIndexList.Count();
+	
+	if (action != mNote->primaryAction() || count == 0 )
+		{
+		return;
+		}
+		
+    RPointerArray<CCTCertInfo> errCerts;
+    QT_TRAP_THROWING(
+    		CleanupClosePushL(errCerts);
+    
+		for(TInt index = 0; index < count; ++index)
+			{
+			const CCTCertInfo* entry = certAt(mIndexList[index]);
+			
+			if( mCertView == EPersonalView || mCertView == EAuthorityView )
+				{
+				mCertDataContainer->iWrapper->DeleteCertL( 
+							mCertDataContainer->CertManager(), *entry );
+				}
+			else if( mCertView == ETrustedView )
+				{
+				mCertDataContainer->iWrapper->DeleteCertL( 
+							mCertDataContainer->CertManager(),*entry, KCMTrustedServerTokenUid );
+				}
+			else if( mCertView == EDeviceView )
+				{
+				mCertDataContainer->iWrapper->DeleteCertL(
+							mCertDataContainer->CertManager(), *entry, KCMDeviceCertStoreTokenUid );
+				}	
+			errCerts.AppendL(entry);
+			}
+		RDEBUG("0", 0);
+		if(errCerts.Count() > 0)
+			{
+			QString message("Unable to delete the following certificate: \n");
+			TInt count = errCerts.Count();
+			for(TInt index=0;index<count;++index)
+				{
+				const TDesC& certLabel = errCerts[index]->Label();
+				QString certName = QString((QChar*)certLabel.Ptr(),certLabel.Length());
+				message.append(certName).append("\n");
+				}
+			HbMessageBox::warning(message);
+			}
+		count = refreshListL();
+		refreshView(count);
+		
+		CleanupStack::PopAndDestroy(&errCerts);
+		) // QT_TRAP_THROWING
+    
+	delete mNote;
+	mNote = NULL;
+	RDEBUG("0", 0);
+    }
+
+const CCTCertInfo* CpCertView::certAt(TInt index) const
+	{
+	RDEBUG("0", 0);
+	CCTCertInfo* currentCert = NULL;
+	switch(mCertView)
+		{
+		case EAuthorityView:
+			{
+			currentCert = mCertDataContainer->iCALabelEntries[ index ]->iCAEntry;
+			break;
+			}
+		case ETrustedView:
+			{
+			currentCert = mCertDataContainer->iPeerLabelEntries[ index ]->iPeerEntry;
+			break;
+			}
+		case EDeviceView:
+			{
+			currentCert = mCertDataContainer->iDeviceLabelEntries[ index ]->iDeviceEntry;
+			break;
+			}
+		case EPersonalView:
+			{
+			currentCert = mCertDataContainer->iUserLabelEntries[ index ]->iUserEntry;
+			break;
+			}
+		};
+	return currentCert;
+	}
+
+QString CpCertView::certLabel(TInt index) const
+	{
+	RDEBUG("0", 0);
+	CpCertManUICertData* certData = NULL;
+	HBufC* label = NULL;
+	TInt length = 0;
+	switch(mCertView)
+		{
+		case EAuthorityView:
+			{
+			certData = mCertDataContainer->iCALabelEntries[index];
+			label = certData->iCAEntryLabel;
+			length = certData->iCAEntryLabel->Length();
+			break;
+			}
+		case ETrustedView:
+			{
+			certData = mCertDataContainer->iPeerLabelEntries[index];
+			label = certData->iPeerEntryLabel;
+			length = certData->iPeerEntryLabel->Length();
+			break;
+			}
+		case EPersonalView:
+			{
+			certData = mCertDataContainer->iUserLabelEntries[index];
+			label = certData->iUserEntryLabel;
+			length = certData->iUserEntryLabel->Length();
+			break;
+			}
+		case EDeviceView:
+			{
+			certData = mCertDataContainer->iDeviceLabelEntries[index];
+			label = certData->iDeviceEntryLabel;
+			length = certData->iDeviceEntryLabel->Length();
+			break;
+			}
+		}
+	return QString((QChar*)label->Des().Ptr(), length);
+	}
+
+TInt CpCertView::refreshListL()
+	{
+	RDEBUG("0", 0);
+	TInt count = 0;
+	switch(mCertView)
+		{
+		case EAuthorityView:
+			mCertDataContainer->RefreshCAEntriesL();
+			count = mCertDataContainer->iCALabelEntries.Count();
+			break;
+		case ETrustedView:
+			mCertDataContainer->RefreshPeerCertEntriesL();
+			count = mCertDataContainer->iPeerLabelEntries.Count();
+			break;
+		case EPersonalView:
+			mCertDataContainer->RefreshUserCertEntriesL();
+			count = mCertDataContainer->iUserLabelEntries.Count();
+			break;
+		case EDeviceView:
+			mCertDataContainer->RefreshDeviceCertEntriesL();
+			count = mCertDataContainer->iDeviceLabelEntries.Count();
+			break;
+		};
+	return count;
+	}
+
+
+void CpCertView::refreshView( TInt count )
+	{
+	RDEBUG("0", 0);
+	if(mRefreshedView)
+		{
+		mRefreshedView->deleteLater();
+		mRefreshedView = NULL;
+		}
+
+	mRefreshedView = q_check_ptr(new CpBaseSettingView());  
+	switch(mCertView)
+		{
+		case EAuthorityView:
+			{
+			mRefreshedView->setTitle(hbTrId("txt_certificate_manager_list_authority_certificate"));
+			break;
+			}
+		case ETrustedView:
+			{
+			mRefreshedView->setTitle(hbTrId("txt_certificate_manager_list_trusted_site_certific"));				
+			break;
+			}
+		case EPersonalView:
+			{
+			mRefreshedView->setTitle(hbTrId("txt_certificate_manager_list_personal_certificates"));				
+			break;
+			}
+		case EDeviceView:
+			{
+			mRefreshedView->setTitle(hbTrId("txt_certificate_manager_list_device_certificates"));				
+			break;
+			}
+		}	
+	
+	HbMenu* menu = mRefreshedView->menu();   
+	RDEBUG("0", 0);
+	std::auto_ptr<HbAction> endAction( q_check_ptr(new HbAction(hbTrId("txt_common_opt_delete"))) );
+	connect(endAction.get(), SIGNAL(triggered()), this, SLOT(deleteList()));    
+	menu->addAction(endAction.get());
+	endAction.release();
+	
+	QString title;
+	if(mCertView == EPersonalView)
+		{
+		title = "Move to Device";   
+		}
+	else if(mCertView == EDeviceView)
+		{
+		title = "Move to Personal";  
+		}
+	std::auto_ptr<HbAction> moveAction(q_check_ptr(new HbAction(title)));
+	connect(moveAction.get(), SIGNAL(triggered()), this, SLOT(moveCert()));    
+	menu->addAction(moveAction.get());
+	moveAction.release();
+	RDEBUG("0", 0);
+	std::auto_ptr<QGraphicsLinearLayout> layout(q_check_ptr(new QGraphicsLinearLayout(Qt::Vertical)));
+			
+	HbListWidget* mCertificateList = q_check_ptr(new HbListWidget(this)); 
+
+	for(int index = 0; index< count; index++)
+		{
+		QString certificateLabel = certLabel(index);
+		std::auto_ptr<HbListWidgetItem> singleCert(q_check_ptr(new HbListWidgetItem()));
+		singleCert->setText(certificateLabel);
+		mCertificateList->addItem(singleCert.get());
+		singleCert.release();
+		}  // end of for loop
+	
+	connect(mCertificateList, SIGNAL(activated(QModelIndex)), this, SLOT(openCertFromList(QModelIndex)));   
+	connect(mCertificateList, SIGNAL(longPressed(HbAbstractViewItem*, QPointF )), this, SLOT(indicateLongPress(HbAbstractViewItem*, QPointF))); 
+	
+	layout->addItem(mCertificateList);
+	RDEBUG("0", 0);
+	// Refresh current view
+	QObject::connect(mRefreshedView , SIGNAL(aboutToClose()), this, SLOT(viewDone()));
+	mPrevView = mainWindow()->currentView();   
+	mainWindow()->addView(mRefreshedView);
+	mainWindow()->setCurrentView(mRefreshedView); 
+	mRefreshedView->setLayout(layout.get());
+	layout.release();
+	RDEBUG("0", 0);
+	}
+
+
+void CpCertView::viewDone()  
+	{
+	RDEBUG("0", 0);
+	mCurrentView = mainWindow()->currentView();
+	mCurrentView->deleteLater();
+	mCurrentView= NULL;
+	mainWindow()->setCurrentView(mOriginalView);  	
+	}
+void CpCertView::showTrustSettings()
+	{
+	RDEBUG("0", 0);
+	mCurrentView = q_check_ptr(new CpCertTrustView(mPos, *mCertDataContainer));    
+	connect(mCurrentView , SIGNAL(aboutToClose()), this, SLOT(saveTrustSettings()));
+	mPrevView = mainWindow()->currentView();   
+	mainWindow()->addView(mCurrentView);
+	mainWindow()->setCurrentView(mCurrentView); 
+	}	
+
+void CpCertView::saveTrustSettings()
+	{
+	((CpCertTrustView*)mCurrentView)->saveTrustSettings();
+	displayPreviousView();
+	}
+
+void CpCertView::moveSelectedCert()
+	{
+	RDEBUG("0", 0);
+	RArray<TInt> pos;
+	pos.Append(mPos);
+	moveCertList(pos);
+	}
+
+void CpCertView::moveCertList(RArray<TInt>& indexList)
+	{
+	RDEBUG("0", 0);
+	mIndexList = indexList;
+	mNote = new HbMessageBox(HbMessageBox::MessageTypeQuestion);
+	mNote->setHeadingWidget(q_check_ptr(new HbLabel(hbTrId("txt_certificate_manager_info_move"))));
+	if( mCertView == EPersonalView )
+		{
+		mNote->setText(hbTrId("txt_certificate_manager_info_device_certificates_c"));
+		}
+	else if( mCertView == EDeviceView )
+		{
+		mNote->setText("Use of Personal certificates may require user confirmation. Proceed?");
+		}
+	
+	mNote->setTimeout(HbPopup::NoTimeout);
+	mNote->setIconVisible (EFalse);
+	mNote->open(this,SLOT(handleMoveDialog(HbAction*)));
+	RDEBUG("0", 0);
+}
+
+void CpCertView::handleMoveDialog(HbAction* action)
+{
+	RDEBUG("0", 0);
+	if (action != mNote->primaryAction())
+	    {
+		return;
+	    }
+	
+	TInt count = mIndexList.Count();
+	
+	for(TInt index = 0 ; index < count; ++index)
+		{
+		CCTCertInfo* entry = NULL;
+		if(mCertView == EPersonalView)
+			{
+			entry = mCertDataContainer->iUserLabelEntries[ mIndexList[index] ]->iUserEntry;
+			}
+		else if(mCertView == EDeviceView)
+			{
+			entry = mCertDataContainer->iDeviceLabelEntries[ mIndexList[index] ]->iDeviceEntry;
+			}
+			
+		// Move key first
+		TCTKeyAttributeFilter keyFilter;
+		keyFilter.iKeyId = entry->SubjectKeyId();
+		keyFilter.iPolicyFilter =  TCTKeyAttributeFilter::EAllKeys;
+		RDEBUG("0", 0);
+		TUid sourceCertStoreUid = TUid::Uid(0);
+		TUid targetCertStoreUid = TUid::Uid(0);
+		TUid sourceKeyStoreUid = TUid::Uid(0);
+		TUid targetKeyStoreUid = TUid::Uid(0);
+				
+		if(mCertView == EPersonalView)
+			{
+			sourceKeyStoreUid = KCMFileKeyStoreTokenUid;
+			targetKeyStoreUid = KCMDeviceKeyStoreTokenUid;
+			sourceCertStoreUid = KCMFileCertStoreTokenUid;
+			targetCertStoreUid = KCMDeviceCertStoreTokenUid;
+			}
+		else if(mCertView == EDeviceView)
+			{
+			sourceKeyStoreUid = KCMDeviceKeyStoreTokenUid;
+			targetKeyStoreUid = KCMFileKeyStoreTokenUid;
+			sourceCertStoreUid = KCMDeviceCertStoreTokenUid;
+			targetCertStoreUid = KCMFileCertStoreTokenUid;
+			}
+		RDEBUG("0", 0);
+		try
+			{
+			
+			QT_TRAP_THROWING( mCertDataContainer->iWrapper->MoveKeyL( 
+					mCertDataContainer->KeyManager(), keyFilter, sourceKeyStoreUid, targetKeyStoreUid ));
+			
+			// Move certificate
+			QT_TRAP_THROWING( mCertDataContainer->iWrapper->MoveCertL( 
+					mCertDataContainer->CertManager(), *entry, sourceCertStoreUid, targetCertStoreUid ) );
+
+			}
+		catch(const std::exception& exception)
+			{
+			QString error(exception.what());
+			QT_TRAP_THROWING(mCertDataContainer->ShowErrorNoteL( error.toInt() ));
+			User::Exit( KErrNone );
+			}
+		RDEBUG("0", 0);
+		try
+			{
+			if(mCertView == EPersonalView)
+				{
+				QT_TRAP_THROWING( mCertDataContainer->RefreshUserCertEntriesL() );
+				}
+			else if(mCertView == EDeviceView)
+				{
+				QT_TRAP_THROWING( mCertDataContainer->RefreshDeviceCertEntriesL() );
+				}
+			}
+		catch(const std::exception& exception)
+			{
+			QString error(exception.what());
+			if (  error.toInt() == KErrCorrupt )
+				{
+				QT_TRAP_THROWING(mCertDataContainer->ShowErrorNoteL( error.toInt()) );
+				User::Exit( KErrNone );
+				}
+			// have to call straight away the Exit
+			// showing any error notes would corrupt the display
+			User::Exit( error.toInt() );	
+			}
+		} // for
+	// Refresh current view
+	QT_TRAP_THROWING(refreshView(refreshListL()));	
+	delete mNote;
+	mNote = NULL;
+	RDEBUG("0", 0);
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/cpadvancedsecplugin/src/cpmoduleview.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,364 @@
+/*
+* 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 <mctauthobject.h>
+#include <mctkeystore.h>
+
+#include <qstringlist.h>
+#include <qgraphicslinearlayout.h>
+
+#include <hblineedit.h>
+#include <hbdataform.h>
+#include <hbdataformmodel.h>
+#include <hbdataformmodelitem.h>
+#include <hblabel.h>
+#include <hbpushbutton.h>
+#include <hbmenu.h>
+#include <hbaction.h>
+#include <hbmessagebox.h>
+#include <hblistwidget.h>
+#include <hblistwidgetitem.h>
+#include <hbgroupbox.h>
+#include <hbpushbutton.h>
+#include <hbdataform.h>
+#include <hbdataformmodel.h>
+#include <hbdataformmodelitem.h>
+#include <hbmainwindow.h>
+#include <hbabstractviewitem.h>
+
+#include <memory>
+#include <../../inc/cpsecplugins.h>
+#include "cpmoduleview.h"
+#include "cpsecmodmodel.h"
+#include "cpsecmodview.h"
+
+CpModuleView::CpModuleView( CpSecModView::TSecModViews currentView, 
+							CSecModUIModel& secModUIModel,
+							QGraphicsItem *parent /*= 0*/ )
+: CpBaseSettingView(0,parent),
+  mCurrentView(currentView),
+  mSecModUIModel(secModUIModel)
+	{
+	RDEBUG("0", 0);
+	QString title = mSecModUIModel.TokenLabelForTitle();
+	setTitle(title);
+	
+	mContextMenu = (q_check_ptr(new HbMenu()));
+	
+	if(currentView == CpSecModView::EAccessView)
+		{	
+		showAccessView();
+		}
+	else if(currentView == CpSecModView::ESignatureView)
+		{
+		showSignatureView(ETrue);
+		}
+	}
+
+CpModuleView::~CpModuleView()
+	{}
+
+void CpModuleView::showAccessView()
+	{
+	RDEBUG("0", 0);
+	HbMenu* menu = this->menu();   
+	std::auto_ptr<HbAction> endAction(q_check_ptr(new HbAction("Module Info")));     
+	connect(endAction.get(), SIGNAL(triggered()), this, SLOT(saveProv()));    
+
+	menu->addAction(endAction.get());
+	endAction.release();
+	
+	std::auto_ptr<QGraphicsLinearLayout> layout(q_check_ptr(new QGraphicsLinearLayout(Qt::Vertical)));
+	
+	std::auto_ptr<HbDataForm> form(q_check_ptr(new HbDataForm()));
+	std::auto_ptr<HbDataFormModel> formModel(q_check_ptr(new HbDataFormModel()));
+	form->setModel(formModel.get());
+	formModel.release();
+	
+	QString titleName;
+	if (mSecModUIModel.KeyStoreUID() == KTokenTypeFileKeystore)
+		{
+		titleName = "Phone key store code";
+		}
+	else
+		{
+		const TDesC& label = mSecModUIModel.AuthObj(KPinGSettIndex).Label();
+		titleName = QString((QChar*)label.Ptr(), label.Length());
+		}
+	RDEBUG("0", 0);
+	HbListWidget* accessDetails = q_check_ptr(new HbListWidget(this)); 
+	
+	std::auto_ptr<HbListWidgetItem> codeLabel(q_check_ptr(new HbListWidgetItem()));
+	codeLabel->setText(titleName);
+	accessDetails->addItem(codeLabel.get());
+	codeLabel.release();
+
+	std::auto_ptr<HbListWidgetItem> codeText(q_check_ptr(new HbListWidgetItem()));
+	codeText->setText("****");
+	accessDetails->addItem(codeText.get());
+	codeText.release();
+
+	std::auto_ptr<HbListWidgetItem> requestLabel(q_check_ptr(new HbListWidgetItem()));
+	requestLabel->setText("Access Code Request");
+	accessDetails->addItem(requestLabel.get());
+	requestLabel.release();
+
+	TUint32 status = mSecModUIModel.AuthStatus(KPinGSettIndex);
+	std::auto_ptr<HbListWidgetItem> requestText(q_check_ptr(new HbListWidgetItem()));
+	requestText->setText("Off");
+	if (status & EEnabled)
+		{
+		requestText->setText("On");
+		}	
+	accessDetails->addItem(requestText.get());
+	requestText.release();
+	RDEBUG("0", 0);
+	std::auto_ptr<HbListWidgetItem> statusLabel(q_check_ptr(new HbListWidgetItem()));
+	statusLabel->setText("Status");
+	accessDetails->addItem(statusLabel.get());
+	statusLabel.release();
+	
+	std::auto_ptr<HbListWidgetItem> statusText(q_check_ptr(new HbListWidgetItem()));
+	QString pinStatus = mSecModUIModel.PINStatus(KPinGSettIndex, ETrue);
+	statusText->setText(pinStatus);
+	accessDetails->addItem(statusText.get());
+	statusText.release();
+
+	connect(accessDetails, SIGNAL(longPressed(HbAbstractViewItem*, QPointF )), this, SLOT(indicateLongPress(HbAbstractViewItem*, QPointF)));
+	connect(formModel.get(), SIGNAL(activated(QModelIndex)), this, SLOT(handleAccessView(QModelIndex)));
+	
+	layout->addItem(accessDetails);	
+	layout->addItem(form.get());
+	form.release();
+	setLayout(layout.get());
+	layout.release();
+	RDEBUG("0", 0);
+	}
+
+void CpModuleView::showSignatureView(TBool showBlockedNote)
+	{
+	RDEBUG("0", 0);
+	mCurrentView = CpSecModView::ESignatureView;
+	std::auto_ptr<QGraphicsLinearLayout> layout(q_check_ptr(new QGraphicsLinearLayout(Qt::Vertical)));
+	std::auto_ptr<HbDataForm> form(q_check_ptr(new HbDataForm()));
+	std::auto_ptr<HbDataFormModel> formModel(q_check_ptr(new HbDataFormModel()));
+		
+	QVector< QPair<QString, TUint32> > authDetails = mSecModUIModel.AuthDetails();
+	QVectorIterator< QPair<QString, TUint32> > authDetailsIter(authDetails);
+	
+	HbListWidget* accessDetails = q_check_ptr(new HbListWidget(this)); 
+		
+	while(authDetailsIter.hasNext())
+		{
+		QPair<QString, TUint32> pair = authDetailsIter.next();
+		QString label = pair.first;
+		TUint32 status = pair.second;
+		QString blockedDetails = NULL;
+		if ( status & EAuthObjectBlocked)
+			{
+			if (showBlockedNote)
+				{
+				QString totalBlocked(" is blocked. PUK code is needed to unblock the code");
+				if (status & EUnblockDisabled)
+					{
+					totalBlocked =  " totalblocked, contact your module vendor.";
+					}
+				totalBlocked.prepend(label);
+				HbMessageBox::information(totalBlocked);
+				}
+			blockedDetails = label.append(" Blocked");
+		RDEBUG("0", 0);
+		std::auto_ptr<HbListWidgetItem> statusLabel(q_check_ptr(new HbListWidgetItem()));
+		statusLabel->setText(tr("Status"));
+		accessDetails->addItem(statusLabel.get());
+		statusLabel.release();
+
+		std::auto_ptr<HbListWidgetItem> statusText(q_check_ptr(new HbListWidgetItem()));
+		QString pinStatus = mSecModUIModel.PINStatus(KPinNrSettIndex, ETrue);
+		statusText->setText(pinStatus);
+		accessDetails->addItem(statusText.get());
+		statusText.release();
+		}
+		else
+			{
+			std::auto_ptr<HbListWidgetItem> unblockedLabel(q_check_ptr(new HbListWidgetItem()));
+			unblockedLabel->setText(label);
+			accessDetails->addItem(unblockedLabel.get());
+			unblockedLabel.release();
+			
+			std::auto_ptr<HbListWidgetItem> unblockedText(q_check_ptr(new HbListWidgetItem()));
+			unblockedText->setText("****");
+			accessDetails->addItem(unblockedText.get());
+			unblockedText.release();
+			}
+		}
+	form->setModel(formModel.get());
+	formModel.release();
+	layout->addItem(accessDetails);
+	
+	connect(accessDetails, SIGNAL(longPressed(HbAbstractViewItem*, QPointF )), this, SLOT(indicateLongPress(HbAbstractViewItem*, QPointF)));
+	connect(formModel.get(), SIGNAL(activated(QModelIndex)), this, SLOT(handleSigView()));
+		
+	layout->addItem(form.get());
+	form.release();
+	setLayout(layout.get());
+	layout.release();
+	RDEBUG("0", 0);
+	}
+
+void CpModuleView::indicateLongPress(HbAbstractViewItem *item,QPointF coords)
+	{
+	RDEBUG("0", 0);
+	try
+		{
+		mContextMenu->clearActions();
+		mPos = item->modelIndex().row();   
+		
+		if(mCurrentView == CpSecModView::EAccessView)
+			{
+			if( mPos == EIndexCodeLabel && mSecModUIModel.PinChangeable(KPinGSettIndex)
+				|| mPos == EIndexCodeRequest && mSecModUIModel.PinRequestChangeable(KPinGSettIndex)
+				|| mPos == EIndexCodeStatus )
+				{
+				std::auto_ptr<HbAction> changePIN(q_check_ptr(new HbAction("Change")));     
+				connect(changePIN.get(), SIGNAL(triggered()), this, SLOT( handleAccessView()));    
+				mContextMenu->addAction(changePIN.get());
+				changePIN.release();
+				}
+			if( mSecModUIModel.PinUnblockable(KPinGSettIndex) )
+				{
+				std::auto_ptr<HbAction> unblockPIN(q_check_ptr(new HbAction("Unblock")));     
+				connect(unblockPIN.get(), SIGNAL(triggered()), this, SLOT( handleAccessView()));    
+				mContextMenu->addAction(unblockPIN.get());
+				unblockPIN.release();
+				}
+			if( mSecModUIModel.PinOpen(KPinGSettIndex) )
+				{
+				std::auto_ptr<HbAction> closePIN(q_check_ptr(new HbAction("Close")));     
+				connect(closePIN.get(), SIGNAL(triggered()), this, SLOT( handleAccessView()));    
+				mContextMenu->addAction(closePIN.get());
+				closePIN.release();
+				}
+			}
+		else if(mCurrentView == CpSecModView::ESignatureView)
+			{
+			if (mSecModUIModel.PinChangeable(KPinNrSettIndex))
+				{
+				std::auto_ptr<HbAction> changePIN(q_check_ptr(new HbAction("Change")));     
+				connect(changePIN.get(), SIGNAL(triggered()), this, SLOT( handleSigViewCommand()));    
+				mContextMenu->addAction(changePIN.get());
+				changePIN.release();
+				}
+			if (mSecModUIModel.PinUnblockable(KPinNrSettIndex))
+				{
+				std::auto_ptr<HbAction> unblockPIN(q_check_ptr(new HbAction("Unblock")));     
+				connect(unblockPIN.get(), SIGNAL(triggered()), this, SLOT( handleSigViewCommand()));    
+				mContextMenu->addAction(unblockPIN.get());
+				unblockPIN.release();
+				}
+			}
+				
+		mContextMenu->setPreferredPos(coords);
+		mContextMenu->open();
+		}
+	catch(const std::exception& exception)
+		{
+		HbMessageBox::information(exception.what());
+		}
+	RDEBUG("0", 0);
+	}
+
+void CpModuleView::handleAccessView( const QModelIndex& modelIndex )
+	{
+	RDEBUG("0", 0);
+	try
+		{
+		mPos = modelIndex.row();
+		handleAccessView();
+		}
+	catch(const std::exception& exception)
+		{
+		HbMessageBox::information(exception.what());
+		}
+	}
+
+void CpModuleView::handleAccessView()
+	{
+	RDEBUG("0", 0);
+	try
+		{
+		if(mPos == EIndexCodeLabel)
+			{
+			QT_TRAP_THROWING(mSecModUIModel.ChangeOrUnblockPinL(KPinGSettIndex));        
+			}
+		else if(mPos == EIndexCodeRequest)
+			{
+			if (KErrCancel == mSecModUIModel.ChangeCodeRequest(KPinGSettIndex))
+				{
+				return;
+				}
+			}
+		else if ( mPos == EIndexCodeStatus)
+			{
+			QT_TRAP_THROWING(mSecModUIModel.CloseAuthObjL(KPinGSettIndex)); 
+			}
+		showAccessView();
+		}
+	catch(const std::exception& exception)
+		{
+		HbMessageBox::information(exception.what());
+		}
+	}
+
+void CpModuleView::handleSigView()
+	{
+	RDEBUG("0", 0);
+	try
+		{
+		QT_TRAP_THROWING(mSecModUIModel.ChangeOrUnblockPinL(KPinNrSettIndex));
+		showSignatureView(EFalse);
+		}
+	catch(const std::exception& exception)
+		{
+		HbMessageBox::information(exception.what());
+		}
+	}
+
+void CpModuleView::handleSigViewCommand()
+	{
+	RDEBUG("0", 0);
+	try
+		{
+		switch(mPos)
+			{
+			case ESecModUICmdChange:
+				QT_TRAP_THROWING(mSecModUIModel.ChangePinNrL(mPos));
+				showSignatureView(EFalse);
+				break;
+			case ESecModUICmdUnblock:
+				QT_TRAP_THROWING(mSecModUIModel.UnblockPinNrL(mPos));
+				showSignatureView(EFalse);
+				break;
+			};
+		}
+	catch(const std::exception& exception)
+		{
+		HbMessageBox::information(exception.what());
+		}
+	}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/cpadvancedsecplugin/src/cpsecmodmodel.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,935 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of the CSecModUIModel class
+*
+*/
+
+#include <unifiedkeystore.h>
+#include <mctauthobject.h>
+#include <mctkeystore.h>
+#include <securityerr.h>
+
+#include <qvector.h>
+#include <qpair.h>
+#include <qlabel.h>
+#include <qerrormessage.h>
+#include <qstring.h>
+
+#include <hbmessagebox.h>
+#include <../../inc/cpsecplugins.h>
+#include "cpsecmodmodel.h"
+#include "cpsecmodsyncwrapper.h"
+
+const TInt KWIMStoreUid ( 0x101F79D9 );
+_LIT(KSecModUIPanic, "Security Module UI panic");
+
+// ============================= LOCAL FUNCTIONS ===============================
+GLDEF_C void Panic(TInt aPanic)
+  {
+  User::Panic(KSecModUIPanic, aPanic);
+  }
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::NewL()
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CSecModUIModel* CSecModUIModel::NewL()
+    {
+    RDEBUG("0", 0);
+    CSecModUIModel* self = new( ELeave ) CSecModUIModel();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::CSecModUIModel
+// C++ default constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CSecModUIModel::CSecModUIModel()
+    {}
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::~CSecModUIModel
+// C++ destructor
+// -----------------------------------------------------------------------------
+//
+
+CSecModUIModel::~CSecModUIModel()
+    {
+    delete iWrapper;
+    ResetAndDestroyCTObjects();
+    }
+// -----------------------------------------------------------------------------
+// CSecModUIModel::ResetAndDestroyCTObjects(): Cleans up all objects referenced
+// through the crypto token framework.
+// -----------------------------------------------------------------------------
+//
+void CSecModUIModel::ResetAndDestroyCTObjects()
+    {
+    ResetAndDestroyAOs();
+    iAOKeyStores.Reset();
+    delete iUnifiedKeyStore;
+    iUnifiedKeyStore = NULL;
+    iKeyStore = NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::ResetAndDestroyAOs(): Cleans up the list of auth objects.
+// -----------------------------------------------------------------------------
+//
+void CSecModUIModel::ResetAndDestroyAOs()
+    {
+    RDEBUG("0", 0);
+    if (iAOList)
+        {
+        iAOList->Release();
+        iAOList = NULL;
+        }
+    if (iAOArray.Count() > 0 &&
+        iAOArray[0]->Token().TokenType().Type().iUid == KTokenTypeFileKeystore)
+        {
+        iAOArray.Reset();
+        }
+    else
+        {
+        iAOArray.Close();
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CSecModUIModel::ConstructL()
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CSecModUIModel::ConstructL()
+    {
+    InitializeKeyStoreL();
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::InitializeKeyStoreL()
+// -----------------------------------------------------------------------------
+//
+void CSecModUIModel::InitializeKeyStoreL()
+    {
+    RDEBUG("0", 0);
+    ResetAndDestroyCTObjects();
+    
+    // Ensure that file server session is succesfully created
+    User::LeaveIfError( iRfs.Connect() );
+        
+    iUnifiedKeyStore = CUnifiedKeyStore::NewL(iRfs);
+
+    if (iWrapper == NULL)
+        {
+        iWrapper = CSecModUISyncWrapper::NewL();
+        }
+
+    TInt err = iWrapper->Initialize(*iUnifiedKeyStore);
+
+    ShowErrorNote(err);
+    if (KErrNone != err && KErrHardwareNotAvailable != err)
+        {
+        User::Leave(err);
+        }
+    TInt keyStoreCount = iUnifiedKeyStore->KeyStoreCount();
+    if (0 >= keyStoreCount)
+        {
+        return;
+        }
+
+    RMPointerArray<CCTKeyInfo> keyInfos;
+    CleanupClosePushL(keyInfos);
+    TCTKeyAttributeFilter filter;
+    TInt keyInfoCount = 0;
+    filter.iPolicyFilter = TCTKeyAttributeFilter::EAllKeys;
+
+    for (TInt i = 0; i < keyStoreCount; i++)
+        {
+		err = iWrapper->ListKeys(iUnifiedKeyStore->KeyStore(i), keyInfos, filter);
+		User::LeaveIfError(err);
+        //If list ok, append the AO, otherwise go next
+		keyInfoCount = keyInfos.Count();
+		for (TInt j = 0; j < keyInfoCount; j++)
+			{
+			// Check that keystore has at least one AO.
+			if (NULL != keyInfos[j]->Protector())
+				{
+				// If keystore has AO, add it to the array.
+				User::LeaveIfError(
+					iAOKeyStores.Append(&(iUnifiedKeyStore->KeyStore(i))));
+				break;
+				}
+			}     
+        }
+    CleanupStack::PopAndDestroy(&keyInfos);
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::LoadTokenLabelsL()
+// Retrieves the description and location of all tokens.
+// -----------------------------------------------------------------------------
+//
+QMap<QString,QString> CSecModUIModel::LoadTokenLabelsL()
+    {
+		RDEBUG("0", 0);
+    TInt keyStoreCount = iAOKeyStores.Count();
+    QMap<QString, QString> labelList;
+    
+    if (0 == keyStoreCount)
+        {
+        return labelList;
+        }
+    
+    for (TInt i = 0; i < keyStoreCount; i++)
+        {
+		QString keystoreLabel = 0;
+        if (iAOKeyStores[i]->Token().TokenType().Type().iUid == KTokenTypeFileKeystore )
+            {
+			keystoreLabel = "Phone keystore";
+            }
+        else if(iAOKeyStores[i]->Token().TokenType().Type().iUid == KWIMStoreUid )
+            {                
+			const TDesC& label = iAOKeyStores[i]->Token().Label();
+			keystoreLabel = QString( (QChar*) label.Ptr(), label.Length());
+            }
+        else
+        	{
+			continue;
+        	}
+         QString location = Location(iAOKeyStores[i]->Token().TokenType().Type());
+        labelList.insert(keystoreLabel,location);
+        }
+    return labelList;
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::Location() 
+// Identifies the location of the keystore based on the Uid.
+// -----------------------------------------------------------------------------
+//
+QString CSecModUIModel::Location( TUid aUid ) const
+    {
+    RDEBUG("0", 0);
+    QString location = 0;
+
+    switch ( aUid.iUid )
+        {
+        case KTokenTypeFileKeystore:
+            {
+            location = "\nPhone memory";
+            break;
+            }
+        case KWIMStoreUid:
+            {
+            location = "\nSmart card";
+            break;
+            }
+        default:
+            {
+            break;
+            }
+        }
+    return location;
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::ShowErrorNote(TInt aError) const
+// Displays appropriate error message based on the error code.
+// -----------------------------------------------------------------------------
+//
+void CSecModUIModel::ShowErrorNote(TInt aError) const
+    {
+	QString sError;
+		RDEBUG("aError", aError);
+    switch (aError)
+        {
+        case KErrCancel:
+        case KErrLocked:
+        case KErrNone:
+            {
+            break;
+            }
+        case KErrInUse:
+            {
+            sError = "Key is currently in use. Unable to delete. Close applications and try again.";
+            break;
+            }
+        case KErrBadPassphrase:
+            {
+            sError = "Code incorrect";
+            break;
+            }
+        case KErrHardwareNotAvailable: // flow thru
+        default:
+            {
+            sError = "Security module internal error";
+            break;
+            }
+        }
+
+    if ( sError.length() != 0 )
+		{
+		HbMessageBox::information(sError);
+		}
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::OpenTokenL(TInt aTokenIndex)
+// Retrieves the appropriate token based on the index.
+// -----------------------------------------------------------------------------
+//
+void CSecModUIModel::OpenTokenL(TInt aTokenIndex)
+    {
+    RDEBUG("0", 0);
+    ResetAndDestroyAOs();
+    iKeyStore = iAOKeyStores[aTokenIndex];
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::CheckCodeViewStringsL()
+// Initialize the auth objects and return the total count.
+// -----------------------------------------------------------------------------
+//
+TInt CSecModUIModel::CheckCodeViewStringsL()
+    {
+    InitAuthObjectsL();
+    ListAuthObjectsL();
+    return iAOArray.Count();
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::InitAuthObjectsL()
+// Retrieve the authentication object associated with the appropriate key store 
+// implementation.
+// -----------------------------------------------------------------------------
+//
+void CSecModUIModel::InitAuthObjectsL()
+    {
+    RDEBUG("0", 0);
+    TInt err = KErrNone;
+    // Symbian's file key store does not support
+    // MCTAuthenticationObjectList interface, so we need to use
+    // other way to get AO.
+    if (iKeyStore->Token().TokenType().Type().iUid == KTokenTypeFileKeystore)
+        {
+        if (iAOArray.Count()==0)
+            {
+            RMPointerArray<CCTKeyInfo> keyInfos;
+            CleanupClosePushL(keyInfos);
+            TCTKeyAttributeFilter filter;
+            TInt keyInfoCount = 0;
+            filter.iPolicyFilter = TCTKeyAttributeFilter::EAllKeys;
+            err = iWrapper->ListKeys(*iKeyStore, keyInfos, filter);
+            ShowErrorNote(err);
+            User::LeaveIfError(err);
+            keyInfoCount = keyInfos.Count();
+            for (TInt j = 0; j < keyInfoCount; j++)
+                {
+                // Check that keystore has at least one AO.
+                if (NULL != keyInfos[j]->Protector())
+                    {
+                    // If keystore has AO, add it to the array.
+                    User::LeaveIfError(iAOArray.Append(keyInfos[j]->Protector()));
+                    break;
+                    }
+                }
+            CleanupStack::PopAndDestroy(&keyInfos);  //keyInfos
+            }
+        }
+    else
+        {
+        if (NULL == iAOList)
+            {
+            MCTTokenInterface* tokenInterface = NULL;
+            err = iWrapper->GetAuthObjectInterface(
+                iKeyStore->Token(), tokenInterface);
+            if ( KErrNone != err || NULL == tokenInterface )
+                {
+                ShowErrorNote(err);
+                User::Leave(err);
+                }
+            iAOList = (MCTAuthenticationObjectList*)tokenInterface;
+            }
+        }
+    }
+// -----------------------------------------------------------------------------
+// CSecModUIModel::ListAuthObjectsL()
+// list the auth objects.
+// -----------------------------------------------------------------------------
+//
+void CSecModUIModel::ListAuthObjectsL()
+    {
+    RDEBUG("0", 0);
+    if (0 >= iAOArray.Count())
+        {
+        __ASSERT_ALWAYS(iAOList, Panic(EPanicNullPointer));
+        TInt err = iWrapper->ListAuthObjects(*iAOList, iAOArray);
+        if (err)
+            {
+            ShowErrorNote(err);
+            User::Leave(err);
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::TokenLabelForTitle() const
+// Retrieves description of the token based on UID of the current active keystore.
+// -----------------------------------------------------------------------------
+//
+QString CSecModUIModel::TokenLabelForTitle() const
+    {
+	QString qLabel;
+    if (iKeyStore->Token().TokenType().Type().iUid 
+        == KTokenTypeFileKeystore)
+        {
+        qLabel = "Phone keystore";   
+        }
+    else
+        {            
+        const TDesC& label = iKeyStore->Token().Label();
+        qLabel = QString((QChar*)label.Ptr(),label.Length());
+        }
+    return qLabel;
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::AuthStatus(TInt aIndex) const
+// Returns status of the selected auth object. 
+// -----------------------------------------------------------------------------
+//
+TUint32 CSecModUIModel::AuthStatus(TInt aIndex) const
+		{
+		return iAOArray[aIndex]->Status();
+		}
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::PINStatus( TInt aIndex, TBool aShowBlockedNote ) const
+// Returns status of the auth object based on its persistent properties set
+// by security module implementation.
+// -----------------------------------------------------------------------------
+//
+QString CSecModUIModel::PINStatus(  TInt aIndex, TBool aShowBlockedNote ) const
+    {
+    RDEBUG("0", 0);
+    __ASSERT_ALWAYS(aIndex < iAOArray.Count(), Panic(EPanicIndexOutOfRange));
+    QString pinStatus;
+    TUint32 status = iAOArray[aIndex]->Status();
+    
+    if (status & EAuthObjectBlocked)
+        {
+        if (aShowBlockedNote)
+            {
+			QString information = 0;
+            if (status & EUnblockDisabled)
+                {
+				information = " totalblocked, contact your module vendor.";
+                }
+            else
+                {
+				information = " is blocked. PUK code is needed to unblock the code";
+                }
+            information.prepend(QString( (QChar*)(iAOArray[aIndex]->Label()).Ptr(),iAOArray[aIndex]->Label().Length() ) );
+            HbMessageBox::information(information);        
+            }            
+        pinStatus = "Blocked";
+        }
+    else if ( PinOpen(aIndex) )
+        {
+		pinStatus = "Open";
+        }
+    else
+        {
+		pinStatus = "Closed";
+        }
+    return pinStatus;
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::PinOpen(TInt aIndex) const
+// Checks whether the Pin is still available.
+// -----------------------------------------------------------------------------
+//
+TBool CSecModUIModel::PinOpen(TInt aIndex) const
+    {
+    __ASSERT_ALWAYS(aIndex < iAOArray.Count(), Panic(EPanicIndexOutOfRange));
+    TInt timeRemaining = 0;
+    TInt err = iWrapper->TimeRemaining(*(iAOArray[aIndex]), timeRemaining);
+    TBool ret = ETrue;
+    if ( 0 < timeRemaining )
+        {
+        ret = ETrue;
+        }
+    else if( timeRemaining == -1 )
+        {
+        ret = ETrue;
+        }
+    else
+        {
+        ret = EFalse;
+        }
+    return ret;
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::ChangeOrUnblockPinL(TInt aIndex)
+// Based on the property of auth object the pin can be changed or unblocked.
+// -----------------------------------------------------------------------------
+//
+void CSecModUIModel::ChangeOrUnblockPinL(TInt aIndex)
+    {
+    RDEBUG("0", 0);
+    __ASSERT_ALWAYS(aIndex < iAOArray.Count(), Panic(EPanicIndexOutOfRange));
+    TUint32 status = iAOArray[aIndex]->Status();
+
+    if ((status & EAuthObjectBlocked) && (status & EUnblockDisabled))
+        {
+        return; // We cannot do anything. PIN is total bolcked.
+        }
+    else if (status & EAuthObjectBlocked)
+        {
+        // Let's unblock the PIN
+        UnblockPinL(aIndex);
+        }
+    else if (status & EEnabled)
+        {
+        // PIN is enabled. Let's change the PIN.
+        ChangePinL(aIndex);
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::UnblockPinL(TInt aIndex)
+// Unblocks PIN.
+// -----------------------------------------------------------------------------
+//
+void CSecModUIModel::UnblockPinL(TInt aIndex)
+    {
+    __ASSERT_ALWAYS(aIndex < iAOArray.Count(), Panic(EPanicIndexOutOfRange));
+    TInt err = iWrapper->UnblockAuthObject(*(iAOArray[aIndex]));
+    if (KErrNone == err)
+        {
+        HbMessageBox::information("Code unblocked");
+        }
+    else
+        {
+        ShowErrorNote(err);
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::ChangePinL(TInt aIndex)
+// Changes the value of the PIN.
+// -----------------------------------------------------------------------------
+//
+void CSecModUIModel::ChangePinL(TInt aIndex)
+    {
+    RDEBUG("0", 0);
+    __ASSERT_ALWAYS(aIndex < iAOArray.Count(), Panic(EPanicIndexOutOfRange));
+    TInt err = KErrNone;
+  
+    err = iWrapper->ChangeReferenceData(*(iAOArray[aIndex]));
+    if (err)
+        {
+        ShowErrorNote(err);
+        }
+    else
+        {
+		HbMessageBox::information("Code changed");
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::ChangeCodeRequestL(TInt aIndex)
+// Toggles the value of auth object if possible.
+// -----------------------------------------------------------------------------
+//
+TInt CSecModUIModel::ChangeCodeRequest(TInt aIndex)
+    {
+    __ASSERT_ALWAYS(aIndex < iAOArray.Count(), Panic(EPanicIndexOutOfRange));
+    TUint32 status = iAOArray[aIndex]->Status();
+    TInt err = KErrNone;
+    if (status & EDisableAllowed &&  !(status & EAuthObjectBlocked))
+        {
+        if ( status & EEnabled )
+            {
+            err = iWrapper->DisableAuthObject(*(iAOArray[aIndex]));
+            }
+        else
+            {
+            err = iWrapper->EnableAuthObject(*(iAOArray[aIndex]));
+            }
+        ShowErrorNote(err);
+        }
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::CloseAuthObjL(TInt aIndex)
+// If the auth object is open then closes it.
+// -----------------------------------------------------------------------------
+//
+void CSecModUIModel::CloseAuthObjL(TInt aIndex)
+    {
+    if (PinOpen(aIndex))
+        {
+        __ASSERT_ALWAYS(aIndex < iAOArray.Count(), Panic(EPanicIndexOutOfRange));
+        TInt err = iWrapper->CloseAuthObject(*(iAOArray[aIndex]));
+        if (err)
+            {
+            ShowErrorNote(err);
+            User::Leave(err);
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::DeleteKeysL(TInt aTokenIndex)
+// Deletes key from the appropriate keystore.
+// -----------------------------------------------------------------------------
+//
+void CSecModUIModel::DeleteKeysL(TInt aTokenIndex)
+    {
+    RDEBUG("0", 0);
+    __ASSERT_ALWAYS(aTokenIndex < iAOKeyStores.Count(), Panic(EPanicIndexOutOfRange));
+    RMPointerArray<CCTKeyInfo> keyInfos;
+	CleanupClosePushL(keyInfos);
+	TCTKeyAttributeFilter filter;
+	filter.iPolicyFilter = TCTKeyAttributeFilter::EAllKeys;
+	TInt err = iWrapper->ListKeys(*iAOKeyStores[aTokenIndex], keyInfos, filter);
+	ShowErrorNote(err);
+	User::LeaveIfError(err);
+	for (TInt i = 0; i < keyInfos.Count(); ++i)
+		{
+		err = iWrapper->DeleteKey(*iUnifiedKeyStore, keyInfos[i]->Handle());
+		ShowErrorNote(err);
+
+		if (KErrHardwareNotAvailable == err )
+			{
+			break; // Break the loop, if keystore not available
+			}
+		}
+	CleanupStack::PopAndDestroy(&keyInfos);  //keyInfos
+	ResetAndDestroyCTObjects();
+	InitializeKeyStoreL();
+	}
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::SecModDetailsL(TInt aTokenIndex)
+// Retrieve security module details and cleansup all currently held auth objects.
+// -----------------------------------------------------------------------------
+//
+QVector< QPair<QString,QString> > CSecModUIModel::SecModDetailsL(TInt aTokenIndex)
+    {
+    iKeyStore = iAOKeyStores[aTokenIndex];
+    InitAuthObjectsL();
+    ListAuthObjectsL();
+    QVector< QPair<QString,QString> > securityDetails = GetSecModDetailsL();
+    iKeyStore = NULL; // not owned
+    if (iAOList)
+        {
+        iAOList->Release();
+        iAOList = NULL;
+        }
+    iAOArray.Reset();
+    return securityDetails;
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::GetSecModDetailsL()
+// Retrieve security module details.
+// -----------------------------------------------------------------------------
+//
+QVector< QPair<QString,QString> > CSecModUIModel::GetSecModDetailsL()
+    {
+    RDEBUG("0", 0);
+    MCTToken& token = iKeyStore->Token();
+    QVector< QPair<QString,QString> > securityModDetails;
+    
+    if (token.TokenType().Type().iUid == KTokenTypeFileKeystore)
+        { 
+		QPair<QString,QString> name("Name:","Phone keystore");
+        securityModDetails.append(name);
+        }
+    else 
+        {            
+		QPair<QString,QString> name("Name:","(No label)");
+        securityModDetails.append(name);
+        }
+
+    AppendItem(securityModDetails, "Version:", token.Information( MCTToken::EVersion ), "(Not defined)" );
+    AppendLocation(securityModDetails, token.TokenType().Type(), QString("Security module location:"));
+    
+    if (token.TokenType().Type().iUid == KTokenTypeFileKeystore)
+        { 
+		QPair<QString,QString> accessCode("Access code:","Phone keystore code");
+        securityModDetails.append(accessCode);
+        }
+    else 
+        {            
+        AppendItem(securityModDetails, "Access code:", iAOArray[0]->Label(), "Access code:" );
+        }
+
+    AppendPinNRs(securityModDetails);
+
+    AppendItem(	securityModDetails, "Serial number:",
+				token.Information( MCTToken::ESerialNo),
+				"(Not defined)");
+
+    AppendItem(	securityModDetails, "Manufacturer:",
+				token.Information( MCTToken::EManufacturer),
+				"(Not defined)");
+    return securityModDetails;
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::AppendLocation()
+// Appends the location of the keystore.
+// -----------------------------------------------------------------------------
+//
+void CSecModUIModel::AppendLocation( QVector< QPair<QString,QString> >& aSecModDetails, 
+									 TUid aLocUid, 
+									 QString aCertDisplayDetails )
+    {
+    QString locationDetails = "(Not defined)";
+
+    switch ( aLocUid.iUid )
+        {
+    	case KTokenTypeFileKeystore:
+        	locationDetails = "Phone memory";
+            break;
+
+        case KWIMStoreUid:
+        	locationDetails = "Smart card";
+            break;
+
+        default:
+            break;
+        }
+    aSecModDetails.append(QPair<QString,QString>(aCertDisplayDetails, locationDetails));
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::AppendItem()
+// Appends the value of a label if present otherwise appends empty descriotion.
+// -----------------------------------------------------------------------------
+//
+void CSecModUIModel::AppendItem( 	QVector< QPair<QString,QString> >& aSecModDetails, 
+									QString aLabel, 
+									const TDesC& aValue, 
+									QString aNullDescription)
+	{
+	RDEBUG("0", 0);
+	if( aValue.Length() == 0 )
+		{
+		aSecModDetails.append(QPair<QString,QString>(aLabel, aNullDescription));
+		}
+	else
+		{
+		QString value = QString((QChar*) aValue.Ptr(),aValue.Length());
+		aSecModDetails.append(QPair<QString,QString>(aLabel, value));
+		}
+	}
+
+// -------------------------------------------------------------------------------
+// CSecModUIModel::AppendPinNRs(QVector< QPair<QString,QString> >& aSecModDetails)
+// Generate details of signing security module.
+// -------------------------------------------------------------------------------
+//
+void CSecModUIModel::AppendPinNRs(QVector< QPair<QString,QString> >& aSecModDetails)
+    {
+    TInt pinCount = iAOArray.Count();
+    TInt j = 0;
+
+	for (TInt i=1; i<pinCount; i++)
+		{
+		QString noLabelDetails = "Signing code ";
+		const TDesC& label = iAOArray[i]->Label();
+		if(label.Length() == 0)
+			{
+			noLabelDetails.append(++j);
+			}
+		QString signingCode = "Signing code:";
+		AppendItem(aSecModDetails, signingCode , iAOArray[i]->Label(), noLabelDetails);
+		}
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::AuthDetails() const
+// Return the list of pair of description and status of each auth object.
+// -----------------------------------------------------------------------------
+//
+QVector<QPair<QString, TUint32> > CSecModUIModel::AuthDetails()
+	{
+	QVector<QPair<QString, TUint32> > authDetails;
+	
+	// Here is assumed that the first AO is always PIN-G
+	for (TInt i = 1; i < iAOArray.Count(); i++)
+		{
+		const TDesC& label = iAOArray[i]->Label();
+		TUint32 status = iAOArray[i]->Status();
+		QString sLabel = QString((QChar*) label.Ptr(), label.Length());
+		QPair<QString, TUint32> pair(sLabel, status);
+		authDetails.append(pair);
+		}
+	return authDetails;
+	}
+	
+// -----------------------------------------------------------------------------
+// CSecModUIModel::ChangePinNrL(TInt aIndex)
+// Change the pin value for the singing module.
+// -----------------------------------------------------------------------------
+//
+void CSecModUIModel::ChangePinNrL(TInt aIndex)
+    {
+    RDEBUG("0", 0);
+    ChangePinL(aIndex+1);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::UnblockPinNrL(TInt aIndex)
+// Unblock the value for the signing code module.
+// -----------------------------------------------------------------------------
+//
+void CSecModUIModel::UnblockPinNrL(TInt aIndex)
+    {
+    UnblockPinL(aIndex+1);
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::KeyStoreUID()
+// Retrieves the UID of the current active keystore.
+// -----------------------------------------------------------------------------
+//
+TInt CSecModUIModel::KeyStoreUID()
+	{
+	return iKeyStore->Token().TokenType().Type().iUid;
+	}
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::AuthObj(TInt aIndex)
+// Retrieves the auth object at the speficied index.
+// -----------------------------------------------------------------------------
+//
+const MCTAuthenticationObject& CSecModUIModel::AuthObj(TInt aIndex)
+	{
+	return *iAOArray[aIndex];
+	}
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::PinChangeable(TInt aIndex) const
+// Returns the status accordingly if the pin is changeable or not.
+// -----------------------------------------------------------------------------
+//
+TBool CSecModUIModel::PinChangeable(TInt aIndex) const
+    {
+    RDEBUG("0", 0);
+    __ASSERT_ALWAYS(aIndex < iAOArray.Count(), Panic(EPanicIndexOutOfRange));
+    TUint32 status = iAOArray[aIndex]->Status();
+    TBool ret = ETrue;
+    if ( (status & EAuthObjectBlocked) || (status & EChangeDisabled) )
+        {
+        ret = EFalse;
+        }
+    else if ( status & EEnabled )
+        {
+        ret = ETrue;
+        }
+    else // PIN is disabled;
+        {
+        ret = EFalse;
+        }
+    return ret;
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::PinUnblockable(TInt aIndex) const
+// Returns the status accordingly if the pin is unblockable or not.
+// -----------------------------------------------------------------------------
+//
+TBool CSecModUIModel::PinUnblockable(TInt aIndex) const
+    {
+    TUint32 status = iAOArray[aIndex]->Status();
+    TBool ret = ETrue;
+    if ( status & EUnblockDisabled )
+        {
+        ret = EFalse;
+        }
+    else if ( status & EAuthObjectBlocked )
+        {
+        ret = ETrue;
+        }
+    else // PIN is not blocked;
+        {
+        ret = EFalse;
+        }
+    return ret;
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::PinRequestChangeable(TInt aIndex) const
+// Returns the status accordingly if the pin is changeable or not.
+// -----------------------------------------------------------------------------
+//
+TBool CSecModUIModel::PinRequestChangeable(TInt aIndex) const
+    {
+    RDEBUG("0", 0);
+    __ASSERT_ALWAYS(aIndex < iAOArray.Count(), Panic(EPanicIndexOutOfRange));
+    TUint32 status = iAOArray[aIndex]->Status();
+    TBool ret = EFalse;
+    if ( status & EAuthObjectBlocked )
+        {
+        ret = EFalse;
+        }
+    else if ( status & EDisableAllowed )
+        {
+        ret = ETrue;
+        }
+    else // Disable not allowed;
+        {
+        ret = EFalse;
+        }
+    return ret;
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::IsTokenDeletable(TInt aTokenIndex)
+// Returns the status accordingly if the token is deletable or not.
+// -----------------------------------------------------------------------------
+//
+TBool CSecModUIModel::IsTokenDeletable(TInt aTokenIndex)
+    {
+    __ASSERT_ALWAYS(aTokenIndex < iAOKeyStores.Count(), Panic(EPanicIndexOutOfRange));
+    TBool ret = EFalse;
+    if (iAOKeyStores[aTokenIndex]->Token().TokenType().Type().iUid
+        == KTokenTypeFileKeystore)
+        {
+        ret = ETrue;
+        }
+    else
+        {
+        ret = EFalse;
+        }
+    return ret;
+    }
+
+//  End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/cpadvancedsecplugin/src/cpsecmodsyncwrapper.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,401 @@
+/*
+* Copyright (c) 2005-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 the CSecModUISyncWrapper class
+*                Implements a synchronous wrapper for easier use of Symbian's
+*                Security Frameworks's API's.
+*
+*/
+
+
+#include "cpsecmodsyncwrapper.h"
+#include <ct/ccttokentypeinfo.h>
+#include <ct/mcttokentype.h>
+#include <ct/ccttokentype.h>
+#include <ct/tcttokenobjecthandle.h>
+#include <mctauthobject.h>
+#include <unifiedkeystore.h>
+#include <mctkeystore.h>
+#include <../../inc/cpsecplugins.h>
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CSecModUISyncWrapper::CSecModUISyncWrapper()
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CSecModUISyncWrapper::CSecModUISyncWrapper() : CActive( EPriorityStandard )
+    {
+    CActiveScheduler::Add(this);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSecModUISyncWrapper::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CSecModUISyncWrapper* CSecModUISyncWrapper::NewLC()
+    {
+    CSecModUISyncWrapper* wrap = new (ELeave) CSecModUISyncWrapper();
+    CleanupStack::PushL(wrap);
+    return wrap;
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUISyncWrapper::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CSecModUISyncWrapper* CSecModUISyncWrapper::NewL()
+    {
+    RDEBUG("0", 0);
+    CSecModUISyncWrapper* wrap = CSecModUISyncWrapper::NewLC();
+    CleanupStack::Pop(wrap);
+    return wrap;
+    }
+
+// Destructor
+CSecModUISyncWrapper::~CSecModUISyncWrapper()
+    {
+    Cancel();
+    iOperation = EOperationNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUISyncWrapper::Initialize(CUnifiedKeyStore& aKeyStore)
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+
+TInt CSecModUISyncWrapper::Initialize(CUnifiedKeyStore& aKeyStore)
+    {
+    if( !IsActive() && !iWait.IsStarted() )
+        {
+        iOperation = EOperationInit;
+        iObject = STATIC_CAST(TAny*, &aKeyStore);
+        aKeyStore.Initialize(iStatus);
+        SetActive();
+        iWait.Start();
+        iOperation = EOperationNone;
+        return iStatus.Int();
+        }
+    return KErrInUse;
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::GetAuthObjectInterface(...)
+// -----------------------------------------------------------------------------
+//
+TInt CSecModUISyncWrapper::GetAuthObjectInterface(
+    MCTToken& aToken, MCTTokenInterface*& aTokenInterface)
+    {
+    RDEBUG("0", 0);
+    if( !IsActive() && !iWait.IsStarted() )
+        {
+        iOperation = EOperationGetAOInterface;
+        iObject = STATIC_CAST(TAny*, &aToken);
+        const TUid KUidInterfaceAO = { KCTInterfaceAuthenticationObject };
+        aToken.GetInterface(KUidInterfaceAO, aTokenInterface, iStatus);
+        iOperation = EOperationGetAOInterface;
+        SetActive();
+        iWait.Start();
+        iOperation = EOperationNone;
+        return iStatus.Int();
+        }
+    return KErrInUse;
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUISyncWrapper::ListAuthObjects(...)
+// -----------------------------------------------------------------------------
+//
+TInt CSecModUISyncWrapper::ListAuthObjects(
+    MCTAuthenticationObjectList& aAuthObjList,
+    RMPointerArray<MCTAuthenticationObject>& aAuthObjects)
+    {
+    if( !IsActive() && !iWait.IsStarted() )
+        {
+        iOperation = EOperationListAOs;
+        iObject = STATIC_CAST(TAny*, &aAuthObjList);
+        aAuthObjList.List( aAuthObjects, iStatus );
+        iOperation = EOperationListAOs;
+        SetActive();
+        iWait.Start();
+        iOperation = EOperationNone;
+        return iStatus.Int();
+        }
+    return KErrInUse;
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUISyncWrapper::ListKeys(...)
+// -----------------------------------------------------------------------------
+//
+TInt CSecModUISyncWrapper::ListKeys(
+    MCTKeyStore& aKeyStore,
+    RMPointerArray<CCTKeyInfo>& aKeysInfos,
+    const TCTKeyAttributeFilter& aFilter)
+    {
+    RDEBUG("0", 0);
+    if( !IsActive() && !iWait.IsStarted() )
+        {
+        iOperation = EOperationListKeys;
+        iObject = STATIC_CAST(TAny*, &aKeyStore);
+        aKeyStore.List(aKeysInfos, aFilter, iStatus);
+        SetActive();
+        iWait.Start();
+        iOperation = EOperationNone;
+        return iStatus.Int();
+        }
+    return KErrInUse;
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUISyncWrapper::DeleteKey(...)
+// -----------------------------------------------------------------------------
+//
+TInt CSecModUISyncWrapper::DeleteKey(
+    CUnifiedKeyStore& aKeyStore,
+    TCTTokenObjectHandle aHandle)
+    {
+    RDEBUG("0", 0);
+    if( !IsActive() && !iWait.IsStarted() )
+        {
+        iOperation = EOperationDelKey;
+        iObject = STATIC_CAST(TAny*, &aKeyStore);
+        aKeyStore.DeleteKey(aHandle, iStatus);
+        SetActive();
+        iWait.Start();
+        iOperation = EOperationNone;
+        return iStatus.Int();
+        }
+    return KErrInUse;
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUISyncWrapper::ChangeReferenceData(MCTAuthenticationObject& aAuthObject)
+// -----------------------------------------------------------------------------
+//
+TInt CSecModUISyncWrapper::ChangeReferenceData(
+    MCTAuthenticationObject& aAuthObject)
+    {
+    RDEBUG("0", 0);
+    if( !IsActive() && !iWait.IsStarted() )
+        {
+        iOperation = EOperationChangeReferenceData;
+        iObject = STATIC_CAST(TAny*, &aAuthObject);
+        aAuthObject.ChangeReferenceData(iStatus);
+        SetActive();
+        iWait.Start();
+        iOperation = EOperationNone;
+        return iStatus.Int();
+        }
+    return KErrInUse;
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::UnblockAuthObject(MCTAuthenticationObject& aAuthObject)
+// -----------------------------------------------------------------------------
+//
+TInt CSecModUISyncWrapper::UnblockAuthObject(
+    MCTAuthenticationObject& aAuthObject)
+    {
+    RDEBUG("0", 0);
+    if( !IsActive() && !iWait.IsStarted() )
+        {
+        iOperation = EOperationUnblockAO;
+        iObject = STATIC_CAST(TAny*, &aAuthObject);
+        aAuthObject.Unblock(iStatus);
+        SetActive();
+        iWait.Start();
+        iOperation = EOperationNone;
+        return iStatus.Int();
+        }
+    return KErrInUse;
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::EnableAuthObject(MCTAuthenticationObject& aAuthObject)
+// -----------------------------------------------------------------------------
+//
+TInt CSecModUISyncWrapper::EnableAuthObject(
+    MCTAuthenticationObject& aAuthObject)
+    {
+    RDEBUG("0", 0);
+    if( !IsActive() && !iWait.IsStarted() )
+        {
+        iOperation = EOperationEnableAO;
+        iObject = STATIC_CAST(TAny*, &aAuthObject);
+        aAuthObject.Enable(iStatus);
+        iOperation = EOperationUnblockAO;
+        SetActive();
+        iWait.Start();
+        iOperation = EOperationNone;
+        return iStatus.Int();
+        }
+    return KErrInUse;
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::DisableAuthObject(MCTAuthenticationObject& aAuthObject)
+// -----------------------------------------------------------------------------
+//
+TInt CSecModUISyncWrapper::DisableAuthObject(
+    MCTAuthenticationObject& aAuthObject)
+    {
+    if( !IsActive() && !iWait.IsStarted() )
+        {
+        iOperation = EOperationDisableAO;
+        iObject = STATIC_CAST(TAny*, &aAuthObject);
+        aAuthObject.Disable(iStatus);
+        SetActive();
+        iWait.Start();
+        iOperation = EOperationNone;
+        return iStatus.Int();
+        }
+    return KErrInUse;
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUISyncWrapper::CloseAuthObject(MCTAuthenticationObject& aAuthObject)
+// -----------------------------------------------------------------------------
+//
+TInt CSecModUISyncWrapper::CloseAuthObject(
+    MCTAuthenticationObject& aAuthObject)
+    {
+    if( !IsActive() && !iWait.IsStarted() )
+        {
+        iOperation = EOperationCloseAO;
+        iObject = STATIC_CAST(TAny*, &aAuthObject);
+        aAuthObject.Close(iStatus);
+        SetActive();
+        iWait.Start();
+        iOperation = EOperationNone;
+        return iStatus.Int();
+        }
+    return KErrInUse;
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUIModel::TimeRemaining(...)
+// -----------------------------------------------------------------------------
+//
+TInt CSecModUISyncWrapper::TimeRemaining(
+    MCTAuthenticationObject& aAuthObject,
+    TInt& aStime )
+    {
+    RDEBUG("0", 0);
+    if( !IsActive() && !iWait.IsStarted() )
+        {
+        iOperation = EOperationTimeRemAO;
+        iObject = STATIC_CAST(TAny*, &aAuthObject);
+        aAuthObject.TimeRemaining(aStime, iStatus);
+        SetActive();
+        iWait.Start();
+        iOperation = EOperationNone;
+        return iStatus.Int();
+        }
+    return KErrInUse;
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUISyncWrapper::DoCancel
+// Cancels the ongoing operation if possible.
+// -----------------------------------------------------------------------------
+//
+void CSecModUISyncWrapper::DoCancel()
+    {
+    RDEBUG("iOperation", iOperation);
+    switch ( iOperation )
+        {
+        case EOperationInit:
+            {
+            STATIC_CAST(CUnifiedKeyStore*, iObject)->CancelInitialize();
+            break;
+            }
+        case EOperationGetAOInterface:
+            {
+            STATIC_CAST(MCTToken*, iObject)->CancelGetInterface();
+            break;
+            }
+        case EOperationListAOs:
+            {
+            STATIC_CAST(MCTAuthenticationObjectList*, iObject)->CancelList();
+            break;
+            }
+        case EOperationListKeys:
+            {
+            STATIC_CAST(MCTKeyStore*, iObject)->CancelList();
+            break;
+            }
+        case EOperationDelKey:
+            {
+            STATIC_CAST(CUnifiedKeyStore*, iObject)->CancelDeleteKey();
+            break;
+            }
+        case EOperationChangeReferenceData:
+            {
+            STATIC_CAST(MCTAuthenticationObject*, iObject)->
+                CancelChangeReferenceData();
+            break;
+            }
+        case EOperationUnblockAO:
+            {
+            STATIC_CAST(MCTAuthenticationObject*, iObject)->CancelUnblock();
+            break;
+            }
+        case EOperationEnableAO:
+            {
+            STATIC_CAST(MCTAuthenticationObject*, iObject)->CancelEnable();
+            break;
+            }
+        case EOperationDisableAO:
+            {
+            STATIC_CAST(MCTAuthenticationObject*, iObject)->CancelDisable();
+            break;
+            }
+        case EOperationCloseAO:
+            {
+            STATIC_CAST(MCTAuthenticationObject*, iObject)->CancelClose();
+            break;
+            }
+        case EOperationTimeRemAO:
+            {
+            STATIC_CAST(MCTAuthenticationObject*, iObject)->CancelTimeRemaining();
+            break;
+            }
+        default:
+            {
+            break;
+            }
+        }
+    if (iWait.IsStarted())
+        {
+        iWait.AsyncStop();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CSecModUISyncWrapper::RunL
+// If no errors happened, stop. Show an error note if needed.
+// -----------------------------------------------------------------------------
+//
+void CSecModUISyncWrapper::RunL()
+    {
+    iWait.AsyncStop();
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/cpadvancedsecplugin/src/cpsecmoduleinfoview.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,86 @@
+
+/*
+* 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 <QStringList>
+#include <QGraphicsLinearLayout>
+#include <QModelIndex>
+
+#include <hblineedit.h>
+#include <hbdataform.h>
+#include <hbdataformmodel.h>
+#include <hbdataformmodelitem.h>
+#include <hblabel.h>
+#include <hbpushbutton.h>
+#include <hbmenu.h>
+#include <hbaction.h>
+#include <hbmessagebox.h>
+#include <HbListWidget>
+#include <HbListWidgetItem>
+#include <HbGroupBox>
+#include <hbpushbutton.h>
+#include <hbdataform.h>
+#include <hbdataformmodel.h>
+#include <hbdataformmodelitem.h>
+#include <hbabstractviewitem.h>
+#include <hbtextitem.h>
+#include <hbmainwindow.h>
+#include <hblistview.h>
+#include <QStandardItemModel>
+#include <QModelIndexList>
+
+#include <memory>
+#include <../../inc/cpsecplugins.h>
+#include "cpsecmoduleinfoview.h"
+
+
+CpSecmoduleInfoView::CpSecmoduleInfoView(const QVector< QPair<QString,QString> >& securityDetails, QGraphicsItem *parent /*= 0*/)
+	: CpBaseSettingView(0,parent)
+	{
+	RDEBUG("0", 0);
+	setTitle(tr("Module info"));
+		
+	std::auto_ptr<QGraphicsLinearLayout> layout(q_check_ptr(new QGraphicsLinearLayout(Qt::Vertical)));
+  	HbListWidget* listSecurityDetails = q_check_ptr(new HbListWidget(this)); 
+	
+  	QVectorIterator< QPair<QString, QString> > secDetIter(securityDetails);
+	while(secDetIter.hasNext())
+		{
+		QPair<QString,QString> pair = secDetIter.next();
+		
+		std::auto_ptr<HbListWidgetItem> label(q_check_ptr(new HbListWidgetItem()));
+		label->setText(pair.first);
+		listSecurityDetails->addItem(label.get());
+		label.release();
+		
+		std::auto_ptr<HbListWidgetItem> description(q_check_ptr(new HbListWidgetItem()));
+		description->setText(pair.second);
+		listSecurityDetails->addItem(description.get());
+		description.release();
+		}
+  	    
+	layout->addItem(listSecurityDetails);		
+	setLayout(layout.get());
+	layout.release();
+	RDEBUG("0", 0);
+	}	
+
+CpSecmoduleInfoView::~CpSecmoduleInfoView()
+	 {}
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/cpadvancedsecplugin/src/cpsecmodview.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,143 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0""
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+#include <mctauthobject.h>
+
+
+#include <qstringlist.h>
+#include <qgraphicslinearlayout.h>
+
+#include <hblineedit.h>
+#include <hbdataform.h>
+#include <hbdataformmodel.h>
+#include <hbdataformmodelitem.h>
+#include <hblabel.h>
+#include <hbpushbutton.h>
+#include <hbmenu.h>
+#include <hbaction.h>
+#include <hbmessagebox.h>
+#include <hblistwidget.h>
+#include <hblistwidgetitem.h>
+#include <hbgroupbox.h>
+#include <hbpushbutton.h>
+#include <hbdataform.h>
+#include <hbdataformmodel.h>
+#include <hbdataformmodelitem.h>
+#include <hbabstractviewitem.h>
+#include <hbmainwindow.h>
+#include <HbMessageBox>
+
+#include <memory>
+#include <../../inc/cpsecplugins.h>
+#include "cpsecmodview.h"
+#include "cpsecmodmodel.h"
+#include "cpmoduleview.h"
+
+CpSecModView::CpSecModView(TInt currentPos, CSecModUIModel& secModUIModel, QGraphicsItem *parent /*= 0*/)
+: CpBaseSettingView(0,parent),
+  mSecModUIModel(secModUIModel),
+  mPos(currentPos),
+  mCurrentView(EAccessView),
+  mAccessView(NULL),
+  mPrevView(NULL)
+	{
+	RDEBUG("0", 0);
+	try
+	{
+	QT_TRAP_THROWING(mSecModUIModel.OpenTokenL(mPos));
+	QString title = mSecModUIModel.TokenLabelForTitle();
+	setTitle(title);
+	
+	TInt count = 0;
+	// display code view
+	QT_TRAP_THROWING(count = mSecModUIModel.CheckCodeViewStringsL());
+	
+	std::auto_ptr<QGraphicsLinearLayout> layout(q_check_ptr(new QGraphicsLinearLayout(Qt::Vertical)));
+	HbListWidget* listSecView = q_check_ptr(new HbListWidget(this)); 
+	
+	std::auto_ptr<HbListWidgetItem> moduleWidget(q_check_ptr(new HbListWidgetItem()));
+	moduleWidget->setText("\tModule PIN");
+	listSecView->addItem(moduleWidget.get());
+	moduleWidget.release();
+	RDEBUG("count", count);
+	if( count == 2 )
+		{
+		std::auto_ptr<HbListWidgetItem> signingWidget(q_check_ptr(new HbListWidgetItem()));
+		signingWidget->setText("\tSigning PIN");
+		listSecView->addItem(signingWidget.get());
+		signingWidget.release();
+		}
+	
+	connect(listSecView, SIGNAL(activated(QModelIndex)), this, SLOT(showNextView(QModelIndex)));
+	
+	layout->addItem(listSecView);				
+	setLayout(layout.get());
+	layout.release();	
+	}
+	catch(const std::exception& exception)
+		{
+		QString error(exception.what());
+		HbMessageBox::information(error);
+		QT_RETHROW;
+		}
+	}
+
+CpSecModView::~CpSecModView()
+	{
+	if(mAccessView)
+		{
+		mAccessView->deleteLater();
+		mAccessView = NULL;
+		}
+	if(mPrevView)
+		{
+		mPrevView->deleteLater();
+		mPrevView = NULL;
+		}
+	}
+
+
+void CpSecModView::showNextView( const QModelIndex& modelIndex )
+	{
+	RDEBUG("0", 0);
+	try
+		{
+		mAccessView = q_check_ptr(new CpModuleView((TSecModViews)modelIndex.row(),mSecModUIModel));
+		QObject::connect(mAccessView , SIGNAL(aboutToClose()), this, SLOT(displayPrevious())); 
+		mPrevView = mainWindow()->currentView();   //suppose iPreView  is member variable of CpSecurityView
+		mainWindow()->addView(mAccessView);
+		mainWindow()->setCurrentView(mAccessView);
+		}
+	catch(const std::exception& exception)
+		{
+		HbMessageBox::information(exception.what());
+		}
+	}
+
+void CpSecModView::displayPrevious()
+	{
+	RDEBUG("0", 0);
+	try
+		{
+		mainWindow()->removeView(mAccessView);
+		}
+	catch(const std::exception& exception)
+		{
+		HbMessageBox::information(exception.what());
+		}
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/cpadvancedsecplugin/src/cpsecurityview.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,388 @@
+/*
+* 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 <QStringList>
+#include <QGraphicsLinearLayout>
+#include <qlist.h>
+#include <qstring.h>
+#include <qvector.h>
+#include <qpair.h>
+
+#include <hblineedit.h>
+#include <hbdataform.h>
+#include <hbdataformmodel.h>
+#include <hbdataformmodelitem.h>
+#include <hblabel.h>
+#include <hbpushbutton.h>
+#include <hbmenu.h>
+#include <hbaction.h>
+#include <hbmessagebox.h>
+#include <HbListWidget>
+#include <HbListWidgetItem>
+#include <HbGroupBox>
+#include <hbpushbutton.h>
+#include <hbmainwindow.h>
+#include <hbabstractviewitem.h>
+#include <HbMessageBox>
+
+#include <memory>
+
+#include <../../inc/cpsecplugins.h>
+
+#include "cpsecurityview.h"
+#include "cpsecmodview.h"
+#include "cpcertview.h"
+#include "cpsecmodmodel.h"
+#include "cpsecmoduleinfoview.h"
+
+CpSecurityView::CpSecurityView(QGraphicsItem *parent /*= 0*/)
+	: CpBaseSettingView(0,parent),
+	  mSecModUIModel(NULL),
+	  mSecModView(NULL),
+	  mPreView(NULL),
+	  mCertView(NULL),
+	  mCurrentView(NULL),
+	  mPos(0),
+	  mNote(NULL)
+	{
+	RDEBUG("0", 0);
+	setTitle(hbTrId("txt_certificate_manager_setlabel_advanced_security"));
+	
+	std::auto_ptr<QGraphicsLinearLayout> layout(q_check_ptr(new QGraphicsLinearLayout(Qt::Vertical)));
+    HbListWidget* listCertView = q_check_ptr(new HbListWidget(this)); 
+
+    std::auto_ptr<HbListWidgetItem> authcert(q_check_ptr(new HbListWidgetItem()));
+    authcert->setText(hbTrId("txt_certificate_manager_list_authority_certificate"));
+    
+    std::auto_ptr<HbListWidgetItem> trustedsitecert(q_check_ptr(new HbListWidgetItem()));
+    trustedsitecert->setText(hbTrId("txt_certificate_manager_list_trusted_site_certific"));
+    
+    std::auto_ptr<HbListWidgetItem> personalcert(q_check_ptr(new HbListWidgetItem()));
+    personalcert->setText(hbTrId("txt_certificate_manager_list_personal_certificates"));
+    
+    std::auto_ptr<HbListWidgetItem> devicecert(q_check_ptr(new HbListWidgetItem()));
+    devicecert->setText(hbTrId("txt_certificate_manager_list_device_certificates"));    
+
+    listCertView->addItem(authcert.get());
+    authcert.release();
+    listCertView->addItem(trustedsitecert.get());
+    trustedsitecert.release();
+    listCertView->addItem(personalcert.get());
+    personalcert.release();
+    listCertView->addItem(devicecert.get());
+    devicecert.release();
+
+    connect(listCertView, SIGNAL(released(QModelIndex)), this, SLOT(displayCert(QModelIndex)));
+        
+    HbListWidget* listSecView = q_check_ptr(new HbListWidget(this)); 
+    QMap<QString,QString> keystoreLabels;
+    RDEBUG("0", 0);
+    try
+		{
+		QT_TRAP_THROWING(
+		mSecModUIModel = CSecModUIModel::NewL();
+		keystoreLabels = mSecModUIModel->LoadTokenLabelsL(); )
+		}
+    catch(const std::exception& exception)
+    	{
+		QString error(exception.what());
+		HbMessageBox::information(error);
+		QT_RETHROW;
+    	}
+    
+    QMapIterator<QString, QString> labelIter(keystoreLabels);
+    if(keystoreLabels.count() != 0)
+    	{
+		while(labelIter.hasNext())
+			{
+			labelIter.next();
+			std::auto_ptr<HbListWidgetItem> widget(q_check_ptr(new HbListWidgetItem()));
+			widget->setText(labelIter.key());
+			widget->setSecondaryText(labelIter.value());
+			listSecView->addItem(widget.get());
+			widget.release();
+			}
+		connect(listSecView, SIGNAL(activated(QModelIndex)), this, SLOT(showCodeView(QModelIndex)));   
+		connect(listSecView, SIGNAL(longPressed(HbAbstractViewItem*, QPointF )), this, SLOT(indicateLongPress(HbAbstractViewItem*, QPointF))); 
+    	}
+    else
+    	{
+		std::auto_ptr<HbListWidgetItem> emptyWidget(q_check_ptr(new HbListWidgetItem()));
+		emptyWidget->setText("(no security modules)");
+    	listSecView->addItem(emptyWidget.get());
+    	emptyWidget.release();
+    	}
+    RDEBUG("0", 0);
+    std::auto_ptr<HbGroupBox> certificatesList(q_check_ptr(new HbGroupBox()));
+	certificatesList->setHeading(hbTrId("txt_certificate_manager_setlabel_certificates"));
+	certificatesList->setContentWidget(listCertView);
+	certificatesList->setCollapsed(true);
+	layout->addItem(certificatesList.get());
+	certificatesList.release();
+	
+	std::auto_ptr<HbGroupBox> protectedContentList(q_check_ptr(new HbGroupBox()));
+	protectedContentList->setHeading("Protected Content");
+	protectedContentList->setCollapsed(true);
+	layout->addItem(protectedContentList.get());
+	protectedContentList.release();
+	
+	std::auto_ptr<HbGroupBox> securityModuleList(q_check_ptr(new HbGroupBox()));
+	securityModuleList->setHeading("Security Module");
+	securityModuleList->setContentWidget(listSecView);
+	securityModuleList->setCollapsed(true);
+	layout->addItem(securityModuleList.get());
+	securityModuleList.release();
+	
+	mContextMenu = q_check_ptr(new HbMenu());
+	
+	setLayout(layout.get()); 
+	layout.release();
+	}
+
+
+CpSecurityView::~CpSecurityView()
+	{
+	if(mSecModView)
+		{
+		mSecModView->deleteLater();
+		}
+	
+	if(mPreView)
+		{
+		mPreView->deleteLater();
+		}
+	
+	if(mCertView)
+		{
+		mCertView->deleteLater();
+		}
+	
+	if(mCurrentView)
+		{
+		mCurrentView->deleteLater();
+		}
+	
+	delete mSecModUIModel;  
+	
+	delete mNote;
+	delete mContextMenu;
+	}
+
+void CpSecurityView::showCodeView()
+	{
+	RDEBUG("0", 0);
+	try
+		{
+		mSecModView = q_check_ptr(new CpSecModView(mPos, *mSecModUIModel));    
+		QObject::connect(mSecModView , SIGNAL(aboutToClose()), this, SLOT(viewDone()));
+		mPreView = mainWindow()->currentView();   //suppose mPreView  is member variable of CpSecurityView
+		mainWindow()->addView(mSecModView);
+		mainWindow()->setCurrentView(mSecModView);
+		}
+	catch(const std::exception& exception)
+		{
+		HbMessageBox::information(exception.what());
+		}
+	}
+
+void CpSecurityView::showCodeView( const QModelIndex& aModelIndex)
+	{
+	mPos = aModelIndex.row();
+	showCodeView();	
+	}
+
+void CpSecurityView::showWIMview()
+	{
+	RDEBUG("0", 0);
+	try
+		{
+		QObject::connect(mSecModView , SIGNAL(aboutToClose()), this, SLOT(viewDone()));
+		mPreView = mainWindow()->currentView();   //suppose mPreView  is member variable of CpSecurityView
+		mainWindow()->addView(mSecModView);
+		mainWindow()->setCurrentView(mSecModView);  
+		}
+	catch(const std::exception& exception)
+		{
+		HbMessageBox::information(exception.what());
+		}
+	}
+
+void CpSecurityView::viewDone()  
+	{
+	try
+		{
+		mainWindow()->removeView(mSecModView);    
+		mSecModView->deleteLater();
+		mSecModView= NULL;
+		mainWindow()->setCurrentView(mPreView);
+		}
+	catch(const std::exception& exception)
+		{
+		HbMessageBox::information(exception.what());
+		}
+	}
+
+void CpSecurityView::displayCert(const QModelIndex& modelIndex)
+	{
+	RDEBUG("0", 0);
+	try
+	{
+	mCertView = q_check_ptr(new CpCertView(modelIndex));    
+	connect(mCertView , SIGNAL(aboutToClose()), this, SLOT(displayPrevious()));
+	mPreView = mainWindow()->currentView();   
+	mainWindow()->addView(mCertView);
+	mainWindow()->setCurrentView(mCertView);
+	}
+	catch(const std::exception& exception)
+		{
+		HbMessageBox::information(exception.what());
+		}
+	}
+
+void CpSecurityView::displayPrevious()  
+	{
+	RDEBUG("0", 0);
+	try
+		{
+		mainWindow()->removeView(mCertView);    
+		mCertView->deleteLater();
+		mCertView= NULL;
+		mainWindow()->setCurrentView(mPreView);
+		}
+	catch(const std::exception& exception)
+		{
+		HbMessageBox::information(exception.what());
+		}
+	}
+
+void CpSecurityView::indicateLongPress(HbAbstractViewItem *item,QPointF coords)
+	{
+	RDEBUG("0", 0);
+	try
+		{
+		mContextMenu->clearActions();
+		mPos = item->modelIndex().row();   
+		
+		std::auto_ptr<HbAction> openModule(q_check_ptr(new HbAction("Open")));     
+		connect(openModule.get(), SIGNAL(triggered()), this, SLOT( showCodeView()));    
+		mContextMenu->addAction(openModule.get());
+		openModule.release();
+		
+		if(mSecModUIModel->IsTokenDeletable(mPos))
+			{
+			std::auto_ptr<HbAction> deleteModule(q_check_ptr(new HbAction("Delete")));     
+			connect(deleteModule.get(), SIGNAL(triggered()), this, SLOT( deleteModule()));    
+			mContextMenu->addAction(deleteModule.get());
+			deleteModule.release();
+			}
+		
+		std::auto_ptr<HbAction> moduleInfo(q_check_ptr(new HbAction("Module Info")));     
+		connect(moduleInfo.get(), SIGNAL(triggered()), this, SLOT( moduleDetails()));    
+		mContextMenu->addAction(moduleInfo.get());
+		moduleInfo.release();
+				
+		mContextMenu->setPreferredPos(coords);
+		mContextMenu->open();
+		}
+	catch(const std::exception& exception)
+		{
+		HbMessageBox::information(exception.what());
+		}
+	}
+
+void CpSecurityView::deleteModule()
+	{
+	RDEBUG("0", 0);
+	try
+		{
+		
+		delete mNote;
+		mNote = NULL;
+		
+		mNote = new HbMessageBox(HbMessageBox::MessageTypeQuestion);
+		mNote->setHeadingWidget(q_check_ptr(new HbLabel(tr("Delete..."))));
+		mNote->setText("Delete keystore and password?");
+		mNote->setPrimaryAction(q_check_ptr(new HbAction("Yes")));
+		mNote->setSecondaryAction(q_check_ptr(new HbAction("No")));
+		mNote->setTimeout(HbPopup::NoTimeout);
+		mNote->setIconVisible (EFalse);
+		mNote->open(this,SLOT(dialogClosed(HbAction*)));
+		}
+	catch(const std::exception& exception)
+		{
+	    HbMessageBox *box = new HbMessageBox(exception.what());
+    	box->setAttribute(Qt::WA_DeleteOnClose);
+    	box->open();	
+		}
+
+}
+void CpSecurityView::dialogClosed(HbAction* action)
+{
+	RDEBUG("0", 0);
+	if (action != mNote->primaryAction())
+		{
+		return;
+		}
+		
+	try
+		{
+		QT_TRAP_THROWING(mSecModUIModel->DeleteKeysL(mPos));
+   		}		
+	catch(const std::exception& exception)
+		{
+	    HbMessageBox *box = new HbMessageBox(exception.what());
+    	box->setAttribute(Qt::WA_DeleteOnClose);
+    	box->open();
+		}
+	}
+
+void CpSecurityView::moduleDetails()
+	{
+	RDEBUG("0", 0);
+	try
+		{
+		QVector< QPair<QString,QString> > securityDetails;
+		QT_TRAP_THROWING(securityDetails = mSecModUIModel->SecModDetailsL(mPos));
+		mModuleinfoView = q_check_ptr(new CpSecmoduleInfoView(securityDetails));
+		
+		connect(mModuleinfoView , SIGNAL(aboutToClose()), this, SLOT(displayPreviousFromModInfo()));
+		mPreView = mainWindow()->currentView();   
+		mainWindow()->addView(mModuleinfoView);
+		mainWindow()->setCurrentView(mModuleinfoView);
+		}
+	catch(const std::exception& exception)
+		{
+		HbMessageBox::information(exception.what());
+		}
+	}
+
+void CpSecurityView::displayPreviousFromModInfo()  
+	{
+	RDEBUG("0", 0);
+	try
+		{
+		mainWindow()->removeView(mModuleinfoView);    
+		mCertView->deleteLater();
+		mCertView= NULL;
+		mainWindow()->setCurrentView(mPreView);
+		}
+	catch(const std::exception& exception)
+		{
+		HbMessageBox::information(exception.what());
+		}
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/cpplugincommon.pri	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,34 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:  controlpanel plugin project qmake common settings
+#
+include (common.pri)
+
+
+LIBS += -lcpframework
+
+symbian: plugin { # copy qtstub and manifest
+	
+		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/cpsecplugins/cpsecplugins.pro	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,22 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+# 
+# Description: Security Settings plugins
+#
+
+TEMPLATE = subdirs
+
+# temporarilly skip, because too many deprecations
+SUBDIRS += devicelockplugin/devicelockplugin.pro
+SUBDIRS += simpincodeplugin/pincodeplugin.pro
+SUBDIRS += cpadvancedsecplugin/group/advancedsecplugin.pro
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/devicelockplugin/devicelocking.ts	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,556 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="3.0" sourcelanguage="en_GB">
+<context>
+<message numerus="no" id="txt_devicelocking_info_lock_code_can_be_changed_l">
+    <comment>Error note when trying to change lock code</comment>        
+    <source>Lock code can be changed %L1n times in %L2n hours</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_pri5_large_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_22</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_info_characters_cannot_be_repeat">
+    <comment>Error note when creating new lock code</comment>        
+    <source>Characters cannot be repeated</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_pri5_large_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_21</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_setlabel_val_30_minutes">
+    <comment>Value for combobox of device locking</comment>        
+    <source>30 minutes</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dataform_heading_combobox_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_04</extra-loc-viewid>
+    <extra-loc-positionid>setlabel_3_val</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_dialog_new_lock_code">
+    <comment>Label for new lock code query</comment>        
+    <source>New lock code</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_06</extra-loc-viewid>
+    <extra-loc-positionid>dialog</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_info_must_include_upper_and_lowe">
+    <comment>Error note when creating new lock code</comment>        
+    <source>Must include upper and lower case characters</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_pri5_large_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_21</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_dialog_lock_code">
+    <comment>Label for lock code query</comment>        
+    <source>Lock code</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_05</extra-loc-viewid>
+    <extra-loc-positionid>dialog</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="yes" id="txt_devicelocking_info_lock_code_cannot_be_same_as">
+    <comment>Error note when creating new lock code</comment>        
+    <source>Lock code cannot be same as previous  %Ln lock codes</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_pri5_large_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_21</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_dpophead_messages_do_not_match">
+    <comment>NotificationDialog shown when creating locking messages</comment>        
+    <source>Messages do not match</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_notifdialog_pri_medium_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_19</extra-loc-viewid>
+    <extra-loc-positionid>dpophead</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_dpophead_locking_message_created">
+    <comment>NotificationDialog shown when locking message is created successfully</comment>        
+    <source>Locking message created</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_notifdialog_pri_medium_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_20</extra-loc-viewid>
+    <extra-loc-positionid>dpophead</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_common_button_cancel">
+    <comment></comment>        
+    <source>Cancel</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id></extra-loc-layout_id>    
+    <extra-loc-viewid>common</extra-loc-viewid>
+    <extra-loc-positionid>button</extra-loc-positionid>
+    <extra-loc-feature>co</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_subhead_device_locking">
+    <comment>Label for Device lock settings in Control Panel</comment>        
+    <source>Device Locking</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dataform_pri</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_01</extra-loc-viewid>
+    <extra-loc-positionid>subhead</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_cp_dblist_device_lock">
+    <comment>Device lock item in Control Panel</comment>        
+    <source>Device lock</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_list_pri_large_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>CP_01</extra-loc-viewid>
+    <extra-loc-positionid>dblist_1</extra-loc-positionid>
+    <extra-loc-feature>CP</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_formlabel_automatic_locking">
+    <comment>Label for Automatic locking combobox</comment>        
+    <source>Automatic locking</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dataform_heading_pri</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_04</extra-loc-viewid>
+    <extra-loc-positionid>formlabel_3</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_device_dialog_new_locking_message">
+    <comment>Label for remote locking message creation dialog</comment>        
+    <source>New locking message</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>device_locking_04</extra-loc-viewid>
+    <extra-loc-positionid>dialog</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_formlabel_remote_locking">
+    <comment>Label for Remote locking field</comment>        
+    <source>Remote locking</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dataform_heading_pri</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_04</extra-loc-viewid>
+    <extra-loc-positionid>formlabel_5</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_dpopinfo_try_again">
+    <comment>Secondary text for wrong code dialog</comment>        
+    <source>Try again</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_notifdialog_sec_medium_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_08</extra-loc-viewid>
+    <extra-loc-positionid>dpopinfo</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_info_information_included_in_the">
+    <comment>Error note when creating new lock code</comment>        
+    <source>Information included in the lock code is not allowed</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_pri5_large_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_21</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_formlabel_locking_message">
+    <comment>Label for Remote locking message field</comment>        
+    <source>Locking message</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dataform_heading_pri</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_04</extra-loc-viewid>
+    <extra-loc-positionid>formlabel_6</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_info_lock_code_can_be_used_for_p">
+    <comment>Descriptive text for device lock code in control panel</comment>        
+    <source>Lock code can be used for protecting the device from unauthorized use</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dataform_description_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_dpophead_emergency_calls_only">
+    <comment>Notification text for lock code query if field has numbers (other than emergency number) and hw call key is pressed</comment>        
+    <source>Emergency calls only</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_notifdialog_pri_medium_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_13</extra-loc-viewid>
+    <extra-loc-positionid>dpophead</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="yes" id="txt_devicelocking_dpopinfo_wait_ln_minutes">
+    <comment>Secondary text for blocked code note</comment>        
+    <source>Wait %Ln minutes</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_notifdialog_sec_medium_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_15</extra-loc-viewid>
+    <extra-loc-positionid>dpopinfo</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_device_dialog_retype_locking_message">
+    <comment>Label for verifying new lock message query</comment>        
+    <source>Retype locking message</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>device_locking_04</extra-loc-viewid>
+    <extra-loc-positionid>dialog</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_common_button_call">
+    <comment>Call button for emergency calls in lock code query</comment>        
+    <source>Call</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>common</extra-loc-layout_id>    
+    <extra-loc-viewid>common</extra-loc-viewid>
+    <extra-loc-positionid>button</extra-loc-positionid>
+    <extra-loc-feature>co</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_dpophead_wrong_lock_code">
+    <comment>Notification dialog for wrong lock code primary text</comment>        
+    <source>Wrong lock code</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_notifdialog_pri_medium_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_08</extra-loc-viewid>
+    <extra-loc-positionid>dpophead</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_subhead_remote_locking">
+    <comment>Label in Device Locking view of Control Panel</comment>        
+    <source>Remote locking</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dataform_pri</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_04</extra-loc-viewid>
+    <extra-loc-positionid>subhead</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_info_characters_cannot_be_rep_no">
+    <comment>Error note when creating new lock code</comment>        
+    <source>Characters cannot be repeated more than %L1 times</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_pri5_large_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_21</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_remotelocking_button_sim_changed_on">
+    <comment>Button label for Lock when SIM changed button</comment>        
+    <source>On</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_04</extra-loc-viewid>
+    <extra-loc-positionid>button</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_dpophead_lock_code_created">
+    <comment>NotificationDialog shown when lock code is created successfully</comment>        
+    <source>Lock code created</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_notifdialog_pri_medium_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_10</extra-loc-viewid>
+    <extra-loc-positionid>dpophead</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_info_the_security_code_must_be_a">
+    <comment>Error note when creating new lock code</comment>        
+    <source>The security code must be alphanumeric</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_pri5_large_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_21</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_info_code_must_contain_at_least">
+    <comment>Error note when creating new lock code</comment>        
+    <source>Code must contain at least %L1 special characters</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_pri5_large_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_21</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_button_remote_on">
+    <comment>Button label for enabled remote locking</comment>        
+    <source>On</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_04</extra-loc-viewid>
+    <extra-loc-positionid>button</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_info_incorrect_lock_code_one_at">
+    <comment>Error message shown when giving the wrong code too many times</comment>        
+    <source>Incorrect lock code. One attempt left before data is erased.</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_pri5_large_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_23</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_button_on">
+    <comment>Button text for activated device locking</comment>        
+    <source>On</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_04</extra-loc-viewid>
+    <extra-loc-positionid>button</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_info_must_be_at_least_l1_charac">
+    <comment>Error note when creating new lock code</comment>        
+    <source>Must be at least %L1 characters</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_pri5_large_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_21</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_formlabel_lock_code">
+    <comment>Label for lock code field</comment>        
+    <source>Lock code</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dataform_heading_pri</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_04</extra-loc-viewid>
+    <extra-loc-positionid>formlabel_2</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_setlabel_val_60_minutes">
+    <comment>Value for combobox in device locking</comment>        
+    <source>60 minutes</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dataform_heading_combobox_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_04</extra-loc-viewid>
+    <extra-loc-positionid>setlabel_4_val</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_button_off">
+    <comment>Label for disabled device locking in Control Panel</comment>        
+    <source>Off</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_04</extra-loc-viewid>
+    <extra-loc-positionid>button</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_info_more_than_two_consecutive_n">
+    <comment>Error note when creating new lock code</comment>        
+    <source>More than two consecutive numbers not allowed</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_pri5_large_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_21</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_info_lock_code_is_expired">
+    <comment>Message Box shown when lock code expires</comment>        
+    <source>Lock code is expired.</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_pri5_large_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_24</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_button_create_lock_code">
+    <comment>Create locking code button in Control Panel</comment>        
+    <source>Create lock code</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_01</extra-loc-viewid>
+    <extra-loc-positionid>button</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_dpophead_codes_do_not_match">
+    <comment></comment>        
+    <source>Codes do not match</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_notifdialog_pri_medium_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_09</extra-loc-viewid>
+    <extra-loc-positionid>dpophead</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_dpophead_lock_code_is_blocked">
+    <comment>Notification text for blocked lock code query. Timed blocking starts from 5 minutes.</comment>        
+    <source>Lock code is blocked</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_notifdialog_pri2</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_15</extra-loc-viewid>
+    <extra-loc-positionid>dpophead</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_setlabel_val_when_keys_screen">
+    <comment>ComboBox value for device locking</comment>        
+    <source>When keys &amp; screen locked</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dataform_heading_combobox_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_04</extra-loc-viewid>
+    <extra-loc-positionid>setlabel_1_val</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_button_sim_changed_off">
+    <comment>Button label for Lock when SIM changed button</comment>        
+    <source>Off</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_04</extra-loc-viewid>
+    <extra-loc-positionid>button</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_dialog_retype_new_lock_code">
+    <comment>Label for verifying new lock code query</comment>        
+    <source>Retype new lock code</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_07</extra-loc-viewid>
+    <extra-loc-positionid>dialog</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_formlabel_lock_when_sim_changed">
+    <comment>Label for lock if SIM changed field</comment>        
+    <source>Lock when SIM changed</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dataform_heading_pri</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_04</extra-loc-viewid>
+    <extra-loc-positionid>formlabel_4</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_setlabel_val_5_minutes">
+    <comment>Combobox value for device locking</comment>        
+    <source>5 minutes</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dataform_heading_combobox_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_04</extra-loc-viewid>
+    <extra-loc-positionid>setlabel_2_val</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_info_code_must_not_contain_conse">
+    <comment>Error note when creating new lock code</comment>        
+    <source>Code must not contain consecutive characters</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_pri5_large_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_21</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_info_must_include_letters_and_nu">
+    <comment>Error note when creating new lock code</comment>        
+    <source>Must include letters and numbers</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_pri5_large_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_21</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_formlabel_device_locking">
+    <comment>Label for Device Locking button</comment>        
+    <source>Device locking</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dataform_heading_pri</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_04</extra-loc-viewid>
+    <extra-loc-positionid>formlabel_1</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_info_the_locking_message_and_the">
+    <comment>Error note for creating locking message</comment>        
+    <source>The locking message and the lock code should not be equal</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_pri5</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_18</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_info_cannot_contain_more_than_l">
+    <comment>Error note when creating new lock code</comment>        
+    <source>Cannot contain more than %L1 characters</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_pri5_large_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_21</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_button_remote_off">
+    <comment>Button label for disabled remote locking button</comment>        
+    <source>Off</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_04</extra-loc-viewid>
+    <extra-loc-positionid>button</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_devicelocking_info_code_must_not_contain_singl">
+    <comment>Error note when creating new lock code</comment>        
+    <source>Code must not contain single repeated character</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_pri5_large_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>devicelocking_21</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>de</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_common_button_ok">
+    <comment></comment>        
+    <source>OK</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id></extra-loc-layout_id>    
+    <extra-loc-viewid>common</extra-loc-viewid>
+    <extra-loc-positionid>button</extra-loc-positionid>
+    <extra-loc-feature>co</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+</context>
+</TS>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/devicelockplugin/devicelockplugin.pri	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,24 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: cpdevicelockplugin source files
+#
+
+# Input
+HEADERS += src/*.h
+SOURCES += src/*.cpp
+
+INCLUDEPATH += ../../seccodeui/src \
+			   ../../seccodeui/inc \
+			  
+	   
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/devicelockplugin/devicelockplugin.pro	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,44 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+TEMPLATE = lib
+TARGET = devicelockplugin
+
+CONFIG += hb plugin		  
+
+LIBS +=  -lsecuinotificationdialogplugin \
+		 -llockclient \
+		 -lautolockuseractivityservice \
+		 -lIndicatorAutolockPlugin \
+		 -lsecui \
+		 -letelmm \
+		 -letel \
+		 -lcustomapi \
+		 -lrlocksettings \
+		 -lcentralrepository \
+		 -lRLockSettings \
+		 -lflogger
+TRANSLATIONS += devicelocking.ts
+include ( ../cpplugincommon.pri )
+include ( devicelockplugin.pri )
+include ( rom/devicelockplugin_rom.pri )
+
+symbian { 
+    TARGET.UID3 = 0X2002E683
+    
+    INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+    
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/devicelockplugin/devicelockplugin_installer.pkg	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,29 @@
+; devicelockplugin_installer.pkg generated by qmake at 2010-04-27T17:12:14
+; This file is generated by qmake and should not be modified by the user
+;
+
+; Language
+&EN
+
+; SIS header: name, uid, version
+#{"devicelockplugin installer"},(0xA000D7CE),1,0,0
+
+; Localised Vendor name
+%{"Vendor"}
+
+; Unique Vendor name
+:"Vendor"
+
+
+; Manual PKG pre-rules from PRO files
+; Default HW/platform dependencies
+[0x101F7961],0,0,0,{"S60ProductID"}
+[0x102032BE],0,0,0,{"S60ProductID"}
+[0x102752AE],0,0,0,{"S60ProductID"}
+[0x1028315F],0,0,0,{"S60ProductID"}
+ 
+; Default dependency to Qt libraries
+
+
+"M:/sf/app/settingsuis/controlpanelui/src/cpplugins/devicelockplugin/devicelockplugin.sis" - "c:\adm\devicelockplugin.sis"
+@"M:/sf/mw/qt/smartinstaller.sis",(0x2002CCCD)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/devicelockplugin/qmakepluginstubs/devicelockplugin.qtplugin	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,1 @@
+This file is a Qt plugin stub file. The real Qt plugin is located in /sys/bin. Created:2010-04-28T08:30:55
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/devicelockplugin/rom/devicelockplugin.iby	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,24 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef __DEVICELOCKPLUGIN_IBY__
+#define __DEVICELOCKPLUGIN_IBY__
+
+file=ABI_DIR\BUILD_DIR\devicelockplugin.dll    SHARED_LIB_DIR\devicelockplugin.dll
+data=\epoc32\data\c\resource\qt\plugins\controlpanel\devicelockplugin.qtplugin resource\qt\plugins\controlpanel\devicelockplugin.qtplugin
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/devicelockplugin/rom/devicelockplugin_resources.iby	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef __DEVICELOCKPLUGIN_RESOURCES_IBY__
+#define __DEVICELOCKPLUGIN_RESOURCES_IBY__
+
+#include <bldvariant.hrh>
+#include <data_caging_paths_for_iby.hrh>
+
+// devicelockplugin is old.
+// data=DATAZ_\QT_TRANSLATIONS_DIR\devicelockplugin.qm QT_TRANSLATIONS_DIR\devicelockplugin.qm 
+data=DATAZ_\QT_TRANSLATIONS_DIR\devicelocking.qm QT_TRANSLATIONS_DIR\devicelocking.qm 
+
+#endif	// __DEVICELOCKPLUGIN_RESOURCES_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/devicelockplugin/rom/devicelockplugin_rom.pri	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,22 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+symbian {
+	BLD_INF_RULES.prj_exports += \
+		"$${LITERAL_HASH}include<platform_paths.hrh>" \
+		"rom/devicelockplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(devicelockplugin.iby)" \
+		"rom/devicelockplugin_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(devicelockplugin_resources.iby)"
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/devicelockplugin/secuidevicelockplugin_installer.pkg	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,29 @@
+; secuidevicelockplugin_installer.pkg generated by qmake at 2010-04-26T15:36:02
+; This file is generated by qmake and should not be modified by the user
+;
+
+; Language
+&EN
+
+; SIS header: name, uid, version
+#{"secuidevicelockplugin installer"},(0xA000D7CE),1,0,0
+
+; Localised Vendor name
+%{"Vendor"}
+
+; Unique Vendor name
+:"Vendor"
+
+
+; Manual PKG pre-rules from PRO files
+; Default HW/platform dependencies
+[0x101F7961],0,0,0,{"S60ProductID"}
+[0x102032BE],0,0,0,{"S60ProductID"}
+[0x102752AE],0,0,0,{"S60ProductID"}
+[0x1028315F],0,0,0,{"S60ProductID"}
+ 
+; Default dependency to Qt libraries
+
+
+"M:/sf/app/settingsuis/controlpanelui/src/cpplugins/devicelockplugin/secuidevicelockplugin.sis" - "c:\adm\secuidevicelockplugin.sis"
+@"M:/sf/mw/qt/smartinstaller.sis",(0x2002CCCD)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/devicelockplugin/src/cpdevicelockplugin.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *
+ */
+#include "cpdevicelockplugin.h"
+#include "cpdevicelockpluginview.h"
+#include <cpsettingformentryitemdataimpl.h>
+#include <../../inc/cpsecplugins.h>
+
+
+/*
+ *****************************************************************
+ * Name        : CpDeviceLockPlugin
+ * Parameters  : None
+ * Return value: None
+ * Description : constructor
+ *****************************************************************
+ */
+CpDeviceLockPlugin::CpDeviceLockPlugin()
+{
+	RDEBUG("0", 0);
+}
+
+
+/*
+ *****************************************************************
+ * Name        : ~CpDeviceLockPlugin
+ * Parameters  : None
+ * Return value: None
+ * Description : destructor
+ *****************************************************************
+ */
+CpDeviceLockPlugin::~CpDeviceLockPlugin()
+{
+}
+
+
+/*
+ *****************************************************************
+ * Name        : createSettingFormItemData
+ * Parameters  : CpItemDataHelper
+ * Return value: QLsit<CpSettingFormItemData>*
+ * Description : creates a data form for device lock settings
+ *****************************************************************
+ */
+QList<CpSettingFormItemData*> CpDeviceLockPlugin::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const
+{
+		RDEBUG("0", 0);
+		RDEBUG("using icon", 1);
+    return QList<CpSettingFormItemData*>() 
+           << new CpSettingFormEntryItemDataImpl<CpDeviceLockPluginView>(
+           itemDataHelper,
+           tr("Device lock"),	// text
+           QString(),					// description
+           HbIcon(QString("qtg_large_device_lock"))	// icon
+           );
+}
+
+Q_EXPORT_PLUGIN2(cpdevicelockplugin, CpDeviceLockPlugin);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/devicelockplugin/src/cpdevicelockplugin.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *
+ */
+
+#ifndef CPDEVICELOCKPLUGIN_H
+#define CPDEVICELOCKPLUGIN_H
+
+#include <QObject>
+#include <cpplugininterface.h>
+
+class CpDeviceLockPlugin : public QObject, public CpPluginInterface
+{
+	Q_OBJECT
+    Q_INTERFACES(CpPluginInterface)
+public:
+	/* construtor */
+    CpDeviceLockPlugin();
+    /* destructor */
+    virtual ~CpDeviceLockPlugin();
+    /* creates a data form item for device lock settings */
+    virtual QList<CpSettingFormItemData*> createSettingFormItemData(CpItemDataHelper &itemDataHelper) const;
+};
+
+#endif //CPDEVICELOCKPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/devicelockplugin/src/cpdevicelockpluginview.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,647 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *
+ */
+
+#include "cpdevicelockpluginview.h"
+#include <QStringList>
+#include <hblineedit.h>
+#include <hbdataform.h>
+#include <hbdataformmodel.h>
+#include <hbdataformmodelitem.h>
+#include "cpremotelockdataformviewitem.h"
+#include <hblabel.h>
+#include <hbpushbutton.h>
+#include <HbMessageBox>
+#include <hbdataform.h>
+#include <QGraphicsLinearLayout>
+#include <secuisecuritysettings.h>
+#include <secuisecurityhandler.h>
+#include <etelmm.h>
+#include <rmmcustomapi.h>
+#include <hbinputdialog.h>
+#include <secui.h>
+#include <RemoteLockSettings.h>
+#include <e32cmn.h>
+#include <centralrepository.h>
+#include <settingsinternalcrkeys.h>
+#include <hbcombobox.h>
+#include<hbaction.h>
+#include <RemoteLockSettings.h>
+#include "debug.h"
+#include <qapplication.h>
+#include <qtranslator.h>
+#include <../../inc/cpsecplugins.h>
+
+   
+        
+/*
+ *****************************************************************
+ * Name        : CpDeviceLockPluginView()
+ * Parameters  : QGraphicsItem*
+ * Return value: None
+ * Description : constructor
+ *****************************************************************
+ */
+CpDeviceLockPluginView::CpDeviceLockPluginView(QGraphicsItem *parent /*= 0*/)
+: CpBaseSettingView(0,parent)
+    {
+    QTranslator *translator = new QTranslator();
+    QString lang = QLocale::system().name();
+    QString path = "Z:/resource/qt/translations/";
+    bool fine = translator->load("devicelocking_en.qm", path);
+    if (fine)
+        qApp->installTranslator(translator);
+
+    QTranslator *commontranslator = new QTranslator();
+
+    fine = commontranslator->load("common_" + lang, path);
+    if (fine)
+        qApp->installTranslator(commontranslator);
+
+    TSecUi::InitializeLibL();
+    mUiSecuSettings = CSecuritySettings::NewL();
+    mRemoteLockSettings = CRemoteLockSettings::NewL();
+    iALPeriodRep = CRepository::NewL(KCRUidSecuritySettings);
+
+    mRemoteLockSettingClicked = false;
+    mHack = 0;
+    HbDataForm *form = qobject_cast<HbDataForm*> (widget());
+    if (form)
+        {
+        QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(
+                Qt::Vertical);
+        QList<HbAbstractViewItem *> protoTypeList = form->itemPrototypes();
+        protoTypeList.append(new CpRemoteLockDataFormViewItem());
+        form->setItemPrototypes(protoTypeList);
+        form->setHeading(hbTrId("txt_cp_dblist_device_lock"));
+
+        //DataFormModel
+        formModel = new HbDataFormModel();
+
+        //lockcode
+        HbDataFormModelItem
+                *lockCodeItem =
+                        new HbDataFormModelItem(
+                                static_cast<HbDataFormModelItem::DataItemType> (CpRemoteLockDataFormViewItem::CpCodeEditItem),
+                                hbTrId("txt_devicelocking_dialog_lock_code"));
+        lockCodeItem->setContentWidgetData("echomode", HbLineEdit::Password);
+        lockCodeItem->setContentWidgetData("text", "1234");
+        lockCodeItem->setContentWidgetData("readonly", true);
+        form->addConnection(lockCodeItem, SIGNAL(clicked()), this,
+                SLOT(onLockCodeClicked()));
+        formModel->appendDataFormItem(lockCodeItem);
+
+        //Autolock period
+        mAutolockPeriodItem = new HbDataFormModelItem(
+                HbDataFormModelItem::ComboBoxItem, hbTrId(
+                        "txt_devicelocking_formlabel_automatic_locking"));
+        TInt autoLockVal;
+        TInt err = iALPeriodRep->Get(KSettingsAutoLockTime, autoLockVal);
+        TInt index = GetAutoLockIndex(autoLockVal);
+        Dprint((_L("Current AL period value %d"),autoLockVal));
+        RDEBUG("err", err);
+        RDEBUG("index", index);
+        RDEBUG("autoLockVal", autoLockVal);
+        //TODO: need to set autoLockVal in editor
+        QStringList autolockPeriodList;
+        autolockPeriodList << hbTrId("txt_devicelocking_button_off")
+                << hbTrId("txt_devicelocking_setlabel_val_when_keys_screen")
+                << hbTrId("txt_devicelocking_setlabel_val_5_minutes")
+                << hbTrId("txt_devicelocking_setlabel_val_30_minutes")
+                << hbTrId("txt_devicelocking_setlabel_val_60_minutes");
+        mAutolockPeriodItem->setContentWidgetData(QString("items"),
+                autolockPeriodList);
+        mAutolockPeriodItem->setContentWidgetData(QString("currentIndex"),
+                index);
+        mAutolockPeriodItem->setContentWidgetData(QString("editable"), true);
+        QVariant themeComboData = mAutolockPeriodItem->contentWidgetData(
+                QString("currentIndex"));
+        mThemeComboPrevIndex = themeComboData.toInt();
+
+        form->addConnection(mAutolockPeriodItem,
+                SIGNAL(currentIndexChanged(int)), this,
+                SLOT(onAutoLockChanged(int)));
+        //form->addConnection(mAutolockPeriodItem,SIGNAL(editTextChanged(const QString&)), this, SLOT(onAutoTextChanged(const QString&)));
+        formModel->appendDataFormItem(mAutolockPeriodItem);
+
+        //LockWhenSimChange
+        mLockWhenSimChangeItem = new HbDataFormModelItem(
+                HbDataFormModelItem::ToggleValueItem, hbTrId(
+                        "txt_devicelocking_formlabel_lock_when_sim_changed"));
+        TBool lockVal = mUiSecuSettings->IsLockEnabledL(
+                RMobilePhone::ELockPhoneToICC);
+        Dprint((_L("LockWhenSimChange enabled %d"),lockVal));
+        RDEBUG("lockVal", lockVal);
+        if (lockVal)
+            {
+            mLockWhenSimChangeItem->setContentWidgetData("text", hbTrId(
+                    "txt_remotelocking_button_sim_changed_on"));
+            mLockWhenSimChangeItem->setContentWidgetData("additionalText",
+                    hbTrId("txt_devicelocking_button_sim_changed_off"));
+            }
+        else
+            {
+            mLockWhenSimChangeItem->setContentWidgetData("text", hbTrId(
+                    "txt_devicelocking_button_sim_changed_off"));
+            mLockWhenSimChangeItem->setContentWidgetData("additionalText",
+                    hbTrId("txt_remotelocking_button_sim_changed_on"));
+            }
+        mLockWhenSimChangeItem->setContentWidgetData("readonly", true);
+        mPrevSIMLockData = mLockWhenSimChangeItem->contentWidgetData(QString(
+                "text"));
+
+        connect(formModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)),
+                this, SLOT(onSIMLockDataChanged(QModelIndex,QModelIndex)));
+        formModel->appendDataFormItem(mLockWhenSimChangeItem);
+
+        //Remote Lock Setting
+        TBool enabled = true;
+        TBool val = mRemoteLockSettings->GetEnabled(enabled);
+        Dprint((_L("Remote Lock Setting enabled %d"),val));
+        RDEBUG("val", val);
+        mDeviceRemoteLockItem = new HbDataFormModelItem(
+                HbDataFormModelItem::ToggleValueItem, hbTrId(
+                        "txt_devicelocking_subhead_remote_locking"));
+
+        if (val && enabled)
+            {
+            mDeviceRemoteLockItem->setContentWidgetData("text", hbTrId(
+                    "txt_devicelocking_button_remote_on"));
+            mDeviceRemoteLockItem->setContentWidgetData("additionalText",
+                    hbTrId("txt_devicelocking_button_remote_off"));
+            }
+        else
+            {
+            mDeviceRemoteLockItem->setContentWidgetData("text", hbTrId(
+                    "txt_devicelocking_button_remote_off"));
+            mDeviceRemoteLockItem->setContentWidgetData("additionalText",
+                    hbTrId("txt_devicelocking_button_remote_on"));
+            }
+
+        mPrevRemLockData = mDeviceRemoteLockItem->contentWidgetData(QString(
+                "text"));
+        QString s = mPrevRemLockData.toString();
+        connect(formModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)),
+                this, SLOT(onRemoteLockDataChanged(QModelIndex,QModelIndex)));
+        formModel->appendDataFormItem(mDeviceRemoteLockItem);
+
+        //Remote lock message
+        mRemoteLockMessageItem
+                = new HbDataFormModelItem(
+                        static_cast<HbDataFormModelItem::DataItemType> (CpRemoteLockDataFormViewItem::CpCodeEditItem),
+                        hbTrId("txt_devicelocking_formlabel_locking_message"));
+        mRemoteLockMessageItem->setContentWidgetData("echoMode",
+                HbLineEdit::Password);
+        mRemoteLockMessageItem->setContentWidgetData("text", "1111");
+        mRemoteLockMessageItem->setContentWidgetData("readOnly", true);
+
+        if (mPrevRemLockData.toString() == hbTrId(
+                "txt_devicelocking_button_remote_on"))
+            mRemoteLockMessageItem->setEnabled(true);
+        else
+            mRemoteLockMessageItem->setEnabled(false);
+
+        form->addConnection(mRemoteLockMessageItem, SIGNAL(clicked()), this,
+                SLOT(onLockMessageClicked()));
+        formModel->appendDataFormItem(mRemoteLockMessageItem);
+
+        form->setModel(formModel);
+        layout->addItem(form);
+        setLayout(layout);
+        }
+    }
+
+
+/*
+ *****************************************************************
+ * Name        : ~CpDeviceLockPluginView()
+ * Parameters  : None
+ * Return value: None
+ * Description : destructor
+ *****************************************************************
+ */
+CpDeviceLockPluginView::~CpDeviceLockPluginView()
+    {
+    TSecUi::UnInitializeLib();
+}
+
+
+/*
+ *****************************************************************
+ * Name        : onLockCodeClicked()
+ * Parameters  : None
+ * Return value: None
+ * Description : Enables user to change the lock code
+ *****************************************************************
+ */
+void CpDeviceLockPluginView::onLockCodeClicked()
+    {
+    Dprint(_L("CpDeviceLockPluginView::onLockCodeClicked()..Enter"));
+    RDEBUG("0", 0);
+    mUiSecuSettings->ChangeSecCodeL();
+    Dprint(_L("CpDeviceLockPluginView::onLockCodeClicked()..Exit"));
+}
+
+
+/*
+ ************************************************************************
+ * Name        : onAutoLockChanged()
+ * Parameters  : int
+ * Return value: None
+ * Description : handles the data when automatic lock timings are changed
+ ************************************************************************
+ */
+void CpDeviceLockPluginView::onAutoLockChanged(int index)
+    {
+    Dprint(_L("CpDeviceLockPluginView::onAutoLockChanged()..Enter"));
+    RDEBUG("index", index);
+    if (index != mThemeComboPrevIndex)
+        {
+        //TODO: need to set user entered/selected value
+        TInt lockValue = GetValueAtIndex(index);
+        TInt newAutoLockVal = mUiSecuSettings->ChangeAutoLockPeriodL(
+                lockValue);
+        RDEBUG("newAutoLockVal", newAutoLockVal);
+        RDEBUG("lockValue", lockValue);
+        if (newAutoLockVal == lockValue)
+            {
+            Dprint(_L("onAutoLockChanged().AL setting success !!"));
+            RDEBUG("success", 1);
+            TInt err = iALPeriodRep->Set(KSettingsAutoLockTime, lockValue);
+            RDEBUG("err", err);
+            mThemeComboPrevIndex = index;
+            }
+        else
+            {
+            Dprint(_L("onAutoLockChanged()..Setting to previous value"));
+            RDEBUG("previous", 0);
+            QVariant data(mThemeComboPrevIndex);
+            mAutolockPeriodItem->setContentWidgetData(
+                    QString("currentIndex"), data);
+            }
+
+        }
+    Dprint(_L("CpDeviceLockPluginView::onAutoLockChanged()..Exit"));
+    RDEBUG("0", 0);
+}
+
+
+/*
+ *************************************************************************
+ * Name        : onLockMessageClicked()
+ * Parameters  : None
+ * Return value: None
+ * Description : verifies security code and enables user to change the lock 
+ *               message
+ **************************************************************************
+ */
+void CpDeviceLockPluginView::onLockMessageClicked()
+    {
+    Dprint(_L("CpDeviceLockPluginView::onLockMessageClicked()..Exit"));
+    RDEBUG("0", 0);
+    TBuf<KRLockMaxLockCodeLength> remoteLockCode;
+    TBool remoteLockStatus(EFalse);
+    TInt retVal = KErrNone;
+    TInt autoLockVal = -1;
+    retVal = mUiSecuSettings->ChangeRemoteLockStatusL(remoteLockStatus,
+            remoteLockCode, autoLockVal);
+    RDEBUG("retVal", retVal);
+    RDEBUG("autoLockVal", autoLockVal);
+    RDEBUG("remoteLockStatus", remoteLockStatus);
+    if (retVal)
+        {
+        Dprint(_L("CpDeviceLockPluginView::onLockMessageClicked()..ChangeRemoteLockStatusL sucess"));
+        RDEBUG("sucess", 1);
+        }
+    else
+        {
+        Dprint(_L("CpDeviceLockPluginView::onLockMessageClicked()..ChangeRemoteLockStatusL failed"));
+        RDEBUG("failed", 0);
+        }
+    Dprint(_L("CpDeviceLockPluginView::onLockMessageClicked()..Exit"));
+    RDEBUG("0", 0);
+}
+
+
+/*
+ *************************************************************************
+ * Name        : onAutoTextChanged()
+ * Parameters  : QString&
+ * Return value: None
+ * Description :  
+  **************************************************************************
+ */
+/*
+ *This slot can be enabled once fix from obit team for this siganl is available 
+ */
+
+#if 0
+void CpDeviceLockPluginView::onAutoTextChanged(const QString& aText)
+    {
+    Dprint(_L("CpDeviceLockPluginView::onAutoTextChanged()..Enter"));
+    RDEBUG("0", 0);
+    //TBool ret = DisplaySecurityDialog(); 
+    Dprint(_L("CpDeviceLockPluginView::onAutoTextChanged()..Exit"));
+    RDEBUG("0", 0);
+    }
+#endif
+
+/*
+ *************************************************************************
+ * Name        : onRemoteLockDataChanged()
+ * Parameters  : QModelIndex
+ * Return value: None
+ * Description : handles the data when remote lock settings is changed
+ **************************************************************************
+ */
+void CpDeviceLockPluginView::onRemoteLockDataChanged(QModelIndex aStartIn,QModelIndex aEndIn)
+    {
+    Q_UNUSED(aEndIn);
+    Dprint(_L("CpDeviceLockPluginView::onRemoteLockDataChanged..Enter"));
+    RDEBUG("0", 0);
+    HbDataFormModelItem *item = formModel->itemFromIndex(aStartIn);
+
+    if ((item->type() == HbDataFormModelItem::ToggleValueItem)
+            && (item->data(HbDataFormModelItem::LabelRole).toString()
+                    == hbTrId("txt_devicelocking_subhead_remote_locking")))
+        {
+				RDEBUG("mHack", mHack);
+        //The following If-Else condition should be removed once orbit team fix the issue with datachanged() signal
+        /****************************************************************************************************************
+        if ((mHack % 2) == 0) //need to capture second datachanged() signal , not first one.
+            {
+            mHack++;
+            return;
+            }
+        else
+            {
+            mHack++;
+            }
+        /****************************************************************************************************************/
+        TInt autoLockVal;
+        TInt retVal = KErrNone;
+        TBuf<KRLockMaxLockCodeLength> remoteLockCode;
+        TBool remoteLockStatus(EFalse);
+        CRemoteLockSettings *remoteLockSetting = CRemoteLockSettings::NewL();
+        TInt err = iALPeriodRep->Get(KSettingsAutoLockTime, autoLockVal);
+        RDEBUG("err", err);
+        RDEBUG("autoLockVal", autoLockVal);
+        RDEBUG("retVal", retVal);
+        QVariant remLockData = mDeviceRemoteLockItem->contentWidgetData(
+                QString("text"));
+        if (remLockData.toString() == hbTrId(
+                "txt_devicelocking_button_remote_on"))
+            {
+            remoteLockStatus = ETrue;
+            retVal = mUiSecuSettings->ChangeRemoteLockStatusL(
+                    remoteLockStatus, remoteLockCode, autoLockVal);
+            }
+        else
+            {
+            remoteLockStatus = EFalse;
+            retVal = mUiSecuSettings->ChangeRemoteLockStatusL(
+                    remoteLockStatus, remoteLockCode, autoLockVal);
+            }
+        RDEBUG("retVal", retVal);
+        if (retVal == KErrNone)
+            {
+            RDEBUG("remoteLockStatus", remoteLockStatus);
+            if (remoteLockStatus)
+                {
+                if (remoteLockSetting->SetEnabledL(remoteLockCode))
+                    {
+                    Dprint(_L("CpDeviceLockPluginView::onRemoteLockDataChanged..remoteLockSetting->SetEnabledL success"));
+                    RDEBUG("success", 1);
+                    mPrevRemLockData
+                            = mDeviceRemoteLockItem->contentWidgetData(
+                                    QString("text"));
+                    }
+                else
+                    {
+                    RollbackRemoteLockSettingState();
+                    Dprint(_L("CpDeviceLockPluginView::onRemoteLockDataChanged..remoteLockSetting->SetEnabledL failed"));
+                    RDEBUG("failed", 0);
+                    }
+                }
+            else
+                {
+                if (mRemoteLockSettings->SetDisabled())
+                    {
+                    Dprint(_L("CpDeviceLockPluginView::onRemoteLockDataChanged..remoteLockSetting->SetDisabled success"));
+                    RDEBUG("success", 1);
+                    mPrevRemLockData
+                            = mDeviceRemoteLockItem->contentWidgetData(
+                                    QString("text"));
+                    }
+                else
+                    {
+                    RollbackRemoteLockSettingState();
+                    Dprint(_L("CpDeviceLockPluginView::onRemoteLockDataChanged..remoteLockSetting->SetDisabled failed"));
+                    RDEBUG("failed", 0);
+                    }
+                }
+            }
+        else
+            {
+            Dprint(_L("CpDeviceLockPluginView::onRemoteLockDataChanged..RollbackRemoteLockSettingState"));
+            RDEBUG("Rollback", 0);
+            RollbackRemoteLockSettingState();
+            }
+        delete remoteLockSetting;
+        }
+    Dprint(_L("CpDeviceLockPluginView::onRemoteLockDataChanged..Exit"));
+    RDEBUG("0", 0);
+}
+
+
+/*
+ *************************************************************************
+ * Name        : onSIMLockDataChanged()
+ * Parameters  : QModelIndex
+ * Return value: None
+ * Description : handles the data afer Lock when SIM changed settings is 
+ *               changed
+ **************************************************************************
+ */
+void CpDeviceLockPluginView::onSIMLockDataChanged(QModelIndex aStartIn, QModelIndex aEndIn)
+    {
+    Q_UNUSED(aEndIn);
+    HbDataFormModelItem *item = formModel->itemFromIndex(aStartIn);
+
+    if ((item->type() == HbDataFormModelItem::ToggleValueItem)
+            && (item->data(HbDataFormModelItem::LabelRole).toString()
+                    == hbTrId(
+                            "txt_devicelocking_formlabel_lock_when_sim_changed")))
+        {
+        RDEBUG("mHack", mHack);
+        //The following If-Else condition should be removed once orbit team fix the issue with datachanged() signal
+        /****************************************************************************************************************/
+        if ((mHack % 2) == 0) //need to capture second datachanged() signal , not first one.
+            {
+            mHack++;
+            return;
+            }
+        else
+            {
+            mHack++;
+            }
+        /****************************************************************************************************************/
+
+        TBool ret = mUiSecuSettings->ChangeSimSecurityL();
+        RDEBUG("ret", ret);
+        if (!ret)
+            {
+            /* 
+             * disconnect to datachanged() signal as we are not interested in this signal
+             * generated as a part of setContentWidgetData() API call below
+             */
+            disconnect(formModel,
+                    SIGNAL(dataChanged(QModelIndex, QModelIndex)), this,
+                    SLOT(onSIMLockDataChanged(QModelIndex,QModelIndex)));
+            QVariant txt = mLockWhenSimChangeItem->contentWidgetData(QString(
+                    "text"));
+            QVariant additionalText =
+                    mLockWhenSimChangeItem->contentWidgetData(QString(
+                            "additionalText"));
+
+            mLockWhenSimChangeItem->setContentWidgetData(QString("text"),
+                    additionalText);
+            mLockWhenSimChangeItem->setContentWidgetData(QString(
+                    "additionalText"), txt);
+            /*
+             * Now connect back to datachanged() signal .
+             */
+            connect(formModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)),
+                    this, SLOT(onSIMLockDataChanged(QModelIndex,QModelIndex)));
+            }
+        }
+}
+
+
+/*
+ *************************************************************************
+ * Name        : GetAutoLockIndex()
+ * Parameters  : TInt
+ * Return value: TInt
+ * Description : returns corresponding index for the given autolock value
+ **************************************************************************
+ */
+TInt CpDeviceLockPluginView::GetAutoLockIndex(TInt aValue)
+    {
+    TInt index = 0;
+    RDEBUG("ret", aValue);
+    switch (aValue)
+        {
+        case 0:
+            index = 0;
+            break;
+        case 65535:
+            index = 1;
+            break;
+        case 5:
+            index = 2;
+            break;
+        case 30:
+            index = 3;
+            break;
+        case 60:
+            index = 4;
+            break;
+        default:
+            break;
+        }
+		RDEBUG("index", index);
+    return index;
+    }
+
+
+/*
+ *************************************************************************
+ * Name        : GetValueAtIndex()
+ * Parameters  : TInt
+ * Return value: TInt
+ * Description : returns the corresponding autolock value for the given 
+ *               index.
+ **************************************************************************
+ */
+TInt CpDeviceLockPluginView::GetValueAtIndex(TInt aIndex)
+    {
+    TInt value = 0;
+		RDEBUG("aIndex", aIndex);
+    switch (aIndex)
+        {
+        case 0:
+            value = 0;
+            break;
+        case 1:
+            value = 65535;
+            break;
+        case 2:
+            value = 5;
+            break;
+        case 3:
+            value = 30;
+            break;
+        case 4:
+            value = 60;
+            break;
+        default:
+            break;
+        }
+		RDEBUG("value", value);
+    return value;
+}
+
+
+/*
+ *************************************************************************
+ * Name        : RollbackRemoteLockSettingState()
+ * Parameters  : None
+ * Return value: None
+ * Description : If Remote Lock Settings fails or user cancels the settings
+ *               then this function resets to previous value.
+ **************************************************************************
+ */
+void CpDeviceLockPluginView::RollbackRemoteLockSettingState()
+    {
+    RDEBUG("0", 0);
+    /* 
+     * disconnect to datachanged() signal as we are not interested in this signal
+     * generated as a part of setContentWidgetData() API call below
+     */
+    disconnect(formModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)),
+            this, SLOT(onRemoteLockDataChanged(QModelIndex,QModelIndex)));
+
+    QVariant txt = mDeviceRemoteLockItem->contentWidgetData(QString("text"));
+    QVariant additionaltxt = mDeviceRemoteLockItem->contentWidgetData(
+            QString("additionalText"));
+    mDeviceRemoteLockItem->setContentWidgetData(QString("text"),
+            additionaltxt);
+    mDeviceRemoteLockItem->setContentWidgetData(QString("additionalText"),
+            txt);
+    /*
+     * Now connect back to datachanged() signal .
+     */
+    connect(formModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this,
+            SLOT(onRemoteLockDataChanged(QModelIndex,QModelIndex)));
+
+    if (mPrevRemLockData.toString() == hbTrId(
+            "txt_devicelocking_button_remote_on"))
+        mRemoteLockMessageItem->setEnabled(true);
+    else
+        mRemoteLockMessageItem->setEnabled(false);
+		RDEBUG("0", 0);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/devicelockplugin/src/cpdevicelockpluginview.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *
+ */
+#ifndef CPDEVICELOCKPLUGINVIEW_H
+#define CPDEVICELOCKPLUGINVIEW_H
+
+#include <cpbasesettingview.h>
+#include <hbinputdialog.h>
+
+class HbDataFormModel;
+class HbDataFormModelItem;
+class CSecurityHandler;
+class CSecuritySettings;
+class SecCodeSettings;
+class CRemoteLockSettings;
+class CRepository;
+class RMobilePhone;
+
+class CpDeviceLockPluginView : public CpBaseSettingView
+{
+    Q_OBJECT
+public:
+    explicit CpDeviceLockPluginView(QGraphicsItem *parent = 0);
+    virtual ~CpDeviceLockPluginView();
+private:
+    /* Sets the remote lock setting state to previous value */
+    void RollbackRemoteLockSettingState();
+private slots:
+    /* Displays security code dialog and enables user to change the lock code */      
+    void onLockCodeClicked();
+    /* Aske for Security code dialog when Automatic Lock timings are changed*/
+    void onAutoLockChanged(int);
+    /* Displays security Code dialog and then a Input dialog when Remote Lock 
+     * settings is clicked
+     */
+    void onLockMessageClicked();
+    /* When Automatic Lock timings text is changed.*/
+    /*
+     * This slot can be enabled once fix from obit team for this siganl is available
+     */
+   // void onAutoTextChanged(const QString& aText);
+    /* Displays Security code dialog and handles the changed value of the Remote Lock*/
+    void onRemoteLockDataChanged(QModelIndex,QModelIndex);
+    /* Displayes Security code dialog for Lock when SIM changed settings*/
+    void onSIMLockDataChanged(QModelIndex,QModelIndex);
+    /* Returns the index of automatic lock timings for the given autoLock value*/
+    TInt GetAutoLockIndex(TInt);
+    /* Returns the auto lcok value for the given automatic lock timings index*/
+    TInt GetValueAtIndex(TInt);
+private:
+    /*Handler for remote lock class*/
+    CRemoteLockSettings* mRemoteLockSettings;
+    /* Handler for Securit Settings class*/
+    CSecuritySettings *mUiSecuSettings;
+    /*Handler to Repository Class*/
+    CRepository* iALPeriodRep;
+        
+    /* Data Model for DataForm*/
+    HbDataFormModel *formModel;
+    /* Data Item for RemoteLock message*/
+    HbDataFormModelItem *mRemoteLockMessageItem;
+    /* Data Item Remote Lock*/
+    HbDataFormModelItem *mDeviceRemoteLockItem;
+    /* Data item for automatic lock timings*/
+    HbDataFormModelItem *mAutolockPeriodItem;
+    /* Data item for Lock when SIM changed settings*/
+    HbDataFormModelItem *mLockWhenSimChangeItem;
+    /* Input dalog for user to enter Lock message*/
+    HbInputDialog* ipDialog;
+    
+    /* holds Lock when SIM changed data*/
+    QVariant mPrevSIMLockData;
+    /* holds Remote Lock Value*/
+    QVariant mPrevRemLockData;
+    /* holds the previous Automatic Lock timings index*/
+    int mThemeComboPrevIndex;
+    /* holds the user defined Lock Message*/
+    QString mLockMsg;
+    /* flag set on Remote Lock data changed*/
+    TBool mRemoteLockSettingClicked;
+    /*
+     * Need to remove this variabl once fix available from orbit team
+     */
+    TInt mHack;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/devicelockplugin/src/cpremotelockdataformviewitem.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *
+ */
+
+#include "cpremotelockdataformviewitem.h"
+#include <hblabel.h>
+#include <QGraphicsSceneMouseEvent>
+#include <../../inc/cpsecplugins.h>
+
+
+/*
+ *****************************************************************
+ * Name        : CpRemoteLockDataFormViewItem
+ * Parameters  : QGraphicsItem*
+ * Return value: None
+ * Description : constructor
+ *****************************************************************
+ */
+CpRemoteLockDataFormViewItem::CpRemoteLockDataFormViewItem(QGraphicsItem *parent )
+: HbDataFormViewItem(parent)
+{
+}
+
+
+/*
+ *****************************************************************
+ * Name        : ~CpRemoteLockDataFormViewItem
+ * Parameters  : None
+ * Return value: None
+ * Description : destructor
+ *****************************************************************
+ */
+CpRemoteLockDataFormViewItem::~CpRemoteLockDataFormViewItem()
+{
+}
+
+
+/*
+ *****************************************************************
+ * Name        : createItem
+ * Parameters  : None
+ * Return value: HbAbstractViewItem*
+ * Description : creates a HbAbstractViewItem
+ *****************************************************************
+ */
+HbAbstractViewItem* CpRemoteLockDataFormViewItem::createItem()
+{
+	RDEBUG("0", 0);
+	return new CpRemoteLockDataFormViewItem(*this);
+}
+
+
+/*
+ *****************************************************************
+ * Name        : canSetModelIndex
+ * Parameters  : QModelIndex&
+ * Return value: bool
+ * Description : 
+ *****************************************************************
+ */
+bool CpRemoteLockDataFormViewItem::canSetModelIndex(const QModelIndex &index) const
+{
+	int type = index.data(HbDataFormModelItem::ItemTypeRole).toInt();
+	RDEBUG("type", type);
+	return ((type == CpRemoteLockItem) || (type == CpCodeEditItem));
+}
+
+
+/*
+ *****************************************************************
+ * Name        : createCustomWidget
+ * Parameters  : None
+ * Return value: HbWidget
+ * Description : creates a custom widget
+ *****************************************************************
+ */
+HbWidget *CpRemoteLockDataFormViewItem::createCustomWidget()
+    {
+    int type = modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt();
+    RDEBUG("type", type);
+    if (type == CpCodeEditItem)
+        {
+        CpLockEdit *edit = new CpLockEdit("1234");
+        edit->setEchoMode(HbLineEdit::Password);
+        edit->setReadOnly(true);
+        return edit;
+        }
+    else
+        {
+        return 0;
+        }
+}
+
+
+/*
+ *****************************************************************
+ * Name        : CpLockEdit
+ * Parameters  : QString&, QGraphicsitem
+ * Return value: None
+ * Description : constructor
+ *****************************************************************
+ */
+CpLockEdit::CpLockEdit(const QString &text, QGraphicsItem *parent /*= 0*/)
+: HbLineEdit(text,parent)
+{
+}
+
+
+/*
+ *****************************************************************
+ * Name        : CpLockEdit
+ * Parameters  : None
+ * Return value: None
+ * Description : destructor
+ *****************************************************************
+ */
+CpLockEdit::~CpLockEdit()
+    {
+    
+    }
+
+
+/*
+ *****************************************************************
+ * Name        : mousePressEvent
+ * Parameters  : QGraphicsSceneMouseEvent*
+ * Return value: None
+ * Description : handles mouse events
+ *****************************************************************
+ */
+void CpLockEdit::mousePressEvent(QGraphicsSceneMouseEvent *event)
+{
+		RDEBUG("0", 0);
+    if (event->button() != Qt::LeftButton) {
+        event->ignore();
+        return;
+    }
+
+    if (rect().contains(event->pos())) {
+        emit clicked();
+        event->accept();
+    }
+    else {
+        event->ignore();
+    } 
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/devicelockplugin/src/cpremotelockdataformviewitem.h	Tue Aug 31 16:04:40 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:  
+ *
+ */
+
+
+#ifndef CPREMOTELOCKDATAFORMVIEWITEM_H
+#define CPREMOTELOCKDATAFORMVIEWITEM_H
+
+//#include <seccodeuiglobal.h>
+#include <hbdataformviewitem.h>
+#include <hbdataformmodelitem.h>
+#include <hblineedit.h>
+
+class CpRemoteLockDataFormViewItem : public HbDataFormViewItem
+{
+	Q_OBJECT
+public:
+	enum { CpRemoteLockItem = HbDataFormModelItem::CustomItemBase + 10,
+           CpCodeEditItem = CpRemoteLockItem + 1 };
+
+	/* Constructor */
+    explicit CpRemoteLockDataFormViewItem(QGraphicsItem *parent = 0);
+    /* Destructor */
+    virtual ~CpRemoteLockDataFormViewItem();
+    /* creates a view item */
+    virtual HbAbstractViewItem* createItem();
+    /**/
+	virtual bool canSetModelIndex(const QModelIndex &index) const;
+protected:
+	/* creates a custom widget */
+    virtual HbWidget* createCustomWidget();
+};
+
+
+class CpLockEdit : public HbLineEdit
+{
+    Q_OBJECT
+public:
+    /* constructor */
+    explicit CpLockEdit(const QString &text, QGraphicsItem *parent = 0);
+    /* destructor */
+    virtual ~CpLockEdit();
+    /* handles mouse events*/
+    void mousePressEvent(QGraphicsSceneMouseEvent *event);
+signals:
+    /* signal when edit box is clicked*/
+    void clicked();
+};
+
+#endif //CPREMOTELOCKDATAFORMVIEWITEM_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/devicelockplugin/src/debug.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *
+ */
+
+#if defined (_DEBUG)
+
+_LIT( KLogFile, "Devicelockplugin.log" );
+_LIT( KLogDir, "Devicelockplugin" );
+
+#include <e32std.h>
+#include <f32file.h>
+#include <flogger.h>
+#include <e32svr.h>
+
+inline void FWrite (TRefByValue<const TDesC> aFmt,...)
+    {
+    VA_LIST list;
+    VA_START( list, aFmt );
+    RFileLogger::WriteFormat( KLogDir,KLogFile,EFileLoggingModeAppend ,TPtrC(aFmt) ,list );
+    }
+
+    #define Dprint(arg...)    FWrite arg;
+#else
+    #define Dprint(arg...)
+#endif  // _DEBUG
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/inc/cpsecplugins.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,30 @@
+/*
+ * 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 CPSECPLUGINS_H
+#define CPSECPLUGINS_H
+
+#include <e32debug.h>
+
+// #if defined _DEBUG
+#ifdef _DEBUG
+#define RDEBUG( x, y ) RDebug::Printf( "%s %s (%u) %s=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, x, y );
+#else
+#define RDEBUG( x, y )
+#endif
+
+#endif //CPSECPLUGINS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/simpincodeplugin/inc/cppincodeplugin.h	Tue Aug 31 16:04:40 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:  
+ *
+ */
+
+#ifndef CPPINCODEPLUGIN_H
+#define CPPINCODEPLUGIN_H
+
+// System includes
+#include <QObject>
+
+// User includes
+#include <cpplugininterface.h>
+
+// Class declaration
+class CpPinCodePlugin : public QObject, public CpPluginInterface
+{
+    Q_OBJECT
+    Q_INTERFACES(CpPluginInterface)
+    
+public:    
+    CpPinCodePlugin();
+    virtual ~CpPinCodePlugin();
+    virtual QList<CpSettingFormItemData *> createSettingFormItemData(
+        CpItemDataHelper &itemDataHelper) const;
+};
+
+#endif //CPPINCODEPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/simpincodeplugin/inc/cppincodepluginview.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *
+ */
+
+#ifndef CPPINCODEPLUGINVIEW_H
+#define CPPINCODEPLUGINVIEW_H
+
+// System includes
+#include <cpbasesettingview.h>
+
+// Forward declarations
+class SecCodeSettings;
+class HbDataFormModelItem;
+class HbDataFormModel;
+
+// Class declaration
+class CpPinCodePluginView : public CpBaseSettingView
+{
+    Q_OBJECT
+    
+public:
+    explicit CpPinCodePluginView(QGraphicsItem *parent = 0);
+    virtual ~CpPinCodePluginView();
+    
+private slots:
+    void changePinCode();
+    void changePin2Code();
+    void toggleChange(QModelIndex startIn, QModelIndex endIn);
+    
+private:
+    SecCodeSettings *mSecCodeSettings;
+    HbDataFormModel *mFormModel;
+    HbDataFormModelItem *mPinCodeRequestItem;
+};
+
+#endif  //CPPINCODEPLUGINVIEW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/simpincodeplugin/inc/seccodeedit.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#ifndef SECCODEEDIT_H
+#define SECCODEEDIT_H
+
+// System includes
+#include <hblineedit.h>
+
+// Class declaration
+class SecCodeEdit : public HbLineEdit
+{
+    Q_OBJECT
+
+public:
+    explicit SecCodeEdit(const QString &text, QGraphicsItem *parent = 0);
+    virtual ~SecCodeEdit();
+    void mousePressEvent(QGraphicsSceneMouseEvent *event);
+
+signals:
+    void clicked();
+};
+
+#endif //SECCODEEDIT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/simpincodeplugin/inc/seccodeeditdataformviewitem.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#ifndef SECCODEEDITDATAFORMVIEWITEM_H
+#define SECCODEEDITDATAFORMVIEWITEM_H
+
+// System includes
+#include <hbdataformviewitem.h>
+#include <hbdataformmodelitem.h>
+
+// User includes
+#include "seccodeuiglobal.h"
+
+// Class declaration
+class SecCodeEditDataFormViewItem : public HbDataFormViewItem
+{
+    Q_OBJECT
+
+public:
+    enum { SecCodeEditItem = HbDataFormModelItem::CustomItemBase + 1 };
+    explicit SecCodeEditDataFormViewItem(QGraphicsItem *parent = 0);
+    virtual ~SecCodeEditDataFormViewItem();
+    virtual HbAbstractViewItem* createItem();
+    virtual bool canSetModelIndex(const QModelIndex &index) const;
+
+protected:
+    virtual HbWidget* createCustomWidget();
+};
+
+#endif //SECCODEEDITDATAFORMVIEWITEM_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/simpincodeplugin/inc/seccodemodel.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#ifndef SECCODEMODEL_H
+#define SECCODEMODEL_H
+
+// System includes
+#include <QObject>
+
+// Forward declarations
+class SecCodeModelPrivate;
+
+// Class declaration
+class SecCodeModel : public QObject
+{
+    Q_OBJECT
+
+public:
+    SecCodeModel(QObject *parent = 0);
+    virtual ~SecCodeModel();
+    bool pinCodeRequest() const;
+    bool changePinCodeRequest();
+    int changePinCode();
+    int changePin2Code();
+ 
+private: // data
+    SecCodeModelPrivate *d_ptr;
+};
+
+#endif //SECCODEMODEL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/simpincodeplugin/inc/seccodemodel_p.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#ifndef SECCODEMODEL_P_H
+#define SECCODEMODEL_P_H
+
+// System includes
+#include <QObject>
+#include <secuisecuritysettings.h>
+// Class declaration
+class SecCodeModelPrivate
+{
+public:
+    static SecCodeModelPrivate* NewL();
+    SecCodeModelPrivate();
+    ~SecCodeModelPrivate();
+    bool pinCodeRequest() const;
+    bool changePinCodeRequest();
+    int changePinCode();
+    int changePin2Code();
+
+private:
+    void ConstructL();
+
+private: // data
+    //to launch SecUI
+    CSecuritySettings* iSecurity;
+};
+
+#endif //SECCODEMODEL_P_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/simpincodeplugin/inc/seccodesettings.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#ifndef SECCODESETTINGS_H
+#define SECCODESETTINGS_H
+
+// System includes
+#include <QObject>
+#include "seccodeuiglobal.h"
+
+// Forward declarations
+class SecCodeSettingsPrivate;
+
+// Class declaration
+class SecCodeSettings : public QObject
+{
+    Q_OBJECT
+    
+public:
+    explicit SecCodeSettings(QObject *parent = 0);
+    virtual ~SecCodeSettings();
+    bool pinCodeRequest() const;
+    bool changePinCodeRequest();
+    void changePinCode();
+    void changePin2Code();
+    
+private:
+    SecCodeSettingsPrivate *d_ptr;
+};
+
+#endif //SECCODESETTINGS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/simpincodeplugin/inc/seccodeuiglobal.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *
+ */
+
+#ifndef SECCODEUIGLOBAL_H
+#define SECCODEUIGLOBAL_H
+
+// System includes
+#include <QtGlobal>
+
+namespace SecCode
+{
+    enum SecCodeErr
+    {
+        ErrNone = 0,
+        ErrGsm0707IncorrectPassword,
+        ErrAccessDenied,
+        ErrGsmSSPasswordAttemptsViolation,
+        ErrLocked,
+        ErrGsm0707OperationNotAllowed,
+        ErrGsm0707SIMPuk2Required,
+        ErrAbort,
+    };
+}
+
+#endif  //SECCODEUIGLOBAL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/simpincodeplugin/pincodeplugin.pri	Tue Aug 31 16:04:40 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: cppincodeplugin source files
+#
+
+# Input
+HEADERS += inc/*.h
+
+SOURCES += src/cppincodeplugin.cpp \
+           src/cppincodepluginview.cpp \
+           src/seccodesettings.cpp \
+           src/seccodeedit.cpp \
+           src/seccodeeditdataformviewitem.cpp \
+           src/seccodemodel.cpp
+           
+symbian : {
+    SOURCES += src/seccodemodel_symbian.cpp
+}
+
+win32 : {
+    SOURCES += src/seccodemodel_win.cpp
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/simpincodeplugin/pincodeplugin.pro	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,30 @@
+#
+# 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 = cppincodeplugin
+
+CONFIG += hb plugin
+
+include ( ../cpplugincommon.pri )
+include ( pincodeplugin.pri )
+include ( rom/pincodeplugin_rom.pri )
+
+LIBS += -lsecui
+
+symbian : {
+    TARGET.UID3 = 0x2002E682
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/simpincodeplugin/rom/pincodeplugin.iby	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef __PINCODEPLUGIN_IBY__
+#define __PINCODEPLUGIN_IBY__
+
+#include <bldvariant.hrh>
+#include <data_caging_paths_for_iby.hrh>
+
+// pincodeplugin.iby should export cppincodeplugin.dll because controlpanelui.iby does NOT exports cppincodeplugin.dll
+file=ABI_DIR\BUILD_DIR\cppincodeplugin.dll    SHARED_LIB_DIR\cppincodeplugin.dll
+
+data=/epoc32/data/c/resource/qt/plugins/controlpanel/cppincodeplugin.qtplugin resource/qt/plugins/controlpanel/cppincodeplugin.qtplugin
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/simpincodeplugin/rom/pincodeplugin_rom.pri	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,21 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+symbian {
+	BLD_INF_RULES.prj_exports += \
+		"$${LITERAL_HASH}include<platform_paths.hrh>" \
+		"rom/pincodeplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(pincodeplugin.iby)"
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/simpincodeplugin/src/cppincodeplugin.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+// System includes
+#include <cpsettingformentryitemdataimpl.h>
+#include <../../inc/cpsecplugins.h>
+
+// User includes
+#include "cppincodeplugin.h"
+#include "cppincodepluginview.h"
+
+/*!
+    \class CpPinCodePlugin
+    \brief Pin Code Setting plugin class
+
+    This class is used to create PIN code setting
+*/
+
+// ======== LOCAL FUNCTIONS ========
+
+/*!
+   Constructor
+*/
+CpPinCodePlugin::CpPinCodePlugin()
+{
+RDEBUG("0", 0);
+}
+
+/*!
+   Destructor
+*/
+CpPinCodePlugin::~CpPinCodePlugin()
+{
+}
+
+/*!
+   Create PinCode setting
+*/
+QList<CpSettingFormItemData *> CpPinCodePlugin::createSettingFormItemData(
+    CpItemDataHelper &itemDataHelper) const
+{
+		RDEBUG("0", 0);
+		RDEBUG("using icon", 1);
+    return  QList<CpSettingFormItemData *>()
+        << new CpSettingFormEntryItemDataImpl<CpPinCodePluginView>
+        (itemDataHelper, tr("PIN code"), QString(), HbIcon(QString("qtg_large_pin_code")) );
+}
+
+/*!
+   Export plugin
+*/
+Q_EXPORT_PLUGIN2(cppincodeplugin, CpPinCodePlugin);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/simpincodeplugin/src/cppincodepluginview.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,158 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *
+ */
+
+// System includes
+#include <hbdataform.h>
+#include <hbdataformmodel.h>
+#include <hbdataformmodelitem.h>
+#include <hblineedit.h>
+#include <seccodeeditdataformviewitem.h>
+#include <seccodesettings.h>
+
+// User includes
+#include "cppincodepluginview.h"
+#include <../../inc/cpsecplugins.h>
+
+/*!
+    \class CpPinCodePluginView
+    \brief Pin Code Setting view class
+
+    This class is used to create PIN code setting view
+*/
+
+// ======== LOCAL FUNCTIONS ========
+
+/*!
+   Constructor
+*/
+CpPinCodePluginView::CpPinCodePluginView(QGraphicsItem *parent /*= 0*/)
+	: CpBaseSettingView(0,parent), mSecCodeSettings(new SecCodeSettings())
+{
+		RDEBUG("0", 0);
+    HbDataForm *form = qobject_cast<HbDataForm*>(widget());
+    if (form) {
+        QList<HbAbstractViewItem *> protoTypeList = form->itemPrototypes();
+        protoTypeList.append(new SecCodeEditDataFormViewItem());
+        form->setItemPrototypes(protoTypeList);     
+        form->setHeading(tr("PIN code"));
+
+        mFormModel = new HbDataFormModel(this);        
+        mPinCodeRequestItem = new HbDataFormModelItem(
+            HbDataFormModelItem::ToggleValueItem, tr("PIN code requests"));
+
+        bool currentPinCodeRequest = mSecCodeSettings->pinCodeRequest();
+        if (currentPinCodeRequest) { 
+            mPinCodeRequestItem->setContentWidgetData("text", tr("On"));
+            mPinCodeRequestItem->setContentWidgetData("additionalText", tr("On"));
+        } else {
+            mPinCodeRequestItem->setContentWidgetData("text",tr("Off"));
+            mPinCodeRequestItem->setContentWidgetData("additionalText", tr("Off"));
+        }
+				RDEBUG("form->addConnection", 1);
+        connect(mFormModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), 
+                  this, SLOT(toggleChange(QModelIndex, QModelIndex)));
+        mFormModel->appendDataFormItem(mPinCodeRequestItem);
+
+        HbDataFormModelItem *pinCodeItem = new HbDataFormModelItem(
+            static_cast<HbDataFormModelItem::DataItemType>
+            (SecCodeEditDataFormViewItem::SecCodeEditItem), tr("PIN code"));
+        pinCodeItem->setContentWidgetData("echoMode", HbLineEdit::Password);
+        pinCodeItem->setContentWidgetData("text", "1111");
+        pinCodeItem->setContentWidgetData("readOnly", true);
+        form->addConnection(pinCodeItem, SIGNAL(clicked()), this,
+        		SLOT(changePinCode()));
+        mFormModel->appendDataFormItem(pinCodeItem);
+
+        HbDataFormModelItem *pin2CodeItem = new HbDataFormModelItem(
+            static_cast<HbDataFormModelItem::DataItemType>
+            (SecCodeEditDataFormViewItem::SecCodeEditItem), tr("PIN2 code"));
+        pin2CodeItem->setContentWidgetData("echoMode", HbLineEdit::Password);
+        pin2CodeItem->setContentWidgetData("text", "1111");
+        pin2CodeItem->setContentWidgetData("readOnly", true);
+        form->addConnection(pin2CodeItem, SIGNAL(clicked()), this,
+        		SLOT(changePin2Code()));
+        mFormModel->appendDataFormItem(pin2CodeItem);
+				RDEBUG("form->setModel", 1);
+        form->setModel(mFormModel);
+    }
+}
+
+/*!
+   Destructor
+*/
+CpPinCodePluginView::~CpPinCodePluginView()
+{
+    delete mSecCodeSettings;
+}
+
+/*!
+   response for click pin code request
+*/
+void CpPinCodePluginView::toggleChange(QModelIndex startIn, 
+        QModelIndex /*endIn*/)
+{
+		RDEBUG("0", 0);
+    HbDataFormModelItem *item = mFormModel->itemFromIndex(startIn);
+    if(item->type() == HbDataFormModelItem::ToggleValueItem) {
+        if (mSecCodeSettings->changePinCodeRequest()) {
+        		RDEBUG("got changePinCodeRequest", 1);
+						disconnect(mFormModel, 
+                    SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, 
+                    SLOT(toggleChange(QModelIndex, QModelIndex)));
+        		RDEBUG("disconnected", 1);
+            QString text = mPinCodeRequestItem->contentWidgetData(
+                    "text").toString();
+            if (0 == text.compare("On")) {
+                mPinCodeRequestItem->setContentWidgetData("text", 
+                    tr("Off"));
+                mPinCodeRequestItem->setContentWidgetData("additionalText", 
+                    tr("Off"));
+            } else {
+                mPinCodeRequestItem->setContentWidgetData("text", 
+                    tr("On"));
+                mPinCodeRequestItem->setContentWidgetData("additionalText", 
+                    tr("On"));
+            }
+         		RDEBUG("reconnect", 1);
+						connect(mFormModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), 
+                    this, SLOT(toggleChange(QModelIndex, QModelIndex)));
+        }
+      else
+      	{
+      	RDEBUG("value was not changed", 0);
+      	}
+    }
+   	RDEBUG("0", 0);
+}
+
+/*!
+   response for click pin code
+*/
+void CpPinCodePluginView::changePinCode()
+{
+		RDEBUG("0", 0);
+    mSecCodeSettings->changePinCode();
+}
+
+/*!
+   response for click pin2 code
+*/
+void CpPinCodePluginView::changePin2Code()
+{
+		RDEBUG("0", 0);
+    mSecCodeSettings->changePin2Code();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/simpincodeplugin/src/seccodeedit.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+// System includes
+#include <QGraphicsSceneMouseEvent>
+
+// User includes
+#include "seccodeedit.h"
+#include <../../inc/cpsecplugins.h>
+
+// ======== MEMBER FUNCTIONS ========
+
+/*!
+    Constructor
+*/
+SecCodeEdit::SecCodeEdit(const QString &text, QGraphicsItem *parent/*= 0*/)
+    : HbLineEdit(text, parent)
+{
+}
+
+/*!
+    Destructor
+*/
+SecCodeEdit::~SecCodeEdit()
+{
+}
+
+/*!
+    Mouse Press Event
+*/
+void SecCodeEdit::mousePressEvent(QGraphicsSceneMouseEvent *event)
+{
+		RDEBUG("0", 0);
+    if (event->button() != Qt::LeftButton) {
+        event->ignore();
+        return;
+    }
+
+    if (rect().contains(event->pos())) {
+        emit clicked();
+        event->accept();
+    } else {
+        event->ignore();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/simpincodeplugin/src/seccodeeditdataformviewitem.cpp	Tue Aug 31 16:04:40 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:
+ *
+ */
+
+// User includes
+#include "seccodeeditdataformviewitem.h"
+#include "seccodeedit.h"
+#include <../../inc/cpsecplugins.h>
+
+// ======== MEMBER FUNCTIONS ========
+
+/*!
+    Constructor
+*/
+SecCodeEditDataFormViewItem::SecCodeEditDataFormViewItem(
+    QGraphicsItem *parent): HbDataFormViewItem(parent)
+{
+	RDEBUG("0", 0);
+}
+
+/*!
+    Destructor
+*/
+SecCodeEditDataFormViewItem::~SecCodeEditDataFormViewItem()
+{
+}
+
+/*!
+    Create Item
+*/
+HbAbstractViewItem *SecCodeEditDataFormViewItem::createItem()
+{
+		RDEBUG("0", 0);
+    return new SecCodeEditDataFormViewItem( *this);
+}
+   
+/*!
+    Create Item
+*/
+bool SecCodeEditDataFormViewItem::canSetModelIndex(
+    const QModelIndex &index) const
+{
+    int type = index.data(HbDataFormModelItem::ItemTypeRole).toInt();
+    RDEBUG("type", type);
+    return type == SecCodeEditItem;
+}
+
+/*!
+    Create Custom Widget
+*/
+HbWidget *SecCodeEditDataFormViewItem::createCustomWidget()
+{
+    int type = modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt();
+    RDEBUG("type", type);
+
+    if (type == SecCodeEditItem) {
+        SecCodeEdit *edit = new SecCodeEdit("1234");
+        edit->setEchoMode(HbLineEdit::Password);
+        RDEBUG("edit->setReadOnly", 1);
+        edit->setReadOnly(true);
+        return edit;
+    }
+		RDEBUG("0", 0);
+    return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/simpincodeplugin/src/seccodemodel.cpp	Tue Aug 31 16:04:40 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:
+ *
+ */
+
+// User includes
+#include "seccodemodel.h"
+#include "seccodemodel_p.h"
+#include <../../inc/cpsecplugins.h>
+
+// ======== MEMBER FUNCTIONS ========
+
+/*!
+    Constructor
+*/
+SecCodeModel::SecCodeModel(QObject *parent/*= 0*/)
+    : QObject(parent)
+{
+    QT_TRAP_THROWING(d_ptr = SecCodeModelPrivate::NewL());
+}
+
+/*!
+    Destructor
+*/
+SecCodeModel::~SecCodeModel()
+{
+    delete d_ptr;
+}
+
+/*!
+    Get Pin Code Request State
+*/
+bool SecCodeModel::pinCodeRequest() const
+{
+		RDEBUG("0", 0);
+    return d_ptr->pinCodeRequest();
+}
+
+/*!
+    Change Pin Code
+*/
+bool SecCodeModel::changePinCodeRequest()
+{
+		RDEBUG("0", 0);
+    return d_ptr->changePinCodeRequest();
+}
+
+/*!
+    Change Pin Code
+*/
+int SecCodeModel::changePinCode()
+{
+		RDEBUG("0", 0);
+    return d_ptr->changePinCode();
+}
+
+/*!
+    Change Pin2 Code
+*/
+int SecCodeModel::changePin2Code()
+{
+		RDEBUG("0", 0);
+    return d_ptr->changePin2Code();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/simpincodeplugin/src/seccodemodel_symbian.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+// System includes
+#include <e32err.h>
+#include <exterror.h>
+#include <etelmm.h>
+
+// User includes
+#include "seccodemodel_p.h"
+#include "seccodeuiglobal.h"
+#include <../../inc/cpsecplugins.h>
+
+// ======== MEMBER FUNCTIONS ========
+
+/*!
+    NewL
+*/
+SecCodeModelPrivate* SecCodeModelPrivate::NewL()
+{
+    SecCodeModelPrivate* self = new (ELeave) SecCodeModelPrivate();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(); //self
+    return self;
+}
+
+/*!
+    SecCodeModelPrivate
+*/
+SecCodeModelPrivate::SecCodeModelPrivate()
+{
+}
+
+/*!
+    ConstructL
+*/
+void SecCodeModelPrivate::ConstructL()
+{
+	RDEBUG("0", 0);
+	iSecurity = CSecuritySettings::NewL(); 
+}
+
+/*!
+    Destructor
+*/
+SecCodeModelPrivate::~SecCodeModelPrivate()
+{
+	if (iSecurity) {
+		delete iSecurity;
+	}
+}
+
+/*!
+    Get Pin Code Request State
+*/
+bool SecCodeModelPrivate::pinCodeRequest() const
+{
+	RDEBUG("0", 0);
+	bool isLockEnabled = false;
+	QT_TRAP_THROWING(isLockEnabled = iSecurity->IsLockEnabledL(
+		RMobilePhone::ELockICC));
+	RDEBUG("isLockEnabled", isLockEnabled);
+	return isLockEnabled;
+}
+
+/*!
+    Get the Change Pin Remaining Attempts
+*/
+bool SecCodeModelPrivate::changePinCodeRequest()
+{
+	RDEBUG("0", 0);
+    bool result = false;
+	QT_TRAP_THROWING(result =iSecurity->ChangePinRequestL());
+	RDEBUG("result", result);
+	return result;
+}
+
+/*!
+    Change Pin Code
+*/
+int SecCodeModelPrivate::changePinCode()
+{
+	RDEBUG("0", 0);
+	QT_TRAP_THROWING(iSecurity->ChangePinL());
+	RDEBUG("0", 0);
+	return 0;
+}
+
+/*!
+    Change Pin2 Code
+*/
+int SecCodeModelPrivate::changePin2Code()
+{
+	RDEBUG("0", 0);
+	QT_TRAP_THROWING(iSecurity->ChangePin2L());
+	RDEBUG("0", 0);
+	return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/simpincodeplugin/src/seccodemodel_win.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,103 @@
+/*
+ * 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:
+ *
+ */
+
+// User includes
+#include "seccodemodel_p.h"
+#include <../../inc/cpsecplugins.h>
+
+// ======== MEMBER FUNCTIONS ========
+/*!
+    NewL
+*/
+SecCodeModelPrivate* SecCodeModelPrivate::NewL()
+{
+    return NULL;
+}
+
+/*!
+    Constructor
+*/
+SecCodeModelPrivate::SecCodeModelPrivate()
+{
+}
+
+/*!
+    ConstructL
+*/
+void SecCodeModelPrivate::ConstructL()
+{
+
+}
+
+/*!
+    Destructor
+*/
+SecCodeModelPrivate::~SecCodeModelPrivate()
+{
+}
+
+/*!
+    Get Pin Code Request State
+*/
+bool SecCodeModelPrivate::pinCodeRequest() const
+{
+		RDEBUG("0", 0);
+    QString information;
+    information = QString("Emulator NOT supported!");
+    HbMessageBox messageBox(information);
+    messageBox.exec();
+    return false;
+}
+
+/*!
+    Get the Change Pin Remaining Attempts
+*/
+bool SecCodeModelPrivate::changePinCodeRequest()
+{
+		RDEBUG("0", 0);
+    QString information;
+    information = QString("Emulator NOT supported!");
+    HbMessageBox messageBox(information);
+    messageBox.exec();
+    return true;
+}
+
+/*!
+    Change Pin Code
+*/
+int SecCodeModelPrivate::changePinCode()
+{
+		RDEBUG("0", 0);
+    QString information;
+    information = QString("Emulator NOT supported!");
+    HbMessageBox messageBox(information);
+    messageBox.exec();
+    return 0;
+}
+
+/*!
+    Change Pin2 Code
+*/
+int SecCodeModelPrivate::changePin2Code()
+{
+		RDEBUG("0", 0);
+    QString information;
+    information = QString("Emulator NOT supported!");
+    HbMessageBox messageBox(information);
+    messageBox.exec();
+    return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/simpincodeplugin/src/seccodesettings.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+// User includes
+#include "seccodesettings.h"
+#include "seccodemodel.h"
+#include <../../inc/cpsecplugins.h>
+
+// Class declaration
+class SecCodeSettingsPrivate
+{
+public:
+    SecCodeSettingsPrivate()
+    {
+        mSecCodeModel = new SecCodeModel();
+    }
+    
+    ~SecCodeSettingsPrivate()
+    {
+        delete mSecCodeModel;
+    }
+    
+    SecCodeModel *mSecCodeModel;
+};
+
+// ======== MEMBER FUNCTIONS ========
+
+/*!
+    Constructor
+*/
+SecCodeSettings::SecCodeSettings(QObject * parent /*= 0*/)
+    : QObject(parent), d_ptr(new SecCodeSettingsPrivate())
+{
+RDEBUG("0", 0);
+}
+
+/*!
+    Destructor
+*/
+SecCodeSettings::~SecCodeSettings()
+{
+    delete d_ptr;
+}
+
+/*!
+    Get Pin Code Request
+*/
+bool SecCodeSettings::pinCodeRequest() const
+{
+		RDEBUG("0", 0);
+    return d_ptr->mSecCodeModel->pinCodeRequest();
+}
+
+/*!
+    Change Pin Code request
+*/
+bool SecCodeSettings::changePinCodeRequest()
+{
+		RDEBUG("0", 0);
+    return d_ptr->mSecCodeModel->changePinCodeRequest();
+}
+
+/*!
+    Change Pin Code
+*/
+void SecCodeSettings::changePinCode()
+{
+		RDEBUG("0", 0);
+    d_ptr->mSecCodeModel->changePinCode();
+}
+
+/*!
+    Change Pin2 Code
+*/
+void SecCodeSettings::changePin2Code()
+{    
+		RDEBUG("0", 0);
+    d_ptr->mSecCodeModel->changePin2Code();
+}
--- a/devencdiskutils/DevEncCommonUtils/src/DevEncDiskUtils.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/devencdiskutils/DevEncCommonUtils/src/DevEncDiskUtils.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -255,23 +255,18 @@
     if (!err)
         return err;
     TInt64 memoryWarningSpace(0);
-    TRAP(err, memoryWarningSpace = FindWarningLevelTresholdL( aNumber ));
+    TRAP(err, memoryWarningSpace = FindWarningLevelTresholdL());
     if (!err)
         return err;
     
     DFLOG2( "CDevEncDiskUtils::DiskFinalize => memoryCriticalSpace = %d", (TInt) memoryCriticalSpace );
     DFLOG2( "CDevEncDiskUtils::DiskFinalize => memoryWarningSpace = %d", (TInt) memoryWarningSpace );
     
-    //create the number of files needed to fill the mmc or phone memory free space
+    //create the number of files needed to fill the mmc free space
     while( freeSpace )
         {
-        TInt64 newMemoryWarningSpace(0);
-        if( aNumber == EDriveC )
-        	{
-            // The real warning space is a percentage of the free space. This applies only on drive C. 
-            newMemoryWarningSpace = ( TInt64 ) ( volumeInfo.iSize*( 100 - memoryWarningSpace ) ) / 100;
-        	}
-        
+        /* The real warning space is a percentage of the free space */
+        TInt64 newMemoryWarningSpace = ( TInt64 ) ( volumeInfo.iSize*( 100 - memoryWarningSpace ) ) / 100;
         DFLOG2( "CDevEncDiskUtils::DiskFinalize => newMemoryWarningSpace = %d", (TInt) newMemoryWarningSpace );
 
         if( TInt64( volumeInfo.iFree ) > TInt64( KMaxInt ) )
@@ -280,14 +275,7 @@
             }
         else
         	{
-            if( aNumber == EDriveC )
-                {
-        	    size = Max( 0LL, TInt64( volumeInfo.iFree ) - memoryCriticalSpace - newMemoryWarningSpace );
-                }
-            else
-                {
-                size = Max( 0LL, TInt64( volumeInfo.iFree ) - memoryCriticalSpace - memoryWarningSpace );
-                }
+        	size = Max( 0LL, TInt64( volumeInfo.iFree ) - memoryCriticalSpace - newMemoryWarningSpace );
         	}
 
         TFileName temp;
@@ -314,19 +302,9 @@
         if( err )
             DFLOG2( "..fs.Volume fail %d", err );    
 
-        if( aNumber == EDriveC )
+        if( TInt64( volumeInfo.iFree ) <= memoryCriticalSpace + newMemoryWarningSpace )
         	{
-            if( TInt64( volumeInfo.iFree ) <= memoryCriticalSpace + newMemoryWarningSpace )
-        	    {
-                freeSpace = EFalse;
-                }
-            }
-        else
-            {
-            if( TInt64( volumeInfo.iFree ) <= memoryCriticalSpace + memoryWarningSpace )
-                {
-                freeSpace = EFalse;
-                }
+            freeSpace = EFalse;
             }
         }
 
@@ -370,16 +348,9 @@
 // CDevEncDiskUtils::FindWarningLevelTresholdL()
 // 
 // --------------------------------------------------------------------------
-TInt64 CDevEncDiskUtils::FindWarningLevelTresholdL( const TDriveNumber aNumber )
+TInt64 CDevEncDiskUtils::FindWarningLevelTresholdL()
 	{
-      if( aNumber == EDriveC )
-          {
-	      return (TInt64) FindValueL( KCRUidUiklaf, KUikOODDiskFreeSpaceWarningNoteLevel );
-          }
-      else
-          {
-          return (TInt64) FindValueL( KCRUidUiklaf, KUikOODDiskFreeSpaceWarningNoteLevelMassMemory );
-          }
+	return (TInt64) FindValueL( KCRUidUiklaf, /*KUikOODDiskWarningThreshold*/KUikOODDiskFreeSpaceWarningNoteLevel );
 	}
 
 // End of file
--- a/devencdiskutils/DevEncCommonUtils/src/DevEncKeyUtils.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/devencdiskutils/DevEncCommonUtils/src/DevEncKeyUtils.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -24,6 +24,7 @@
 #include "DevEncLog.h"
 #include "DevEncUids.hrh"
 
+
 #include <pbe.h>
 #include <pbedata.h>
 //#include <PathInfo.h> // for system path literals
--- a/gba/gbaapi/group/gba.mmp	Thu Aug 19 10:45:23 2010 +0300
+++ b/gba/gbaapi/group/gba.mmp	Tue Aug 31 16:04:40 2010 +0300
@@ -23,8 +23,6 @@
 VENDORID    VID_DEFAULT
 CAPABILITY  CAP_CLIENT_DLL
 
-SMPSAFE
-
 USERINCLUDE ../inc 
 USERINCLUDE ../../inc
 
--- a/gba/gbafilter/group/httpfiltergba.mmp	Thu Aug 19 10:45:23 2010 +0300
+++ b/gba/gbafilter/group/httpfiltergba.mmp	Tue Aug 31 16:04:40 2010 +0300
@@ -26,8 +26,6 @@
 UID 0x10009D8D 0x20029F09
 VENDORID VID_DEFAULT 
 
-SMPSAFE
-
 SOURCEPATH ../src
 SOURCE HTTPFilterGBAMain.cpp HTTPFilterGBA.cpp 
 
--- a/gba/gbaserver/group/gbaserver.mmp	Thu Aug 19 10:45:23 2010 +0300
+++ b/gba/gbaserver/group/gbaserver.mmp	Tue Aug 31 16:04:40 2010 +0300
@@ -24,8 +24,6 @@
 VENDORID    VID_DEFAULT
 CAPABILITY  CAP_SERVER NetworkControl
 
-SMPSAFE
-
 USERINCLUDE       ../inc
 USERINCLUDE      ../../inc
 
--- a/gba/gbaserver/inc/dataretriever.h	Thu Aug 19 10:45:23 2010 +0300
+++ b/gba/gbaserver/inc/dataretriever.h	Tue Aug 31 16:04:40 2010 +0300
@@ -26,7 +26,7 @@
 #include <http.h>
 #include <es_sock.h> 
 #include <commdbconnpref.h>
-#include <cmmanagerext.h>
+#include <cmmanager.h>
 #include <hash.h>
 #include "M3GPPAuthenticationCallback.h"
 
@@ -147,7 +147,7 @@
           RSocketServ               iSockServ;
           C3GPPBootstrapHttpHandler* iHttpHandler;          // we own this    
           MBootstrapCallBack*       iBootstrapCallBack;     // don't own this
-          RCmManagerExt             iCmManagerExt;
+          RCmManager             	iCmManager;
     };
 
 
--- a/gba/gbaserver/src/dataretriever.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/gba/gbaserver/src/dataretriever.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -21,10 +21,9 @@
 #include <commdb.h>
 #include <es_enum.h>
 #include <centralrepository.h>
-#include <cmconnectionmethodext.h>
 #include <cmconnectionmethoddef.h>
 #include <cmpluginpacketdatadef.h>
-#include <cmdestinationext.h>
+#include <cmdestination.h>
 #include <http/thttpevent.h>
 #include "dataretriever.h"
 #include "GbaCommon.h"
@@ -103,7 +102,7 @@
     {
     iHttpHandler = C3GPPBootstrapHttpHandler::NewL( this, iBootstrapCallBack );
     iInternalState = EReadyForRequest;
-    iCmManagerExt.OpenL();
+    iCmManager.OpenL();
     }
 
 
@@ -120,7 +119,7 @@
     iHTTPSession.Close();
     iConnection.Close();
     iSockServ.Close();
-    iCmManagerExt.Close();
+    iCmManager.Close();
     
     if ( iInternalState == EMakeRequestCalled )
         {
@@ -356,11 +355,11 @@
         RArray<TUint32> destIdArray;
         CleanupClosePushL( destIdArray );
         CleanupCounter++;
-        iCmManagerExt.AllDestinationsL( destIdArray );
+        iCmManager.AllDestinationsL( destIdArray );
 
         for ( TInt i = 0; i< destIdArray.Count(); i++ )
            {
-           RCmDestinationExt dest = iCmManagerExt.DestinationL( destIdArray[i] );
+           RCmDestination dest = iCmManager.DestinationL( destIdArray[i] );
            CleanupClosePushL( dest );
            CleanupCounter++;
          
@@ -409,11 +408,11 @@
     RArray<TUint32> destIdArray;
     CleanupClosePushL( destIdArray );
     CleanupCounter++;
-    iCmManagerExt.AllDestinationsL( destIdArray );
+    iCmManager.AllDestinationsL( destIdArray );
 
     for ( TInt i = 0; i< destIdArray.Count(); i++ )
          {
-         RCmDestinationExt dest = iCmManagerExt.DestinationL( destIdArray[i] );
+         RCmDestination dest = iCmManager.DestinationL( destIdArray[i] );
          CleanupClosePushL( dest );
          CleanupCounter++;
          
--- a/gba/sis/gba.pkg	Thu Aug 19 10:45:23 2010 +0300
+++ b/gba/sis/gba.pkg	Tue Aug 31 16:04:40 2010 +0300
@@ -17,7 +17,7 @@
 &EN
 
 ; Header
-#{"GBA"},(0x20029F08), 1, 0, 0, TYPE=SA,RU
+#{"GBA"},(0x20029F08), 1, 1, 0, TYPE=SA,RU
 
 ; Localised Vendor name
 %{"Nokia"}
@@ -27,8 +27,8 @@
 
 "..\data\gba_license.txt"-"", FT, TA
 
-; Product dependency for Series 60 v5.1
-  [0x10283160], 0, 0, 0, {"Series60ProductID"}   
+; Product dependency for Symbian^4
+  [0x20032DE7], 0, 0, 0, {"Series60ProductID"}   
 
 ; Files to install
 
--- a/gba/sis/gba_stub.pkg	Thu Aug 19 10:45:23 2010 +0300
+++ b/gba/sis/gba_stub.pkg	Tue Aug 31 16:04:40 2010 +0300
@@ -17,7 +17,7 @@
 &EN
 
 ; Header
-#{"GBA"}, (0x20029F08), 1, 0, 0, TYPE=SA
+#{"GBA"}, (0x20029F08), 1, 1, 0, TYPE=SA
 
 ; Localised Vendor name
 %{"Nokia"}
Binary file gba/sis/gba_stub.sis has changed
--- a/gba/uicc/group/gbauicc.mmp	Thu Aug 19 10:45:23 2010 +0300
+++ b/gba/uicc/group/gbauicc.mmp	Tue Aug 31 16:04:40 2010 +0300
@@ -25,8 +25,6 @@
 
 CAPABILITY CAP_ECOM_PLUGIN 
 
-SMPSAFE
-
 USERINCLUDE   ../inc
 USERINCLUDE   ../../inc
 
--- a/layers.sysdef.xml	Thu Aug 19 10:45:23 2010 +0300
+++ b/layers.sysdef.xml	Tue Aug 31 16:04:40 2010 +0300
@@ -1,15 +1,18 @@
 <?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/securitysrv" >
 ]>
 
-<SystemDefinition name="securitysrv" schema="1.4.0">
+<SystemDefinition name="securitysrv" schema="1.5.1">
   <systemModel>
     <layer name="mw_layer">
       <module name="securitysrv">
         <unit name="securitysrv" unitID="sedo.securitysrv" bldFile="&layer_real_source_path;/group" mrp="" />
       </module>
       <module name="">
+        <unit unitID="sedoQT.securitysrv" bldFile="&layer_real_source_path;" mrp="" name="sedoQT_securitysrv" proFile="securitysrv.pro" qmakeArgs="-r" />
+      </module>
+      <module name="">
         <unit unitID="sedo.securitysrv.pkiutilities.Certificates" bldFile="&layer_real_source_path;/pkiutilities/Certificates/group" mrp="" filter="sf_build" name="sedo_securitysrv_pkiutilities_Certificates" />
       </module>
       <module name="">
--- a/package_definition.xml	Thu Aug 19 10:45:23 2010 +0300
+++ b/package_definition.xml	Tue Aug 31 16:04:40 2010 +0300
@@ -1,113 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <SystemDefinition schema="3.0.0">
   <package id="securitysrv" name="Security Services" levels="plugin framework server generic specific">
-    <collection id="gba" name="Generic Bootstrapping Architecture" level="server">
-      <component id="uicc" filter="s60" name="UICC" class="plugin" introduced="^2">
-        <unit bldFile="gba/uicc/group"/>
-      </component>
-      <component id="bootstrap" filter="s60" name="Bootstrap" introduced="^2">
-        <unit bldFile="gba/bootstrap/group"/>
-      </component>
-      <component id="gbaserver" filter="s60" name="GBA Server" introduced="^2">
-        <unit bldFile="gba/gbaserver/group"/>
-      </component>
-      <component id="gbaapi" filter="s60" name="GBA API" introduced="^2">
-        <unit bldFile="gba/gbaapi/group"/>
-      </component>
-      <component id="gbafilter" filter="s60" name="GBA HTTP Filter" class="plugin" introduced="^2">
-        <unit bldFile="gba/gbafilter/group"/>
-      </component>
-      <component id="gba_build" filter="s60" name="Generic Boot Architecture Build" introduced="^2">
-        <unit bldFile="gba/group"/>
-      </component>
-    </collection>
-    <collection id="wim" name="Wireless Identity Module " level="framework">
-      <component id="swimreader" filter="s60" name="SWIM Reader"/>
-      <component id="scard" filter="s60" name="Smart Card"/>
-      <component id="wimutil" filter="s60" name="WIM Utils"/>
-      <component id="wimserver" filter="s60" name="WIM Server"/>
-      <component id="wimclient" filter="s60" name="WIM Client"/>
-      <component id="wimplugin" filter="s60" name="WIM Plugin" class="plugin"/>
-      <component id="wim_build" filter="s60" name="WIM Build">
-           <!-- need to distribute bld.inf to empty components or collapse into a single component -->
-        <unit bldFile="wim/group"/>
-      </component>
-    </collection>
     <collection id="pkiutilities" name="PKI Utilities" level="plugin">
-      <component id="x509certnameparser" filter="s60" name="X.509 Certificate Name Parser">
-        <unit bldFile="pkiutilities/x509certnameparser/group"/>
-      </component>
-      <component id="pkcs12" filter="s60" name="PKCS #12">
-        <unit bldFile="pkiutilities/pkcs12/group"/>
-      </component>
-      <component id="certmanui" filter="s60" name="Certificate Management UI">
-        <unit bldFile="pkiutilities/certmanui/group"/>
-      </component>
-      <component id="ctsecuritydialogs" filter="s60" name="Crypto Token Security Dialogs">
-        <unit bldFile="pkiutilities/ctsecuritydialogs/group"/>
-      </component>
-      <component id="certsaver" filter="s60" name="Certificate Saver">
-        <unit bldFile="pkiutilities/certsaver/group"/>
-      </component>
-      <component id="secmodui" filter="s60" name="Security Module UI">
-        <unit bldFile="pkiutilities/secmodui/group"/>
-      </component>
-      <component id="devicetoken" filter="s60" name="Device Token">
-        <unit bldFile="pkiutilities/devicetoken/group"/>
-      </component>
-      <component id="certificates" filter="s60" name="Certificates">
-        <unit bldFile="pkiutilities/certificates/group"/>
-      </component>
-      <component id="pkiutilities_build" filter="s60" name="PKI Utilities Build">
-        <unit bldFile="pkiutilities/group"/>
-      </component>
      <component id="ocsp" name="Online Certificate Status Protocol" introduced="^2" purpose="optional">
        <unit bldFile="pkiutilities/ocsp/group" mrp="pkiutilities/ocsp/group/securitysrv_ocsp.mrp"/>
       </component>
     </collection>
-    <collection id="remotelock" name="Remote Lock" level="generic">
-      <component id="remotelocksettings" filter="s60" name="Remote Lock Settings"/>
-      <component id="remotelockengine" filter="s60" name="Remote Lock Engine"/>
-      <component id="remotelock_build" filter="s60" name="Remote Lock Build">
-           <!-- need to distribute bld.inf to empty components or collapse into a single component -->
-        <unit bldFile="remotelock/group"/>
-      </component>
-    </collection>
-    <collection id="boottimeintegritycheck" name="Boot Time Integrity Check" level="plugin">
-      <component id="trkdummy" filter="s60" name="Trk Dummy">
-        <!-- <unit bldFile="boottimeintegritycheck/trkdummy/group"/> -->
-      </component>
-      <component id="boottimeintegritycheck_build" filter="s60" name="Boot Time Integrity Check Build">
-        <unit bldFile="boottimeintegritycheck/group"/>
-      </component>
-    </collection>
-    <collection id="securitydialogs" name="Security Dialogs" level="specific">
-      <component id="keylockpolicyapi" filter="s60" name="Keylock Policy API">
-        <unit bldFile="securitydialogs/keylockpolicyapi/group"/>
-      </component>
-      <component id="autolock" name="Autolock" filter="s60">
-        <unit bldFile="securitydialogs/autolock/group"/>
-      </component>
-      <component id="secui" filter="s60" name="Security UI">
-        <unit bldFile="securitydialogs/secui/group"/>
-      </component>
-      <component id="securitynotifier" filter="s60" name="Security Notifier">
-        <unit bldFile="securitydialogs/securitynotifier/group"/>
-      </component>
-      <component id="securityobserver" filter="s60" name="Security Observer">
-        <unit bldFile="securitydialogs/securityobserver/group"/>
-      </component>
-    </collection>
     <collection id="securitysrv_info" name="Security Services Info" level="specific">
-      <component id="secsrv_plat" name="Security Services Platform Interfaces" filter="s60" class="api">
-        <unit bldFile="secsrv_plat/group"/>
-        <!-- <unit bldFile="secsrv_plat/devicelock_access_api/group"/> -->
-        <!-- <unit bldFile="secsrv_plat/keyguard_access_api/group"/> -->
-        <!-- <unit bldFile="secsrv_plat/lockapp_server_api/group"/> -->
-      </component>
-      <component id="securitysrv_test" filter="s60" purpose="development" name="Security Services Test">
-        <!-- <unit bldFile="tsrc/group"/> -->
-      </component>
       <component id="securitysrv_metadata" name="Security Services Metadata" class="config" introduced="^2" purpose="development" target="desktop">
         <unit mrp="securitysrv_info/securitysrv_metadata/securitysrv_metadata.mrp"/>
       </component>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/package_map.xml	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<PackageMap root="sf" layer="mw" />
\ No newline at end of file
--- a/pkiutilities/CTSecurityDialogs/Group/CTSecDialogImpl.mmp	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CTSecurityDialogs/Group/CTSecDialogImpl.mmp	Tue Aug 31 16:04:40 2010 +0300
@@ -34,29 +34,40 @@
 LANGUAGE_IDS
 END
 
+// CTSecuritydialognotifier uses CertManUi resources that are not compiled in builds any more
+SOURCEPATH ../../CertmanUi/data
+START RESOURCE  certmanui.rss
+HEADER
+TARGETPATH      RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END
+
 SYSTEMINCLUDE ../../CertmanUi/INC
 SYSTEMINCLUDE ../../CertSaver/inc
 SYSTEMINCLUDE ../../DeviceToken/Inc
 SYSTEMINCLUDE ../../../inc              // securityservices/inc directory
 MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   /epoc32/include/mw/hb/hbcore 
+SYSTEMINCLUDE   /epoc32/include/mw/hb/hbwidgets
 
 
 USERINCLUDE ../NotifInc
 USERINCLUDE ../ClientInc
+USERINCLUDE ../../../securitydialogs/SecUi/Inc
 
 SOURCEPATH  ../NotifSrc
 
 SOURCE    DllMain.cpp
 SOURCE    CTSecuritydialognotifier.cpp
-SOURCE    CTpinquerydialog.cpp
-SOURCE    CTQueryDialog.cpp
-SOURCE    CTSigntextdialog.cpp
-SOURCE    CTSelectcertificatedialog.cpp
-SOURCE    CTPinPinQueryDialog.cpp
+//SOURCE    CTpinquerydialog.cpp
+//SOURCE    CTQueryDialog.cpp
+//SOURCE    CTSigntextdialog.cpp
+//SOURCE    CTSelectcertificatedialog.cpp
+//SOURCE    CTPinPinQueryDialog.cpp
 SOURCE    CTCertificateQuery.cpp
 SOURCE    CTSecurityDialogsAO.cpp
-SOURCE    CTNoTrustQuery.cpp
-SOURCE    CTInvalidCertNote.cpp
+SOURCE    CTUntrustedCertQuery.cpp
+//SOURCE    CTInvalidCertNote.cpp
 
 LIBRARY   EUSER.LIB
 LIBRARY   EIKSRV.LIB
@@ -80,10 +91,13 @@
 LIBRARY   aknlayout.lib
 LIBRARY   X500.lib
 LIBRARY   DevTokenClient.lib
+LIBRARY   HbCore.lib                // CHbDeviceDialog
+LIBRARY   HbWidgets.lib
+LIBRARY   secui.lib
 
 DEBUGLIBRARY     flogger.lib
 
-#if defined(ARMCC)
+#if defined( EABI )
     DEFFILE ../eabi/CTSecDilogImpl.DEF
 #elif defined( WINSCW )
     DEFFILE ../BWINSCW/CTSecDilogImpl.DEF
--- a/pkiutilities/CTSecurityDialogs/Group/bld.inf	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CTSecurityDialogs/Group/bld.inf	Tue Aug 31 16:04:40 2010 +0300
@@ -23,10 +23,12 @@
 
 PRJ_EXPORTS
 ../loc/wmlbrowser_wim.loc  MW_LAYER_LOC_EXPORT_PATH(wmlbrowser_wim.loc)
+../../CertmanUi/loc/certmanui.loc  MW_LAYER_LOC_EXPORT_PATH(certmanui.loc)
 
 PRJ_MMPFILES
 CTSecDialogImpl.mmp
-CTSecDlgNotifier.mmp
+//TODO: remove completely, commented out to remove AVKON Notifier API dependency
+//CTSecDlgNotifier.mmp
 #ifdef __JAVA_JSR_177_SECURITY_AND_TRUST_SERVICES
 CTSecDlgs.mmp
 #endif
--- a/pkiutilities/CTSecurityDialogs/NotifInc/CTNoTrustQuery.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
-* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#ifndef CTNOTRUSTQUERY_H
-#define CTNOTRUSTQUERY_H
-
-//  INCLUDES
-
-#include <AknQueryDialog.h>
-
-// FORWARD DECLARATIONS
-
-class CCTSecurityDialogsAO;
-class CAknSinglePopupMenuStyleListBox;
-
-// CLASS DECLARATION
-
-/**
-*  Notifier class for showing SSL security dialogs
-*/
-NONSHARABLE_CLASS( CCTNoTrustQuery ): public CAknQueryDialog
-    {
-    public:     // constructors and destructor
-
-        CCTNoTrustQuery(
-            CCTSecurityDialogsAO& aNotifier,
-            TBool& aRetVal,
-            TRequestStatus& aClientStatus,
-            HBufC* aServerName,
-            TBool aShowPermAccept,
-            TBool& aIsDeleted );
-            
-        virtual ~CCTNoTrustQuery();
-
-    private:    // from CEikDialog
-        TBool OkToExitL( TInt aButtonId );
-        void PostLayoutDynInitL();
-
-    private: // New functions
-        TBool OptionsMenuL();
-
-    private:    // data
-        CCTSecurityDialogsAO& iNotifier;
-        TBool& iRetVal; 		//Dialog response
-        TRequestStatus* iClientStatus;
-        HBufC* iServerName;
-        TBool iShowPermAccept;
-        TBool& iDeleted;
-    };
-
-#endif  // CTNOTRUSTQUERY_H
-
--- a/pkiutilities/CTSecurityDialogs/NotifInc/CTSecurityDialogsAO.h	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CTSecurityDialogs/NotifInc/CTSecurityDialogsAO.h	Tue Aug 31 16:04:40 2010 +0300
@@ -36,7 +36,7 @@
 class CX500DistinguishedName;
 class MCTWritableCertStore;
 class CAknQueryDialog;
-class CCTPinQueryDialog;
+//class CCTPinQueryDialog;
 
 
 // CLASS DECLARATION
@@ -170,6 +170,8 @@
 
         void ShowCSRDialogL();
 
+        void ShowInformationNoteL( TInt aResourceID ) const;
+
         /**
         * Saves digital signature receipt
         */
@@ -323,11 +325,8 @@
 
         TBool& iDeleted;
 
-        CAknQueryDialog* iQueryDialog;
-        TBool iQueryDialogDeleted;
-
-        CCTPinQueryDialog* iPinQueryDialog;
-        TBool iPinQueryDialogDeleted;
+        //CCTPinQueryDialog* iPinQueryDialog;
+        //TBool iPinQueryDialogDeleted;
         };
 
 #endif      // CTSECURITYDIALOGSAO_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/CTSecurityDialogs/NotifInc/CTUntrustedCertQuery.h	Tue Aug 31 16:04:40 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:  Displays untrusted certificate dialog.
+*
+*/
+
+#ifndef CTUNTRUSTEDCERTQUERY_H
+#define CTUNTRUSTEDCERTQUERY_H
+
+#include <e32base.h>                            // CActive
+#include <hb/hbcore/hbdevicedialogsymbian.h>    // MHbDeviceDialogObserver
+#include <securitydefs.h>                       // TValidationError
+
+class CHbDeviceDialogSymbian;
+class CHbSymbianVariantMap;
+
+
+/**
+* Displays untrusted certificate query.
+* Untrusted certificate query dialog is displayed for secure connection
+* (SSL/TLS) server authentication failure errors. CCTUntrustedCertQuery
+* class uses UntrustedCertificateDialog device dialog to show the query.
+*/
+NONSHARABLE_CLASS( CCTUntrustedCertQuery ) : public CActive, public MHbDeviceDialogObserver
+    {
+    public:     // constructors and destructor
+        static CCTUntrustedCertQuery* NewLC( TValidationError aValidationError,
+                const TDesC8& aCertificate, const TDesC& aServerName,
+                TBool aCanHandlePermanentAccept );
+        ~CCTUntrustedCertQuery();
+
+    public:     // new functions
+        enum TResponse {
+            EQueryRejected,
+            EQueryAccepted,
+            EQueryAcceptedPermanently
+        };
+        void ShowQueryAndWaitForResponseL( TResponse& aResponse );
+
+    protected:  // from CActive
+        void DoCancel();
+        void RunL();
+
+    private:    // from MHbDeviceDialogObserver
+        void DataReceived( CHbSymbianVariantMap& aData );
+        void DeviceDialogClosed( TInt aCompletionCode );
+
+    private:    // new functions
+        CCTUntrustedCertQuery( TValidationError aValidationError,
+                const TDesC8& aCertificate, const TDesC& aServerName,
+                TBool aCanHandlePermanentAccept );
+        void ConstructL();
+
+    private:    // data
+        TValidationError iValidationError;
+        const TDesC8& iCertificate;
+        const TDesC& iServerName;
+        TBool iCanHandlePermanentAccept;
+        CActiveSchedulerWait *iWait;
+        TInt iWaitCompletionCode;
+        CHbDeviceDialogSymbian* iDeviceDialog;
+        CHbSymbianVariantMap* iVariantMap;
+        TResponse iResponse;
+    };
+
+#endif  // CTUNTRUSTEDCERTQUERY_H
+
--- a/pkiutilities/CTSecurityDialogs/NotifSrc/CTCertificateQuery.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CTSecurityDialogs/NotifSrc/CTCertificateQuery.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2002 Nokia Corporation and/or 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,7 +11,7 @@
 *
 * Contributors:
 *
-* Description:  
+* Description:
 *
 */
 
@@ -23,36 +23,40 @@
 #include "CTSecurityDialogsAO.h"
 
 #include <CTSecDlgs.rsg>
-#include <certmanui.rsg>
+//#include <certmanui.rsg>
 #include <aknmessagequerydialog.h>
 #include <aknPopupHeadingPane.h>
 
 // ================= MEMBER FUNCTIONS ==========================================
 
-CCTCertificateQuery::CCTCertificateQuery(CCTSecurityDialogsAO& aAO):  
-    CAknMessageQueryDialog( CAknQueryDialog::ENoTone ), 
-    iNotifier(aAO)    
+CCTCertificateQuery::CCTCertificateQuery(CCTSecurityDialogsAO& aAO):
+    CAknMessageQueryDialog( CAknQueryDialog::ENoTone ),
+    iNotifier(aAO)
     {
     }
 
 CCTCertificateQuery* CCTCertificateQuery::NewL(CCTSecurityDialogsAO& aAO)
     {
-    CCTCertificateQuery* query = 
+    CCTCertificateQuery* query =
     new( ELeave ) CCTCertificateQuery(aAO);
 
     CleanupStack::PushL( query );
     query->ConstructL();
     CleanupStack::Pop();
-    
+
     return query;
     }
 
 void CCTCertificateQuery::ConstructL()
-    {    
-    iHeader = CEikonEnv::Static()->AllocReadResourceL( R_TEXT_RESOURCE_DETAILS_VIEW_HEADER );    
-    SetHeaderTextL( *iHeader );    
-    iMessage = iNotifier.CreateMessageL();    
-    SetMessageTextL( *iMessage );          
+    {
+    // Temporary fix. Resource file certmanui.rsg is removed.
+    //iHeader = CEikonEnv::Static()->AllocReadResourceL( R_TEXT_RESOURCE_DETAILS_VIEW_HEADER );
+    _LIT( KHeader, "Certificate details" );
+    iHeader = KHeader().AllocL();
+
+    SetHeaderTextL( *iHeader );
+    iMessage = iNotifier.CreateMessageL();
+    SetMessageTextL( *iMessage );
     }
 
 CCTCertificateQuery::~CCTCertificateQuery()
--- a/pkiutilities/CTSecurityDialogs/NotifSrc/CTInvalidCertNote.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CTSecurityDialogs/NotifSrc/CTInvalidCertNote.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 
-
+#include <platform/e32notif.h>
 #include "CTInvalidCertNote.h"
 #include "CTCertificateQuery.h"     // CCTCertificateQuery
 #include <uikon/eiksrvui.h>         // CEikServAppUi
--- a/pkiutilities/CTSecurityDialogs/NotifSrc/CTNoTrustQuery.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,212 +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:  
-*
-*/
-
-
-
-// INCLUDE FILES
-
-#include "CTNoTrustQuery.h"
-#include "CTSecurityDialogsAO.h"
-#include "CTCertificateQuery.h"
-#include <aknlists.h>
-#include <CTSecDlgs.rsg>
-#include <uikon/eiksrvui.h>
-#include <StringLoader.h>
-
-
-// ================= MEMBER FUNCTIONS ==========================================
-
-// -----------------------------------------------------------------------------
-// CSecNotNoTrustQuery::CCTNoTrustQuery()
-// -----------------------------------------------------------------------------
-//
-CCTNoTrustQuery::CCTNoTrustQuery(
-    CCTSecurityDialogsAO& aNotifier,
-    TBool& aRetVal,
-    TRequestStatus& aClientStatus,
-    HBufC* aServerName,
-    TBool aShowPermAccept,
-    TBool& aIsDeleted ):
-    CAknQueryDialog( CAknQueryDialog::ENoTone ),
-    iNotifier( aNotifier ),
-    iRetVal( aRetVal ),
-    iClientStatus( &aClientStatus ),
-    iServerName( aServerName ),
-    iShowPermAccept( aShowPermAccept ),
-    iDeleted( aIsDeleted )
-    {
-    iDeleted = EFalse;
-    }
-
-// -----------------------------------------------------------------------------
-// CSecNotNoTrustQuery::~CCTNoTrustQuery()
-// -----------------------------------------------------------------------------
-//
-CCTNoTrustQuery::~CCTNoTrustQuery()
-    {
-    // Allow application switching again
-    CEikonEnv* eikonEnv = CEikonEnv::Static();
-    if( eikonEnv )
-        {
-        CEikServAppUi* eikServAppUi = static_cast<CEikServAppUi*>( eikonEnv->EikAppUi() );
-        if( eikServAppUi )
-            {
-            eikServAppUi->SuppressAppSwitching( EFalse );
-            }
-        }
-
-    // Complete the client request
-    if( iClientStatus && *iClientStatus == KRequestPending )
-        {
-        iRetVal = EFalse;
-        User::RequestComplete( iClientStatus, KErrNone );
-        }
-    
-    // Notify that the dialog has been deleted
-    iDeleted = ETrue;
-    }
-
-// -----------------------------------------------------------------------------
-// CSecNotNoTrustQuery::OkToExitL()
-// -----------------------------------------------------------------------------
-//
-TBool CCTNoTrustQuery::OkToExitL( TInt aButtonId )
-    {
-    if ( aButtonId == EAknSoftkeyOptions || aButtonId == EAknSoftkeyOk )
-        {
-        return OptionsMenuL();
-        }
-    else
-        {
-        iRetVal = EFalse;
-        User::RequestComplete( iClientStatus, KErrNone );
-        }
-    return ETrue;
-    }
-
-// -----------------------------------------------------------------------------
-// CCTNoTrustQuery::PostLayoutDynInitL()
-// -----------------------------------------------------------------------------
-//
-void CCTNoTrustQuery::PostLayoutDynInitL()
-    {
-    CAknQueryControl* control = QueryControl();
-    if (control)
-        control->StartAnimationL();
-    ((CEikServAppUi*)(CEikonEnv::Static())->EikAppUi())->SuppressAppSwitching( ETrue );
-    }
-
-// -----------------------------------------------------------------------------
-// CCTNoTrustQuery::OptionsMenuL()
-// -----------------------------------------------------------------------------
-TBool CCTNoTrustQuery::OptionsMenuL()
-    {
-    TBool ret = EFalse;
-    CAknSinglePopupMenuStyleListBox* list =
-        new( ELeave ) CAknSinglePopupMenuStyleListBox;
-    CleanupStack::PushL( list );
-    CAknPopupList* popupList = CAknPopupList::NewL(
-        list, R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT, AknPopupLayouts::EMenuWindow );
-    CleanupStack::PushL( popupList );
-    list->ConstructL( popupList, CEikListBox::ELeftDownInViewRect );
-    list->CreateScrollBarFrameL( ETrue );
-    list->ScrollBarFrame()->SetScrollBarVisibilityL(
-        CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
-
-    TInt resourceid;
-
-    if ( iShowPermAccept )
-        {
-        resourceid = R_NOTRUST_MENUPANE;
-        }
-    else
-        {
-        resourceid = R_NOTRUST_MENUPANE_NO_PERM;
-        }
-
-     CDesCArrayFlat* items =
-            CEikonEnv::Static()->ReadDesCArrayResourceL( resourceid );
-
-    CTextListBoxModel* model = list->Model();
-    model->SetOwnershipType( ELbmOwnsItemArray );
-    model->SetItemTextArray( items );
-
-    CleanupStack::Pop( popupList ); //popupList
-    if ( popupList->ExecuteLD() )
-        {
-        if( !iDeleted )
-            {
-            TInt index = list->CurrentItemIndex();
-            if ( index == 0 )       // Accept now
-                {
-                iRetVal = EServerCertAcceptedTemporarily;
-                User::RequestComplete(iClientStatus, KErrNone);
-                ret = ETrue;
-                }
-            else if (( index == 1 ) && ( resourceid == R_NOTRUST_MENUPANE ))  // Accept permanently
-                {
-    
-                HBufC* prompt = StringLoader::LoadLC( R_QTN_HTTPSEC_QUERY_PERM_ACCEPT_TEXT, *iServerName );
-    
-                CAknMessageQueryDialog* note = CAknMessageQueryDialog::NewL( *prompt );
-    
-                note->PrepareLC( R_HTTPSEC_QUERY_PERM_ACCEPT );
-                note->SetPromptL( *prompt );
-    
-                if ( note->RunLD() )
-                    {
-                    iRetVal = EServerCertAcceptedPermanently;
-                    User::RequestComplete( iClientStatus, KErrNone );
-                    ret = ETrue;
-                    }
-                else
-                    {
-                    ret = EFalse;
-                    }
-    
-                CleanupStack::PopAndDestroy( prompt );
-                }
-            else if ((( index == 2 ) && ( resourceid == R_NOTRUST_MENUPANE ))  ||
-                     (( index == 1 ) && ( resourceid == R_NOTRUST_MENUPANE_NO_PERM )) ) // Details
-                {
-                // We need to delay this implementation in other releases, because
-                // separate ICD was taken to 3.0.
-                CCTCertificateQuery* query =
-                CCTCertificateQuery::NewL( iNotifier );
-                query->ExecuteLD( R_NOTRUST_CERTIFICATE_QUERY );
-                ret = EFalse;
-                }
-            else
-                {
-                iRetVal = EServerCertNotAccepted;
-                User::RequestComplete( iClientStatus, KErrNone );
-                ret = ETrue;
-                }
-            }
-        else
-            {
-            ret = EFalse;
-            }
-        }
-    else
-        {
-        ret = EFalse;
-        }
-    CleanupStack::PopAndDestroy( list );  // list
-    return ret;
-    }
-
--- a/pkiutilities/CTSecurityDialogs/NotifSrc/CTPinPinQueryDialog.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CTSecurityDialogs/NotifSrc/CTPinPinQueryDialog.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -17,6 +17,7 @@
 
 
 // INCLUDE FILES
+#include <platform/e32notif.h>
 #include "CTPinPinQueryDialog.h"
 #include <CTSecDlgs.rsg>
 #include <eikenv.h>
--- a/pkiutilities/CTSecurityDialogs/NotifSrc/CTQueryDialog.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CTSecurityDialogs/NotifSrc/CTQueryDialog.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -19,6 +19,7 @@
 
 // INCLUDE FILES
 
+#include <platform/e32notif.h>
 #include "CTQueryDialog.h"
 #include "CTSecurityDialogsLogger.h"
 #include <CTSecDlgs.rsg>
--- a/pkiutilities/CTSecurityDialogs/NotifSrc/CTSecurityDialogsAO.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CTSecurityDialogs/NotifSrc/CTSecurityDialogsAO.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -19,17 +19,17 @@
 // INCLUDE FILES
 #include "CTSecurityDialogsAO.h"
 #include "CTSecurityDialogNotifier.h"
-#include "CTPinQueryDialog.h"
-#include "CTSignTextDialog.h"
-#include "CTSelectCertificateDialog.h"
-#include "CTQueryDialog.h"
-#include "CTPinPinQueryDialog.h"
-#include "CTNoTrustQuery.h"
-#include "CTInvalidCertNote.h"
+//#include "CTPinQueryDialog.h"
+//#include "CTSignTextDialog.h"
+//#include "CTSelectCertificateDialog.h"
+//#include "CTQueryDialog.h"
+//#include "CTPinPinQueryDialog.h"
+#include "CTUntrustedCertQuery.h"
+//#include "CTInvalidCertNote.h"
 #include <PKIDlg.h>
 #include <badesca.h>
 #include <StringLoader.h>
-#include <aknnotewrappers.h>
+//#include <aknnotewrappers.h>
 #include <unifiedcertstore.h>
 #include <unifiedkeystore.h>
 #include <mctkeystore.h>
@@ -37,7 +37,7 @@
 #include <DocumentHandler.h>
 #include <apmstd.h>
 #include <DigSigningNote.h>
-#include <certmanui.rsg>
+//#include <certmanui.rsg>
 #include <X509CertNameParser.h>
 #include <x509cert.h>
 #include <x500dn.h>
@@ -45,7 +45,13 @@
 #include <x509certext.h>
 #include <TrustedSitesStore.h>
 #include <mctwritablecertstore.h>
-#include <coreapplicationuisdomainpskeys.h>			// KCoreAppUIsAutolockStatus
+#include <eikenv.h>                         // CEikonEnv
+#include <AknUtils.h>                       // AknTextUtils
+
+#include "SecQueryUi.h"                   // needed for password dialog
+
+#include <hbdevicemessageboxsymbian.h>    // needed for Note dialogs    
+#include <hbdevicenotificationdialogsymbian.h>
 
 // LOCAL CONSTANTS AND MACROS
 const TInt KCertArrayGranularity = 3;
@@ -54,8 +60,6 @@
 const TInt KMaxLengthTextCertLabelVisible = 200;
 // "dd/mm/yyyy0"
 const TInt KMaxLengthTextDateString = 20;
-// HH0
-const TInt KMaxLengthTextSerialNumberFormatting = 3;
 // Maximum length of a certificate
 const TInt KMaxCertificateLength = 5000;
 
@@ -64,12 +68,8 @@
 
 const TInt KMinImportKeyPwLen = 1;
 
-const TInt KMaxCNLength = 64;
+const TInt KMaxCommonNameLength = 64;
 
-_LIT(KCertManUIDetailsViewHexFormat, "%02X");
-
-const TInt KFileCertStoreUid( 0x101F501A );
-const TInt KWIMCertStoreUid ( 0x101F79D9 );
 const TUid KTrustedServerTokenUid = { 0x101FB66F };
 const TUid KDeviceCertStoreTokenUid = { 0x101FB668 };
 
@@ -83,43 +83,15 @@
 _LIT( KPKCS12TokenLabel, "PKCS12");
 
 
-// ============================ LOCAL FUNCTIONS ===============================
-
-TInt AlgorithmNameResourceId( TAlgorithmId aAlgorithmId )
-    {
-    TInt resourceId = 0;
-    switch( aAlgorithmId )
-        {
-        case ERSA:
-            resourceId = R_TEXT_RESOURCE_DETAILS_VIEW_ALGORITHM_RSA;
-            break;
-        case EDSA:
-            resourceId = R_TEXT_RESOURCE_DETAILS_VIEW_ALGORITHM_DSA;
-            break;
-        case EDH:
-            resourceId = R_TEXT_RESOURCE_DETAILS_VIEW_ALGORITHM_DH;
-            break;
-        case EMD2:
-            resourceId = R_TEXT_RESOURCE_DETAILS_VIEW_ALGORITHM_MD2;
-            break;
-        case EMD5:
-            resourceId = R_TEXT_RESOURCE_DETAILS_VIEW_ALGORITHM_MD5;
-            break;
-        case ESHA1:
-            resourceId = R_TEXT_RESOURCE_DETAILS_VIEW_ALGORITHM_SHA1;
-            break;
-        case ESHA224:
-        case ESHA256:
-        case ESHA384:
-        case ESHA512:
-            resourceId = R_TEXT_RESOURCE_DETAILS_VIEW_ALGORITHM_SHA2;
-            break;
-        default:
-            resourceId = R_TEXT_RESOURCE_DETAILS_VIEW_UNKNOWN;
-            break;
-        }
-    return resourceId;
-    }
+// TODO: replace with OST tracing
+#ifdef _DEBUG
+#include <e32debug.h>
+#define TRACE(x)        RDebug::Printf(x)
+#define TRACE1(x,y)     RDebug::Printf(x,y)
+#else
+#define TRACE(x)
+#define TRACE1(x,y)
+#endif
 
 
 // ============================ MEMBER FUNCTIONS ===============================
@@ -147,9 +119,6 @@
 void CCTSecurityDialogsAO::ConstructL()
     {
     iDeleted = EFalse;
-
-    iQueryDialog = NULL;
-    iQueryDialogDeleted = ETrue;
     }
 
 // -----------------------------------------------------------------------------
@@ -225,6 +194,7 @@
     iMessagePtr = aMessage;
 
     WIMSECURITYDIALOGS_WRITE_FORMAT( "CCTSecurityDialogsAO::StartLD iOperation=%d", iOperation );
+    TRACE1( "CCTSecurityDialogsAO::StartLD iOperation=%d", iOperation );
 
     MapTlsProviderOperation( iOperation );
 
@@ -305,7 +275,10 @@
             pinLabel.Copy( pinLabelPtr );
             HBufC* text = iNotifier->LoadResourceStringLC( iOperation, pinLabel );
 
-            CCTSignTextDialog::RunDlgLD( R_WIM_UNBLOCK_INFO_DIALOG, *text, iStatus, iRetValue );
+            // TODO
+            //CCTSignTextDialog::RunDlgLD( R_WIM_UNBLOCK_INFO_DIALOG, *text, iStatus, iRetValue );
+            User::Leave( KErrGeneral );
+
             CleanupStack::PopAndDestroy( text );
             iStatus = KRequestPending;
             SetActive();
@@ -379,6 +352,8 @@
 //
 void CCTSecurityDialogsAO::DoHandleServerAuthFailL( const TDesC8& aBuffer )
     {
+    TRACE( "CCTSecurityDialogsAO::DoHandleServerAuthFailL" );
+
     CServerAuthenticationFailureInput* srvAuthFail =
         CServerAuthenticationFailureInput::NewLC( aBuffer );
     TPtrC8 cert;
@@ -391,33 +366,31 @@
 
     iServerName = HBufC::NewL( serverName.Length() );
     iServerName->Des().Copy( serverName );
+    iCertLabel = NULL;
 
-    HBufC* cn = NULL;
-    iCertLabel = NULL;
     // Site will be checked later. For now it is not trusted
     iTrustedSite = EFalse;
 
-
     CX509Certificate* serverCert = CX509Certificate::NewLC( cert );
-    // Retrieve subject name
     const CX500DistinguishedName& dName = serverCert->SubjectName();
-    // Retrieve CN
-    cn = dName.ExtractFieldL( KX520CommonName );
-    if ( cn != NULL )
+
+    HBufC* commonName = dName.ExtractFieldL( KX520CommonName );
+    CleanupStack::PushL( commonName );
+    if( commonName != NULL )
         {
-        // commonName exist in the certificate.
         // Check the length of CN. RFC 3280 states
         // that max length of CN is 64.
-        if ( cn->Length() <= KMaxCNLength )
+        if( commonName->Length() <= KMaxCommonNameLength )
             {
-            iCertLabel = HBufC::NewL( cn->Length() );
-            iCertLabel->Des().Append( cn->Des() );
+            iCertLabel = HBufC::NewL( commonName->Length() );
+            iCertLabel->Des().Append( commonName->Des() );
             }
         }
+    CleanupStack::PopAndDestroy( commonName );
 
-    if ( iCertLabel == NULL )
+    if( iCertLabel == NULL )
         {
-        // No or invalid commonName. Use domain name as label
+        // No or invalid commonName. Use domain name as label.
         iCertLabel = HBufC::NewL( iServerName->Length() );
         iCertLabel->Des().Append( iServerName->Des() );
         }
@@ -536,17 +509,22 @@
         {
         case EUserAuthenticationText:
             {
-            CCTSignTextDialog::RunDlgLD( R_WIM_USERAUTHTEXT_DIALOG,
-                *textToSign, iStatus, iRetValue );
+            // TODO
+            //CCTSignTextDialog::RunDlgLD( R_WIM_USERAUTHTEXT_DIALOG,
+            //    *textToSign, iStatus, iRetValue );
+            User::Leave( KErrGeneral );
             break;
             }
         case EUserAuthentication:
             {
+            DoHandleMessageL( EUserAuthentication, KNullDesC, KNullDesC, 1, KMaxTInt );
             break;
             }
         case ESignText:
             {
-            CCTSignTextDialog::RunDlgLD( R_WIM_SIGNTEXT_DIALOG,*textToSign, iStatus, iRetValue );
+            // TODO
+            //CCTSignTextDialog::RunDlgLD( R_WIM_SIGNTEXT_DIALOG,*textToSign, iStatus, iRetValue );
+            User::Leave( KErrGeneral );
             break;
             }
         default:
@@ -598,6 +576,7 @@
     if ( iRetry ) // Is this new try?
       {
         // Previous attempt was failed
+        // incorrect pin code
         DoHandleMessageL( EErrorPinCodeIncorrect, KNullDesC, KNullDesC, 0, 0 );
       }
     // Ask the PIN code or PUK code
@@ -605,11 +584,13 @@
         {
         HBufC* header = StringLoader::LoadLC(
             R_QTN_CM_HEADING_PHONE_KEYSTORE, CEikonEnv::Static() );
-        iPIN.iMinLength = KMaxKeystorePwLength;
+		iPIN.iMinLength = KMaxKeystorePwLength;
         DoHandleMessageL( EEnterKeyStorePw, KNullDesC, *header,
             iPIN.iMinLength, iPIN.iMaxLength );
         iMultiLineDlgType = EEnterNewKeyStorePw;
         CleanupStack::PopAndDestroy( header );
+        RunL();
+
         }
     else if ( iPIN.iPINLabel == KKeyStoreImportKeyLabel )
         {
@@ -626,7 +607,7 @@
     else if ( iPIN.iPINLabel == KKeyStoreCreatePwLabel )
         {
         iPIN.iMinLength = KMaxKeystorePwLength;
-        DoHandleMessageL( EInfoPwCreating, KNullDesC, KNullDesC, 0, 0 );
+        ShowInformationNoteL(R_QTN_CM_CREATING_KEYSTORE);
         DoHandleMultilinePinQueryL( EEnterNewKeyStorePw );
         iNextStep = EVerifyPINs;
         }
@@ -651,8 +632,10 @@
 // CCTSecurityDialogsAO::DoHandleMultilinePinQueryL()
 // -----------------------------------------------------------------------------
 //
-void CCTSecurityDialogsAO::DoHandleMultilinePinQueryL( const TInt& aDlgType )
+void CCTSecurityDialogsAO::DoHandleMultilinePinQueryL( const TInt& /*aDlgType*/ )
     {
+    // TODO
+#if 0
     iMultiLineDlgType = aDlgType;
     HBufC* dlgText1 = NULL;
     HBufC* dlgText2 = NULL;
@@ -660,12 +643,37 @@
     TDialogType dlgType = ( TDialogType )aDlgType;
     if ( EEnterNewKeyStorePw == dlgType )
         {
+/*
         dlgText1 = iNotifier->LoadResourceStringLC( dlgType, KNullDesC );
         dlgText2 = iNotifier->LoadResourceStringLC( EVerifyKeyStorePw, KNullDesC );
         dlg = CCTPinPinQueryDialog::NewL( *dlgText1, *dlgText2, iPINValue2,
-            iPINValueVerify, iPIN.iMinLength, iPIN.iMaxLength, iRetValue );
+            iPINValueVerify, iPIN.iMinLength, iPIN.iMaxLength, iRetValue );16:19:13.812 xti1:MCU_ASCII_PRINTF; channel:0xE0; msg:*PlatSec* ERROR - Capability check failed - Process #tlstest[e8dc94b1]0001 was checked by Thread c32exe.exe[101f7989]0001::ESock_IP and was found to be missing the capabilities: NetworkControl .
+
         dlg->RunDlgLD( iStatus, R_WIM_PWPW_QUERY_DIALOG );
         CleanupStack::PopAndDestroy( 2, dlgText1 ); // dlgText1, dlgText2
+*/
+        dlgText1 =  StringLoader::LoadLC( R_QTN_SN_NEW_PHONE_KEYSTORE );
+        dlgText2 = StringLoader::LoadLC( R_QTN_WIM_VERIFY_PIN );
+        HBufC* message = HBufC::NewLC( KMaxLengthTextCertLabelVisible );
+        message->Des().Append(dlgText1->Des());
+        message->Des().Append(_L("|"));
+        message->Des().Append(dlgText2->Des());
+        CSecQueryUi* SecQueryUi = CSecQueryUi::NewL();
+        TInt queryAccepted = SecQueryUi->SecQueryDialog(message->Des(), iPINValueVerify,
+                                                    iPIN.iMinLength,iPIN.iMaxLength,
+                                                    ESecUiAlphaSupported |
+                                                    ESecUiCancelSupported |
+                                                    ESecUiSecretSupported |
+                                                    ESecUiEmergencyNotSupported);
+        iRetValue=(queryAccepted==KErrNone);
+        if(iRetValue)
+            iPINValue2.Copy(iPINValueVerify); // dialog already does not OK with different pin codes
+        delete SecQueryUi;
+        SecQueryUi=NULL;
+        CleanupStack::PopAndDestroy( message );
+        CleanupStack::PopAndDestroy( dlgText2 );
+        CleanupStack::PopAndDestroy( dlgText1 );
+        RunL(); // had to call it this way
         }
     else if ( EExportKeyPw == dlgType )
         {
@@ -685,6 +693,8 @@
         dlg->RunDlgLD( iStatus, R_WIM_PINPIN_QUERY_DIALOG );
         CleanupStack::PopAndDestroy( 2, dlgText1 ); // dlgText1, dlgText2
         }
+#endif
+    User::Leave( KErrGeneral );
     }
 
 // -----------------------------------------------------------------------------
@@ -704,7 +714,7 @@
 
   TDialogTypeItem item = iNotifier->GetDialogTypeItem( dlgType );
 
-  CAknResourceNoteDialog* dlg = NULL;
+  //CAknResourceNoteDialog* dlg = NULL;
 
   TInt resource = 0;
 
@@ -712,44 +722,62 @@
         {
         case EInfoNote:
             {
-            dlg = new ( ELeave ) CAknInformationNote( ETrue );
+            // TODO
+            //dlg = new ( ELeave ) CAknInformationNote( ETrue );
+            User::Leave( KErrGeneral );
             break;
             }
 
         case EErrorNote:
             {
-            dlg = new ( ELeave ) CAknErrorNote( ETrue );
+            // TODO
+            //dlg = new ( ELeave ) CAknErrorNote( ETrue );
+            User::Leave( KErrGeneral );
             break;
             }
         case EConfirmationNote:
             {
-            dlg = new ( ELeave ) CAknConfirmationNote( ETrue );
+            // TODO
+            //dlg = new ( ELeave ) CAknConfirmationNote( ETrue );
+            User::Leave( KErrGeneral );
             break;
             }
         case EInfoDialog:
             {
+            // TODO
+            /*
             CCTQueryDialog::RunDlgLD( iStatus,
                                         iRetValue,
                                         *dlgText, item.iSoftKeyResource,
                                         ECTInfoDialog );
             iStatus = KRequestPending;
             SetActive();
+            */
+            User::Leave( KErrGeneral );
             break;
             }
         case EEnterPwPwDialog:
             {
+            // TODO
+            /*
             CCTPinPinQueryDialog* dialog =
                 CCTPinPinQueryDialog::NewL( *dlgText, *dlgText,
                 iPINValue2, iPINValueVerify, aMinLength, aMaxLength, iRetValue );
             dialog->RunDlgLD( iStatus, R_WIM_PWPW_QUERY_DIALOG );
+            */
+            User::Leave( KErrGeneral );
             break;
             }
         case EEnterPinPinCodeDialog:
             {
+            // TODO
+            /*
             CCTPinPinQueryDialog* dialog =
                 CCTPinPinQueryDialog::NewL( *dlgText, *dlgText,
                 iPINValue2, iPINValueVerify, aMinLength, aMaxLength, iRetValue );
             dialog->RunDlgLD( iStatus, R_WIM_PINPIN_QUERY_DIALOG );
+            */
+            User::Leave( KErrGeneral );
             break;
             }
         case EEnterPwDialog:
@@ -793,17 +821,41 @@
                     User::Panic(_L("CSecDlgNotifier"), 0);
                     }
                 }
-               iPinQueryDialogDeleted = EFalse;
-                CCTPinQueryDialog::RunDlgLD( iStatus,
-                                        *dlgText,
-                                        *pinValue,
-                                        aMinLength,
-                                        aMaxLength,
-                                        iRetValue,
-                                        resource,
-                                        iPinQueryDialog,
-                                        iPinQueryDialogDeleted );
+               //iPinQueryDialogDeleted = EFalse;
+               if(aDlgType!=EEnterKeyStorePw) {
+                   // TODO
+                   /*
+                   CCTPinQueryDialog::RunDlgLD( iStatus,
+                                            *dlgText,
+                                            *pinValue,
+                                            aMinLength,
+                                            aMaxLength,
+                                            iRetValue,
+                                            resource,
+                                            iPinQueryDialog,
+                                            iPinQueryDialogDeleted );
+                    */
+                   User::Leave( KErrGeneral );
+                   resource = resource;     // avoids compiler warning
+                   break;
+               }
+               else
+               {
+                iPIN.iMinLength = KMaxKeystorePwLength;
+                CSecQueryUi* SecQueryUi = CSecQueryUi::NewL();
+                HBufC* header =StringLoader::LoadLC( R_QTN_SN_ENTER_PHONE_KEYSTORE);
+                TInt queryAccepted = SecQueryUi->SecQueryDialog(header->Des(), *pinValue,
+                                                        aMinLength,aMaxLength,
+                                                        ESecUiAlphaSupported |
+                                                        ESecUiCancelSupported |
+                                                        ESecUiSecretSupported |
+                                                        ESecUiEmergencyNotSupported);
+                delete SecQueryUi;
+                SecQueryUi=NULL;
+                iRetValue=(queryAccepted==KErrNone);
+                CleanupStack::PopAndDestroy( header );
                 break;
+               }
             }
     default:
             {
@@ -811,12 +863,16 @@
             }
 
       }
+  // TODO
+  /*
+  if ( dlg && aDlgType!=EEnterKeyStorePw)
+      {
 
-  if ( dlg )
-      {
       dlg->ExecuteLD( *dlgText );
       dlg = NULL;
       }
+      */
+  User::Leave( KErrGeneral );
 
     CleanupStack::PopAndDestroy( dlgText ); // dlgText
     }
@@ -841,6 +897,8 @@
 //
 void CCTSecurityDialogsAO::InitCertStoreL()
     {
+    TRACE( "CCTSecurityDialogsAO::InitCertStoreL" );
+
     switch(iOperation)
         {
         case ESignText:
@@ -976,13 +1034,15 @@
     {
     WIMSECURITYDIALOGS_WRITE_FORMAT( "CCTSecurityDialogsAO::RunL, iStatus %d", iStatus.Int() );
     WIMSECURITYDIALOGS_WRITE_FORMAT( "  iNextStep %d", iNextStep );
+    TRACE1( "CCTSecurityDialogsAO::RunL, iStatus.Int()=%d", iStatus.Int() );
 
-    if ( iStatus != KErrNone )
+    if( iStatus != KErrNone )
         {
         User::Leave( iStatus.Int() );
-        } // if
+        }
 
-    switch ( iNextStep )
+    TRACE1( "CCTSecurityDialogsAO::RunL, iNextStep=%d", iNextStep );
+    switch( iNextStep )
       {
       case EOperationCompleted:
         {
@@ -990,35 +1050,34 @@
         HandleResponseAndCompleteL();
         break;
         }
+
       case ECheckServerCerts:
         {
         WIMSECURITYDIALOGS_WRITE( "ECheckServerCerts" );
 
         TBool foundCert( EFalse );
 
-        if ( iServerCerts.Count() )
+        if( iServerCerts.Count() )
             {
             // Found certificates in the trusted site certificate storage.
             // Compare them with the one received from TlsProvider
             iCertPtr.Set( iCertBuf->Des() );
             CX509Certificate* serverCert = CX509Certificate::NewLC( iCertPtr );
 
-            for (TInt i=0; i<iServerCerts.Count(); i++ )
+            for( TInt i = 0; i < iServerCerts.Count(); i++ )
                 {
                 TPtr8 certPtr( iServerCerts[i]->Des() );
-
                 CX509Certificate* cert = CX509Certificate::NewLC( certPtr );
-
-                // Compare fingerprints
-                if ( cert->Fingerprint() == serverCert->Fingerprint() )
+                if( cert->Fingerprint() == serverCert->Fingerprint() )
                     {
-                    // Fingerprints match
                     foundCert = ETrue;
                     }
                 CleanupStack::PopAndDestroy( cert );
                 }
+
              CleanupStack::PopAndDestroy( serverCert );
-             if ( foundCert )
+
+             if( foundCert )
                 {
                 // Found matching certificate. Complete the operation
                 iRetValue = EServerCertAcceptedPermanently;
@@ -1027,24 +1086,26 @@
                 }
             }
 
-            if ( !foundCert )
-                {
-                // Couldn't find matching certificate. Prompt user
-                ShowNoTrustDialogL();
-                }
-
+        if ( !foundCert )
+            {
+            // Couldn't find matching certificate. Prompt user
+            ShowNoTrustDialogL();
+            }
         break;
         }
+
       case EProcessTrustedSite:
         {
         WIMSECURITYDIALOGS_WRITE( "EProcessTrustedSite" );
+        TRACE( "CCTSecurityDialogsAO::RunL, EProcessTrustedSite" );
+
         TInt count = iCertStore->WritableCertStoreCount();
-        for ( TInt i = 0; i < count; i++ )
+        for( TInt i = 0; i < count; i++ )
             {
             MCTWritableCertStore *certstore = &iCertStore->WritableCertStore( i );
             MCTToken& token = certstore->Token();
             TUid tokenuid = token.Handle().iTokenTypeUid;
-            if ( tokenuid == KTrustedServerTokenUid )
+            if( tokenuid == KTrustedServerTokenUid )
                 {
                 iTrustedSiteCertStore = certstore;
                 }
@@ -1056,11 +1117,11 @@
         // Find out whether or not site associated with certificate is trusted
         iTrustedSite = trustedSitesStore->IsTrustedSiteL( *iCertBuf, *iServerName );
 
-        if ( iTrustedSite )
+        if( iTrustedSite )
             {
             TBool allowOutOfDate = trustedSitesStore->IsOutOfDateAllowedL(*iCertBuf, *iServerName);
 
-            if (!allowOutOfDate)
+            if( !allowOutOfDate )
                 {
                 CX509Certificate* cert = CX509Certificate::NewLC( iCertBuf->Des() );
 
@@ -1081,7 +1142,7 @@
             }
         CleanupStack::PopAndDestroy( trustedSitesStore );
 
-        if ( iTrustedSite )
+        if( iTrustedSite )
             {
             // Site is trusted. Next step is to check that server
             // certificate is in the trusted site certificate storage
@@ -1148,9 +1209,11 @@
             }
         break;
         }
+
       case EAddTrustedSite:
           {
-          if ( iStatus.Int() == KErrNone )
+          TRACE( "CCTSecurityDialogsAO::RunL, EAddTrustedSite" );
+          if( iStatus.Int() == KErrNone )
               {
               //Added server certificate succesfully
               CTrustSitesStore* trustedSitesStore = CTrustSitesStore::NewL();
@@ -1159,7 +1222,7 @@
               TInt status = trustedSitesStore->AddL( *iCertBuf, *iServerName );
 
               CleanupStack::PopAndDestroy( trustedSitesStore );
-              if ( status  == KErrNone )
+              if( status  == KErrNone )
                   {
                   iRetValue = EServerCertAcceptedPermanently;
                   }
@@ -1174,23 +1237,27 @@
           else
               {
               //Adding server certificate failed
+              // TODO: unreached code?
               iNextStep = EOperationCompleted;
               iRetValue = EServerCertNotAccepted;
               HandleResponseAndCompleteL();
               }
-              break;
+          break;
           }
 
       case ESaveServerCert:
           {
           WIMSECURITYDIALOGS_WRITE( "ESaveServerCert" );
+          TRACE( "CCTSecurityDialogsAO::RunL, ESaveServerCert" );
           DoHandleSaveServerCertL();
           break;
           }
+
       case EServerCertCheckUserResp:
           {
           WIMSECURITYDIALOGS_WRITE( "EServerCertCheckUserResp" );
-          if ( iRetValue == EServerCertAcceptedPermanently )
+          TRACE( "CCTSecurityDialogsAO::RunL, EServerCertCheckUserResp" );
+          if( iRetValue == EServerCertAcceptedPermanently )
               {
               // User accepted to select certificate permanently.
               // First add server certificate
@@ -1207,6 +1274,7 @@
               }
           break;
           }
+
       case EOperationSignTextShown:
           {
           if ( iRetValue || iOperation == EUserAuthentication )
@@ -1223,6 +1291,7 @@
           User::RequestComplete( status, KErrNone );
           break;
           }
+
       case EOperationInitCertStore:
           {
           TInt err = KErrNone;
@@ -1240,6 +1309,7 @@
           iNextStep = EOperationRetrieveCertInfos;
           break;
           }
+
       case EOperationRetrieveCertInfos:
           {
           if ( iCertInfo )
@@ -1275,11 +1345,13 @@
               }
           break;
           }
+
       case EOperationSelectCert:
           {
           DoHandleSelectCertificateL();
           break;
           }
+
       case EGetCertInfo:
           {
           iStatus = KRequestPending;
@@ -1289,6 +1361,7 @@
           SetActive();
           break;
           }
+
       case EGetCertificate:
           {
           iStatus = KRequestPending;
@@ -1308,36 +1381,42 @@
           iNextStep = EInitKeyStore;
           break;
           }
+
       case EInitKeyStore:
           {
           InitKeyStoreL();
           iNextStep = EGetKeyInfos;
           break;
           }
+
       case EGetKeyInfos:
           {
           GetKeyInfosL();
           iNextStep = EShowCertDialog;
           break;
           }
+
       case EGetKeyInfoByHandle:
           {
           GetKeyInfoByHandleL();
           iNextStep = EShowCSRDialog;
           break;
           }
+
       case EShowCSRDialog:
           {
           ShowCSRDialogL();
           iNextStep = EOperationCompleted;
           break;
           }
+
       case EShowCertDialog:
           {
           ShowCertDialogL();
           iNextStep = EOperationCompleted;
           break;
           }
+
       /////////////
       // PIN steps
       /////////////
@@ -1380,11 +1459,13 @@
               }
           break;
           }
+
       case EVerifyPINs:
           {
           VerifyPinsL();
           break;
           }
+
       default:
           {
           User::Panic( _L("CTestSecDlgNotifier"), 0 );
@@ -1458,6 +1539,7 @@
         {
         // No certificate from Device Certificate Store. Prompt user
         // for certificate selection
+    /*
         CCTSelectCertificateDialog::RunDlgLD(
             iCertArray, iCertHandleList, iTokenHandle,
             iStatus, iRetValue ); // Takes ownerhip of array
@@ -1465,6 +1547,8 @@
         iNextStep = EOperationCompleted;
         iStatus = KRequestPending;
         SetActive();
+    */
+        User::Leave( KErrGeneral );     // TODO: to be implemented
         }
     }
 
@@ -1474,117 +1558,40 @@
 //
 void CCTSecurityDialogsAO::ShowNoTrustDialogL()
     {
-    // Cannot display untrusted certificate dialog if device is locked. Untrusted
-    // certificate dialog would be displayed on top of possible lock code query.
-    TInt value = 0;
-    TInt err = RProperty::Get( KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, value );
-    if( !err && value != EAutolockOff )
-        {
-        iRetValue = EServerCertNotAccepted;
-        iStatus = KRequestPending;
-        TRequestStatus* status( &iStatus );
-        User::RequestComplete( status, KErrNone );
-        }
-    else
-        {
-        CX509Certificate* cert = CX509Certificate::NewLC( iCertBuf->Des() );
-        TInt dialogResourceId = R_WIM_NO_TRUST_QUERY_UNTRUSTED;
-        TInt promptResourceId = R_QTN_ICS_SSL_CONF_Q_ACCEPT_UNTRUSTED;
-        TBool showPermAccept = ETrue;
+    TRACE( "CCTSecurityDialogsAO::ShowNoTrustDialogL, begin" );
 
-        if( iAuthFailReason == ESignatureInvalid || iAuthFailReason == ECertificateRevoked )
-            {
-            // Invalid or revoked certificate
-            CCTInvalidCertificateNote* note =
-                new( ELeave ) CCTInvalidCertificateNote( *this, iStatus );
-            note->ExecuteLD( R_WIM_INVALID_CERTIFICATE_INFORMATION_NOTE );
-            iRetValue = EServerCertNotAccepted;
-
-            // CCTNoTrustQuery below self-completes this active object. It is necessary to
-            // complete it here too, in order to run the next step EServerCertCheckUserResp.
-            iStatus = KRequestPending;
-            TRequestStatus* status( &iStatus );
-            User::RequestComplete( status, KErrNone );
-            }
-        else
-            {
-            if( iAuthFailReason == EValidatedOK || iAuthFailReason == EDateOutOfRange )
-                {
-                // Trusted certificate, but problems with CN or date
-
-                // Retrieve subject name
-                const CX500DistinguishedName& dName = cert->SubjectName();
-
-                // Retrieve common name
-                HBufC* cn = dName.ExtractFieldL( KX520CommonName );
+    // If trusted site certstore open has failed, then it is not possible to save
+    // the host name for permanent use. Hence, choice for permanent accept is not
+    // displayed if trusted site certstore open has failed. Other restrictions for
+    // permanent accept are defined in device dialog (UntrustedCertificateWidget).
+    TBool isTrustedSiteCertStoreOpened = ( iTrustedSiteCertStore != NULL );
+    CCTUntrustedCertQuery *untrustedCertDlg = CCTUntrustedCertQuery::NewLC(
+            iAuthFailReason, *iCertBuf, *iServerName, isTrustedSiteCertStoreOpened );
 
-                // Check common name first and then date
-                if( !cn )
-                    {
-                    // Couldn't retrieve CN from certificate
-                    dialogResourceId = R_WIM_NO_TRUST_QUERY_UNTRUSTED;
-                    promptResourceId = R_QTN_ICS_SSL_CONF_Q_ACCEPT_UNTRUSTED;
-                    }
-                else if( iServerName->Des() != cn->Des() )
-                    {
-                    // Domain name doesn't match with CN
-                    dialogResourceId = R_WIM_NO_TRUST_QUERY_SITE;
-                    promptResourceId = R_QTN_ICS_SSL_CONF_Q_ACCEPT_SITE;
-                    }
-                else if( iAuthFailReason == EDateOutOfRange )
-                    {
-                    // Certificate is out of date
-                    dialogResourceId = R_WIM_NO_TRUST_QUERY_OOD;
-                    promptResourceId = R_QTN_ICS_SSL_CONF_Q_ACCEPT_OOD;
-                    showPermAccept = EFalse;
-                    }
-                else
-                    {
-                    // Otherwise show general untrusted note
-                    dialogResourceId = R_WIM_NO_TRUST_QUERY_UNTRUSTED;
-                    promptResourceId = R_QTN_ICS_SSL_CONF_Q_ACCEPT_UNTRUSTED;
-                    }
-                }
-            else
-                {
-                // Untrusted certificate
-                dialogResourceId = R_WIM_NO_TRUST_QUERY_UNTRUSTED;
-                promptResourceId = R_QTN_ICS_SSL_CONF_Q_ACCEPT_UNTRUSTED;
-                }
-
-            // No "Accept Permanently" option if certificate is out of date, or
-            // if domain name is not defined, or if trusted site store failed to
-            // open (and it's not possible to save the server certificate).
-            const CValidityPeriod& validityPeriod = cert->ValidityPeriod();
-            const TTime& startValue = validityPeriod.Start();
-            const TTime& finishValue = validityPeriod.Finish();
-            TTime current;
-            current.UniversalTime();
-
-            if( (( startValue > current ) || ( finishValue < current )) ||
-                    ( iServerName->Des().Length() == 0 ) ||
-                    ( !iTrustedSiteCertStore ) )
-                {
-                showPermAccept = EFalse;
-                }
-
-            // CCTNoTrustQuery completes iStatus asynchronously when ready. Note that
-            // it happens after ExecuteLD() and also this function have returned.
-            iStatus = KRequestPending;
-
-            iQueryDialog = new( ELeave ) CCTNoTrustQuery( *this, iRetValue, iStatus,
-                    iServerName, showPermAccept, iQueryDialogDeleted );
-            HBufC* prompt = StringLoader::LoadLC( promptResourceId, *iServerName );
-
-            iQueryDialog->ExecuteLD( dialogResourceId, *prompt );
-
-            CleanupStack::PopAndDestroy( prompt );
-            }
-
-        CleanupStack::PopAndDestroy( cert );
+    CCTUntrustedCertQuery::TResponse response = CCTUntrustedCertQuery::EQueryRejected;
+    untrustedCertDlg->ShowQueryAndWaitForResponseL( response );
+    switch( response )
+        {
+        case CCTUntrustedCertQuery::EQueryAccepted:
+            iRetValue = EServerCertAcceptedTemporarily;
+            break;
+        case CCTUntrustedCertQuery::EQueryAcceptedPermanently:
+            // TODO: show confirmation note, qtn_httpsec_query_perm_accept_text
+            // "Connection to site %U will be made in future without any warnings. Continue?""
+            iRetValue = EServerCertAcceptedPermanently;
+            break;
+        case CCTUntrustedCertQuery::EQueryRejected:
+        default:
+            iRetValue = EServerCertNotAccepted;
+            break;
         }
+    CleanupStack::PopAndDestroy( untrustedCertDlg );
+    TRACE1( "CCTSecurityDialogsAO::ShowNoTrustDialogL, iRetValue=%d", iRetValue );
 
     iNextStep = EServerCertCheckUserResp;
+    iStatus = KRequestPending;
+    TRequestStatus* status = &iStatus;
+    User::RequestComplete( status, KErrNone );
     SetActive();
     }
 
@@ -1601,16 +1608,18 @@
 
     messagePtr.Append( KEnter );
 
-    DetailsFieldDynamicL( messagePtr, *iText,
-        R_TEXT_RESOURCE_DETAILS_VIEW_SUBJECT,
-        R_TEXT_RESOURCE_VIEW_NO_SUBJECT_DETAILS );
+    //DetailsFieldDynamicL( messagePtr, *iText,
+    //    R_TEXT_RESOURCE_DETAILS_VIEW_SUBJECT,
+    //    R_TEXT_RESOURCE_VIEW_NO_SUBJECT_DETAILS );
 
     AddKeyUsageL( messagePtr, iKeyInfo );
     AddKeyAlgorithmL( messagePtr, iKeyInfo );
     AddKeySizeL( messagePtr, iKeyInfo );
     AddKeyLocationL( messagePtr, iKeyInfo );
 
-    CCTSignTextDialog::RunDlgLD( R_WIM_CSR_DIALOG, *message, iStatus, iRetValue );
+    // TODO
+    //CCTSignTextDialog::RunDlgLD( R_WIM_CSR_DIALOG, *message, iStatus, iRetValue );
+    User::Leave( KErrGeneral );
     CleanupStack::PopAndDestroy( message );
 
     iStatus = KRequestPending;
@@ -1671,7 +1680,10 @@
             User::Panic(_L("CTestSecDlgNotifier"), 0);
             }
         }
-    CCTSignTextDialog::RunDlgLD( resource, *message, iStatus, iRetValue );
+    // TODO
+    //CCTSignTextDialog::RunDlgLD( resource, *message, iStatus, iRetValue );
+    User::Leave( KErrGeneral );
+    resource = resource;     // avoids compiler warning
     CleanupStack::PopAndDestroy( message );
 
     iStatus = KRequestPending;
@@ -1686,13 +1698,14 @@
 // ---------------------------------------------------------
 //
 HBufC* CCTSecurityDialogsAO::MessageQueryCertDetailsL(
-    const TDesC8& aCert,
-    const CCTCertInfo* aCertInfo,
-    TCertificateFormat aCertFormat,
-    const CCTKeyInfo* aKeyInfo)
+    const TDesC8& /*aCert*/,
+    const CCTCertInfo* /*aCertInfo*/,
+    TCertificateFormat /*aCertFormat*/,
+    const CCTKeyInfo* /*aKeyInfo*/)
     {
     // Create message buffer
     HBufC* message = HBufC::NewLC( KMaxLengthTextDetailsBody );
+/*
     TPtr messagePtr = message->Des();
     // Label
     if ( aCertInfo )
@@ -1754,7 +1767,7 @@
             User::Leave( KErrNotSupported );
             }
         }
-
+*/
     CleanupStack::Pop( message );
     return message;
     }
@@ -1763,22 +1776,25 @@
 // CCTSecurityDialogsAO::AddIssuerAndSubjectL(...)
 // -----------------------------------------------------------------------------
 //
-void CCTSecurityDialogsAO::AddSiteL( TDes& aMessage )
+void CCTSecurityDialogsAO::AddSiteL( TDes& /*aMessage*/ )
     {
+/*
     if ( iServerName )
         {
         DetailsFieldDynamicL( aMessage, iServerName->Des(),
             R_QTN_CM_SITE,
             R_TEXT_RESOURCE_DETAILS_VIEW_NOT_DEFINED );
         }
+*/
     }
 
 // -----------------------------------------------------------------------------
 // CCTSecurityDialogsAO::AddIssuerAndSubjectL(...)
 // -----------------------------------------------------------------------------
 //
-void CCTSecurityDialogsAO::AddIssuerAndSubjectL( TDes& aMessage, const CX509Certificate& aCert )
+void CCTSecurityDialogsAO::AddIssuerAndSubjectL( TDes& /*aMessage*/, const CX509Certificate& /*aCert*/ )
     {
+/*
     HBufC* issuer = NULL;
     HBufC* owner = NULL;
     X509CertNameParser::SubjectFullNameL( aCert, owner );
@@ -1796,14 +1812,16 @@
         R_TEXT_RESOURCE_DETAILS_VIEW_SUBJECT,
         R_TEXT_RESOURCE_VIEW_NO_SUBJECT_DETAILS );
     CleanupStack::PopAndDestroy( owner );   //owner
+*/
     }
 
 // -----------------------------------------------------------------------------
 // CCTSecurityDialogsAO::AddKeySizeL(...)
 // -----------------------------------------------------------------------------
 //
-void CCTSecurityDialogsAO::AddKeySizeL( TDes& aMessage, const CCTKeyInfo* aKeyInfo )
+void CCTSecurityDialogsAO::AddKeySizeL( TDes& /*aMessage*/, const CCTKeyInfo* /*aKeyInfo*/ )
     {
+/*
     TUint keySize = aKeyInfo->Size();
 
     TBuf<KMaxLengthTextDateString> sizeBuf;
@@ -1817,14 +1835,16 @@
         R_TEXT_RESOURCE_DETAILS_VIEW_NOT_DEFINED );
 
     aMessage.Append( KEnterEnter );
+*/
     }
 
 // -----------------------------------------------------------------------------
 // CCTSecurityDialogsAO::AddKeyUsageL(...)
 // -----------------------------------------------------------------------------
 //
-void CCTSecurityDialogsAO::AddKeyUsageL( TDes& aMessage, const CCTKeyInfo* aKeyInfo )
+void CCTSecurityDialogsAO::AddKeyUsageL( TDes& /*aMessage*/, const CCTKeyInfo* /*aKeyInfo*/ )
     {
+/*
     if ( aKeyInfo != NULL )
         {
         TKeyUsagePKCS15 keyUsage = aKeyInfo->Usage();
@@ -1847,14 +1867,16 @@
         DetailsFieldResourceL( aMessage,
             R_TEXT_RESOURCE_DETAILS_VIEW_KEY_USAGE, usage);
         }
+*/
     }
 
 // -----------------------------------------------------------------------------
 // CCTSecurityDialogsAO::AddKeyUsageL(...)
 // -----------------------------------------------------------------------------
 //
-void CCTSecurityDialogsAO::AddKeyUsageL( TDes& aMessage, const CX509Certificate& aCert )
+void CCTSecurityDialogsAO::AddKeyUsageL( TDes& /*aMessage*/, const CX509Certificate& /*aCert*/ )
     {
+/*
   TKeyUsageX509 x509Usage = EX509UsageNone;
   TKeyUsagePKCS15 pkcs15KeyUsage = EPKCS15UsageNone;
   const CX509CertExtension* ext = aCert.Extension(KKeyUsage);
@@ -1927,14 +1949,16 @@
       }
    DetailsFieldResourceL( aMessage,
           R_TEXT_RESOURCE_DETAILS_VIEW_KEY_USAGE, usage );
+*/
    }
 
 // -----------------------------------------------------------------------------
 // CCTSecurityDialogsAO::AddKeyAlgorithmL(...)
 // -----------------------------------------------------------------------------
 //
-void CCTSecurityDialogsAO::AddKeyAlgorithmL( TDes& aMessage, const CCTKeyInfo* aKeyInfo )
+void CCTSecurityDialogsAO::AddKeyAlgorithmL( TDes& /*aMessage*/, const CCTKeyInfo* /*aKeyInfo*/ )
     {
+/*
     TInt algRes = 0;
     switch( aKeyInfo->Algorithm())
         {
@@ -1965,6 +1989,7 @@
         }
     DetailsFieldResourceL( aMessage,
             R_TEXT_RESOURCE_DETAILS_VIEW_ALGORITHM, algRes);
+*/
     }
 
 // -----------------------------------------------------------------------------
@@ -1999,8 +2024,9 @@
 // ---------------------------------------------------------
 //
 void CCTSecurityDialogsAO::AddLocationInfoL(
-    TDes& aMessage, TUid aUid, TBool aCertificate )
+    TDes& /*aMessage*/, TUid /*aUid*/, TBool /*aCertificate*/ )
     {
+/*
     TInt location = 0;
     TInt locationRes =0;
 
@@ -2041,6 +2067,7 @@
         }
 
     DetailsFieldResourceL( aMessage, locationRes, location );
+*/
     }
 
 // -----------------------------------------------------------------------------
@@ -2052,7 +2079,7 @@
     {
     TLocale locale;
     TTimeIntervalSeconds offSet = locale.UniversalTimeOffset();
-    DetailsResourceL( aMessage, R_TEXT_RESOURCE_DETAILS_VIEW_VALID_FROM );
+    //DetailsResourceL( aMessage, R_TEXT_RESOURCE_DETAILS_VIEW_VALID_FROM );
     const CValidityPeriod& validityPeriod = aCert.ValidityPeriod();
     TTime startValue = validityPeriod.Start();
     startValue += offSet;
@@ -2067,7 +2094,7 @@
     aMessage.Append( startString );
     aMessage.Append( KEnterEnter );
 
-    DetailsResourceL( aMessage, R_TEXT_RESOURCE_DETAILS_VIEW_VALID_UNTIL );
+    //DetailsResourceL( aMessage, R_TEXT_RESOURCE_DETAILS_VIEW_VALID_UNTIL );
     TTime finishValue = validityPeriod.Finish();
     finishValue += offSet;
     TBuf<KMaxLengthTextDateString> finishString;
@@ -2086,46 +2113,91 @@
 // CCTSecurityDialogsAO::AddCertFormatL(...)
 // -----------------------------------------------------------------------------
 //
-void CCTSecurityDialogsAO::AddCertFormatL( TDes& aMessage, TCertificateFormat aCertFormat)
+void CCTSecurityDialogsAO::AddCertFormatL( TDes& /*aMessage*/, TCertificateFormat aCertFormat)
     {
-    TInt fieldType = 0;
+    //TInt fieldType = 0;
     switch ( aCertFormat )
         {
         case EX509CertificateUrl:
         case EX509Certificate:
             {
-            fieldType = R_TEXT_RESOURCE_DETAILS_VIEW_CERT_FORMAT_X509;
+            //fieldType = R_TEXT_RESOURCE_DETAILS_VIEW_CERT_FORMAT_X509;
             break;
             }
         default:
             {
-            fieldType = R_TEXT_RESOURCE_DETAILS_VIEW_NOT_DEFINED;
+            //fieldType = R_TEXT_RESOURCE_DETAILS_VIEW_NOT_DEFINED;
             break;
             }
         }
-    DetailsFieldResourceL( aMessage,
-        R_TEXT_RESOURCE_DETAILS_VIEW_CERT_FORMAT, fieldType );
+    //DetailsFieldResourceL( aMessage,
+    //    R_TEXT_RESOURCE_DETAILS_VIEW_CERT_FORMAT, fieldType );
     }
 
 // -----------------------------------------------------------------------------
 // CCTSecurityDialogsAO::AddCertAlgorithmsL(...)
 // -----------------------------------------------------------------------------
 //
-void CCTSecurityDialogsAO::AddCertAlgorithmsL( TDes& aMessage, const CX509Certificate& aCert )
+void CCTSecurityDialogsAO::AddCertAlgorithmsL( TDes& /*aMessage*/, const CX509Certificate& /*aCert*/ )
     {
+/*
     TInt fieldType = 0;
     TInt fieldType2 = 0;
-
     // digest algorithm
-    TAlgorithmId algorithmId = aCert.SigningAlgorithm().DigestAlgorithm().Algorithm();
-    fieldType = AlgorithmNameResourceId( algorithmId );
+    TAlgorithmId algorithmId =
+        aCert.SigningAlgorithm().DigestAlgorithm().Algorithm();
+    switch ( algorithmId )
+        {
+        case EMD2:
+            {
+            fieldType = R_TEXT_RESOURCE_DETAILS_VIEW_ALGORITHM_MD2;
+            break;
+            }
+        case EMD5:
+            {
+            fieldType = R_TEXT_RESOURCE_DETAILS_VIEW_ALGORITHM_MD5;
+            break;
+            }
+        case ESHA1:
+            {
+            fieldType = R_TEXT_RESOURCE_DETAILS_VIEW_ALGORITHM_SHA1;
+            break;
+            }
+        default:
+            {
+            fieldType = R_TEXT_RESOURCE_DETAILS_VIEW_UNKNOWN;
+            break;
+            }
+        }
 
     // public-key algorithm
-    algorithmId = aCert.SigningAlgorithm().AsymmetricAlgorithm().Algorithm();
-    fieldType2 = AlgorithmNameResourceId( algorithmId );
+    algorithmId =
+        aCert.SigningAlgorithm().AsymmetricAlgorithm().Algorithm();
+    switch ( algorithmId )
+        {
+        case ERSA:
+            {
+            fieldType2 = R_TEXT_RESOURCE_DETAILS_VIEW_ALGORITHM_RSA;
+            break;
+            }
+        case EDSA:
+            {
+            fieldType2 = R_TEXT_RESOURCE_DETAILS_VIEW_ALGORITHM_DSA;
+            break;
+            }
+        case EDH:
+            {
+            fieldType2 = R_TEXT_RESOURCE_DETAILS_VIEW_ALGORITHM_DH;
+            break;
+            }
+        default:
+            {
+            fieldType2 = R_TEXT_RESOURCE_DETAILS_VIEW_UNKNOWN;
+            }
+        }
 
     // If other algorithm is unknown
-    if( fieldType == R_TEXT_RESOURCE_DETAILS_VIEW_UNKNOWN ||
+    if ( fieldType == R_TEXT_RESOURCE_DETAILS_VIEW_UNKNOWN ||
         fieldType2 == R_TEXT_RESOURCE_DETAILS_VIEW_UNKNOWN )
         {
         DetailsFieldResourceL( aMessage,
@@ -2142,14 +2214,16 @@
         CleanupStack::PopAndDestroy();  // stringHolder
         aMessage.Append( KEnterEnter );
         }
+*/
     }
 
 // -----------------------------------------------------------------------------
 // CCTSecurityDialogsAO::AddCertSerialNumberL(...)
 // -----------------------------------------------------------------------------
 //
-void CCTSecurityDialogsAO::AddCertSerialNumberL( TDes& aMessage, const CX509Certificate& aCert )
+void CCTSecurityDialogsAO::AddCertSerialNumberL( TDes& /*aMessage*/, const CX509Certificate& /*aCert*/ )
     {
+/*
     // certificate serial number
     DetailsResourceL( aMessage, R_TEXT_RESOURCE_DETAILS_VIEW_SERIAL_NUMBER );
     TPtrC8 serialNumber = aCert.SerialNumber();
@@ -2162,14 +2236,16 @@
        }
 
     aMessage.Append( KEnterEnter );
+*/
     }
 
 // -----------------------------------------------------------------------------
 // CCTSecurityDialogsAO::AddCertFingerprintsL(...)
 // -----------------------------------------------------------------------------
 //
-void CCTSecurityDialogsAO::AddCertFingerprintsL( TDes& aMessage, const CX509Certificate& aCert )
+void CCTSecurityDialogsAO::AddCertFingerprintsL( TDes& /*aMessage*/, const CX509Certificate& /*aCert*/ )
     {
+/*
      // certificate fingerprint SHA-1
     DetailsResourceL( aMessage, R_TEXT_RESOURCE_DETAILS_VIEW_FINGERPRINT );
 
@@ -2187,6 +2263,7 @@
     CleanupStack::PopAndDestroy( md5 );
 
     DevideToBlocks( fingerprint, aMessage );
+*/
     }
 
 // ---------------------------------------------------------
@@ -2320,6 +2397,7 @@
             iMessagePtr.WriteL( iReplySlot, pinValueBufPtr );
             break;
             }
+
         case EChangePIN:
         case EUnblockPIN:
             {
@@ -2330,6 +2408,7 @@
             iMessagePtr.WriteL( iReplySlot, twoPINOutputBuf );
             break;
             }
+
         case ESignText: // flow thru
         case EUserAuthenticationText: // flow thru
         case EUserAuthentication:
@@ -2338,13 +2417,14 @@
             iMessagePtr.WriteL( iReplySlot, tokenObjectHandleBuf );
             break;
             }
+
         case EServerAuthenticationFailure:
             {
             TServerAuthenticationFailureDialogResult result = EStop;
 
-            if ( iRetValue != EServerCertAcceptedPermanently )
+            if( iRetValue != EServerCertAcceptedPermanently )
                 {
-                if ( iRetValue == EServerCertAcceptedTemporarily )
+                if( iRetValue == EServerCertAcceptedTemporarily )
                     {
                     result = EContinue;
                     }
@@ -2365,12 +2445,14 @@
 
             break;
             }
+
         case EPINBlocked:
         case EUnblockPINInClear:
             {
             User::Leave( KErrNotSupported );
             break;
             }
+
         case ECreateCSR:
         case ECertDetails:
         case ESaveCert:
@@ -2386,6 +2468,7 @@
             {
             break; // Complete is enough
             }
+
         default:
             User::Panic( _L("CTestSecDlgNotifier"), 0 );
         }
@@ -2433,23 +2516,14 @@
 void CCTSecurityDialogsAO::DoCancel()
     {
     WIMSECURITYDIALOGS_WRITE( "CCTSecurityDialogsAO::DoCancel" );
-
-    // Note that iQueryDialog may point to already deleted memory.
-    // Dialogs need to set and reset iQueryDialogDeleted flag to
-    // allow deleting the dialog from CCTSecurityDialogsAO.
-    if( !iQueryDialogDeleted )
-        {
-        delete iQueryDialog;
-        iQueryDialogDeleted = ETrue;
-        }
-    iQueryDialog = NULL;
-
-    if ( !iPinQueryDialogDeleted )
+    /*
+    if( !iPinQueryDialogDeleted )
         {
         delete iPinQueryDialog;
         iPinQueryDialogDeleted = ETrue;
         }
     iPinQueryDialog = NULL;
+    */
 
     // Complete message if it has not been completed earlier.
     if( !iMessagePtr.IsNull() )
@@ -2477,10 +2551,12 @@
 //
 void CCTSecurityDialogsAO::DoHandleSaveServerCertL()
     {
+    TRACE( "CCTSecurityDialogsAO::DoHandleSaveServerCertL" );
+
     if ( iTrustedSiteCertStore )
         {
         iTrustedSiteCertStore->Add( *iCertLabel, EX509Certificate,
-                                EPeerCertificate, NULL, NULL, *iCertBuf, iStatus );
+            EPeerCertificate, NULL, NULL, *iCertBuf, iStatus );
 
         // Next step is to update trust site db
         iNextStep = EAddTrustedSite;
@@ -2511,3 +2587,14 @@
         }
     }
 
+void CCTSecurityDialogsAO::ShowInformationNoteL( TInt aResourceID ) const
+    {
+    HBufC* buffer = CEikonEnv::Static()->AllocReadResourceLC( aResourceID );
+    CHbDeviceMessageBoxSymbian* iMessageBox = CHbDeviceMessageBoxSymbian::NewL(CHbDeviceMessageBoxSymbian::EInformation);
+    CleanupStack::PushL(iMessageBox);
+    iMessageBox->SetTextL(buffer->Des());
+    iMessageBox->SetTimeout(6000);
+    iMessageBox->ExecL();
+    CleanupStack::PopAndDestroy(iMessageBox);
+    CleanupStack::PopAndDestroy( buffer );
+    }
--- a/pkiutilities/CTSecurityDialogs/NotifSrc/CTSelectcertificatedialog.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CTSecurityDialogs/NotifSrc/CTSelectcertificatedialog.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -18,6 +18,7 @@
 
 
 // INCLUDE FILES
+#include <platform/e32notif.h>
 #include "CTSelectCertificateDialog.h"
 #include "CTSecurityDialogDefs.h"
 #include <CTSecDlgs.rsg>
--- a/pkiutilities/CTSecurityDialogs/NotifSrc/CTSigntextdialog.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CTSecurityDialogs/NotifSrc/CTSigntextdialog.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -18,6 +18,7 @@
 
 
 // INCLUDE FILES
+#include <platform/e32notif.h>
 #include "CTSignTextDialog.h"
 #include "CTSecurityDialogsLogger.h"
 #include <barsread.h>
@@ -25,6 +26,7 @@
 #include <uikon/eiksrvui.h>
 #include <StringLoader.h>
 
+
 // ============================ MEMBER FUNCTIONS ===============================
 
 // -----------------------------------------------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/CTSecurityDialogs/NotifSrc/CTUntrustedCertQuery.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,238 @@
+/*
+* 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:  Displays untrusted certificate dialog.
+*
+*/
+
+#include "CTUntrustedCertQuery.h"           // CCTUntrustedCertQuery
+#include <hb/hbcore/hbsymbianvariant.h>     // CHbSymbianVariantMap
+
+// Note that the dialog type string, the parameters name strings, and the return code
+// name string and values must match to those defined in Qt-side untrusted certificate
+// dialog (in untrustedcertificatedefinitions.h file).
+
+// Device dialog type for untrusted certificate dialog
+_LIT( KUntrustedCertificateDialog, "com.nokia.untrustedcert/1.0" );
+
+// Variant map parameter names for untrusted certificate dialog
+_LIT( KUntrustedCertEncodedCertificate, "cert" );   // bytearray, mandatory
+_LIT( KUntrustedCertServerName, "host" );           // string, mandatory
+_LIT( KUntrustedCertValidationError, "err" );       // int (TValidationError), mandatory
+_LIT( KUntrustedCertTrustedSiteStoreFail, "tss" );  // any, prevents permanent acceptance
+
+// Dialog return code name and values
+_LIT( KUntrustedCertDialogResult, "result" );       // int
+const TInt KUntrustedCertDialogRejected = 0;
+const TInt KUntrustedCertDialogAccepted = 1;
+const TInt KUntrustedCertDialogAcceptedPermanently = 2;
+
+// TODO: replace with OST tracing
+#ifdef _DEBUG
+#include <e32debug.h>
+#define TRACE(x)        RDebug::Printf(x)
+#define TRACE1(x,y)     RDebug::Printf(x,y)
+#else
+#define TRACE(x)
+#define TRACE1(x,y)
+#endif
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CCTUntrustedCertQuery::NewLC()
+// ---------------------------------------------------------------------------
+//
+CCTUntrustedCertQuery* CCTUntrustedCertQuery::NewLC(
+        TValidationError aValidationError, const TDesC8& aCertificate,
+        const TDesC& aServerName, TBool aCanHandlePermanentAccept )
+    {
+    TRACE( "CCTUntrustedCertQuery::NewLC" );
+    CCTUntrustedCertQuery* self = new ( ELeave ) CCTUntrustedCertQuery(
+            aValidationError, aCertificate, aServerName,
+            aCanHandlePermanentAccept );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CCTUntrustedCertQuery::~CCTUntrustedCertQuery()
+// ---------------------------------------------------------------------------
+//
+CCTUntrustedCertQuery::~CCTUntrustedCertQuery()
+    {
+    TRACE( "CCTUntrustedCertQuery::~CCTUntrustedCertQuery" );
+    Cancel();
+    delete iWait;
+    delete iDeviceDialog;
+    delete iVariantMap;
+    }
+
+// ---------------------------------------------------------------------------
+// CCTUntrustedCertQuery::ShowQueryAndWaitForResponseL()
+// ---------------------------------------------------------------------------
+//
+void CCTUntrustedCertQuery::ShowQueryAndWaitForResponseL( TResponse& aResponse )
+    {
+    TRACE( "CCTUntrustedCertQuery::ShowQueryAndWaitForResponseL" );
+    if( !iDeviceDialog )
+        {
+        iDeviceDialog = CHbDeviceDialogSymbian::NewL();
+        }
+    if( !iVariantMap )
+        {
+        iVariantMap = CHbSymbianVariantMap::NewL();
+        }
+
+    CHbSymbianVariant *variant = NULL;
+    variant = CHbSymbianVariant::NewL( &iCertificate, CHbSymbianVariant::EBinary );
+    User::LeaveIfError( iVariantMap->Add( KUntrustedCertEncodedCertificate, variant ) );
+    variant = CHbSymbianVariant::NewL( &iValidationError, CHbSymbianVariant::EInt );
+    User::LeaveIfError( iVariantMap->Add( KUntrustedCertValidationError, variant ) );
+    variant = CHbSymbianVariant::NewL( &iServerName, CHbSymbianVariant::EDes );
+    User::LeaveIfError( iVariantMap->Add( KUntrustedCertServerName, variant ) );
+    if( !iCanHandlePermanentAccept )
+        {
+        variant = CHbSymbianVariant::NewL( &iCanHandlePermanentAccept, CHbSymbianVariant::EBool );
+        User::LeaveIfError( iVariantMap->Add( KUntrustedCertTrustedSiteStoreFail, variant ) );
+        }
+
+    User::LeaveIfError( iDeviceDialog->Show( KUntrustedCertificateDialog, *iVariantMap, this ) );
+
+    iStatus = KRequestPending;
+    SetActive();
+    TRACE( "CCTUntrustedCertQuery::ShowQueryAndWaitForResponseL, wait start" );
+    iWait->Start();
+    TRACE( "CCTUntrustedCertQuery::ShowQueryAndWaitForResponseL, wait end" );
+    TRACE1( "CCTUntrustedCertQuery::ShowQueryAndWaitForResponseL, iWaitCompletionCode=%d", iWaitCompletionCode );
+    User::LeaveIfError( iWaitCompletionCode );
+    TRACE1( "CCTUntrustedCertQuery::ShowQueryAndWaitForResponseL, iResponse=%d", iResponse );
+    aResponse = iResponse;
+    }
+
+// ---------------------------------------------------------------------------
+// CCTUntrustedCertQuery::DoCancel()
+// ---------------------------------------------------------------------------
+//
+void CCTUntrustedCertQuery::DoCancel()
+    {
+    TRACE( "CCTUntrustedCertQuery::DoCancel begin" );
+    if( iDeviceDialog )
+        {
+        TRACE( "CCTUntrustedCertQuery::DoCancel, iDeviceDialog->Cancel()" );
+        iDeviceDialog->Cancel();
+        }
+    if( iWait && iWait->IsStarted() && iWait->CanStopNow() )
+        {
+        TRACE( "CCTUntrustedCertQuery::DoCancel, iWait->AsyncStop()" );
+        iWaitCompletionCode = KErrCancel;
+        iWait->AsyncStop();
+        }
+    TRACE( "CCTUntrustedCertQuery::DoCancel end" );
+    }
+
+// ---------------------------------------------------------------------------
+// CCTUntrustedCertQuery::RunL()
+// ---------------------------------------------------------------------------
+//
+void CCTUntrustedCertQuery::RunL()
+    {
+    TRACE1( "CCTUntrustedCertQuery::RunL, iStatus.Int()=%d", iStatus.Int() );
+    iWaitCompletionCode = iStatus.Int();
+    if( iWait )
+        {
+        iWait->AsyncStop();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CCTUntrustedCertQuery::DataReceived()
+// ---------------------------------------------------------------------------
+//
+void CCTUntrustedCertQuery::DataReceived( CHbSymbianVariantMap& aData )
+    {
+    TRACE( "CCTUntrustedCertQuery::DataReceived" );
+    const CHbSymbianVariant* variant = aData.Get( KUntrustedCertDialogResult );
+    if( variant )
+        {
+        TInt* value = variant->Value<TInt>();
+        if( value )
+            {
+            switch( *value )
+                {
+                case KUntrustedCertDialogRejected:
+                    TRACE( "CCTUntrustedCertQuery::DataReceived, rejected" );
+                    iResponse = EQueryRejected;
+                    break;
+                case KUntrustedCertDialogAccepted:
+                    TRACE( "CCTUntrustedCertQuery::DataReceived, accepted" );
+                    iResponse = EQueryAccepted;
+                    break;
+                case KUntrustedCertDialogAcceptedPermanently:
+                    TRACE( "CCTUntrustedCertQuery::DataReceived, accepted permanently" );
+                    iResponse = EQueryAcceptedPermanently;
+                    break;
+                default:
+                    __ASSERT_DEBUG( EFalse, User::Invariant() );
+                    break;
+                }
+            }
+        else
+            {
+            __ASSERT_DEBUG( EFalse, User::Invariant() );
+            }
+        }
+    else
+        {
+        __ASSERT_DEBUG( EFalse, User::Invariant() );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CCTUntrustedCertQuery::DeviceDialogClosed()
+// ---------------------------------------------------------------------------
+//
+void CCTUntrustedCertQuery::DeviceDialogClosed( TInt aCompletionCode )
+    {
+    TRACE1( "CCTUntrustedCertQuery::DeviceDialogClosed aCompletionCode=%d", aCompletionCode );
+    TRequestStatus* status( &iStatus );
+    User::RequestComplete( status, aCompletionCode );
+    }
+
+// ---------------------------------------------------------------------------
+// CCTUntrustedCertQuery::CCTUntrustedCertQuery()
+// ---------------------------------------------------------------------------
+//
+CCTUntrustedCertQuery::CCTUntrustedCertQuery(
+        TValidationError aValidationError, const TDesC8& aCertificate,
+        const TDesC& aServerName, TBool aCanHandlePermanentAccept ) :
+        CActive( CActive::EPriorityStandard ), iValidationError( aValidationError ),
+        iCertificate( aCertificate ), iServerName( aServerName ),
+        iCanHandlePermanentAccept( aCanHandlePermanentAccept ),
+        iResponse( EQueryRejected )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+// ---------------------------------------------------------------------------
+// CCTUntrustedCertQuery::ConstructL()
+// ---------------------------------------------------------------------------
+//
+void CCTUntrustedCertQuery::ConstructL()
+    {
+    TRACE( "CCTUntrustedCertQuery::ConstructL" );
+    iWait = new( ELeave ) CActiveSchedulerWait;
+    }
+
--- a/pkiutilities/CTSecurityDialogs/NotifSrc/CTpinquerydialog.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CTSecurityDialogs/NotifSrc/CTpinquerydialog.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -18,6 +18,7 @@
 
 
 // INCLUDE FILES
+#include <platform/e32notif.h>
 #include "CTPinQueryDialog.h"
 #include "CTSecurityDialogsLogger.h"
 #include <CTSecDlgs.rsg>
--- a/pkiutilities/CTSecurityDialogs/data/CTsecdlgs.rss	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CTSecurityDialogs/data/CTsecdlgs.rss	Tue Aug 31 16:04:40 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -24,7 +24,7 @@
 #include <avkon.rh>
 #include <avkon.loc>
 #include <bldvariant.hrh>
-#include <certmanui.loc>
+//#include <certmanui.loc>
 #include <certsaver.loc>
 #include <wmlbrowser_wim.loc>
 
@@ -505,7 +505,7 @@
             control= AVKON_CONFIRMATION_QUERY
                 {
                 layout = EConfirmationLayout;
-                // label defined dynamically, using host name parameter
+                label = qtn_ics_ssl_conf_q_accept_ood;
                 };
             }
         };
@@ -534,7 +534,7 @@
             control= AVKON_CONFIRMATION_QUERY
                 {
                 layout = EConfirmationLayout;
-                // label defined dynamically, using host name parameter
+                label = qtn_ics_ssl_conf_q_accept_untrusted;
                 };
             }
         };
@@ -564,7 +564,7 @@
             control= AVKON_CONFIRMATION_QUERY
                 {
                 layout = EConfirmationLayout;
-                // label defined dynamically, using host name parameter
+                label = qtn_ics_ssl_conf_q_accept_site;
                 };
             }
         };
@@ -876,10 +876,4 @@
 
 RESOURCE TBUF r_qtn_cm_site { buf=qtn_cm_site; }
 
-RESOURCE TBUF r_qtn_ics_ssl_conf_q_accept_site { buf=qtn_ics_ssl_conf_q_accept_site; }
-
-RESOURCE TBUF r_qtn_ics_ssl_conf_q_accept_ood { buf=qtn_ics_ssl_conf_q_accept_ood; }
-
-RESOURCE TBUF r_qtn_ics_ssl_conf_q_accept_untrusted { buf=qtn_ics_ssl_conf_q_accept_untrusted; }
-
 // End of file
--- a/pkiutilities/CTSecurityDialogs/ecomsrc/CTSecDlgWrapper.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CTSecurityDialogs/ecomsrc/CTSecDlgWrapper.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -18,6 +18,7 @@
 
 // INCLUDE FILES
 #include <ecom/implementationproxy.h>
+#include <platform/e32notif.h>
 #include <AknNotifierWrapper.h> // link against aknnotifierwrapper.lib
 #include <secdlgimpldefs.h>
 #include "CTSecurityDialogDefs.h"
--- a/pkiutilities/CTSecurityDialogs/loc/wmlbrowser_wim.loc	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CTSecurityDialogs/loc/wmlbrowser_wim.loc	Tue Aug 31 16:04:40 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -286,35 +286,29 @@
 
 
 //d:Confirmation query text shown if the server certificate contains 
-//d:site name that does not match to the one that was given in request.
-//d:%U stands for the name of the site where the connection is requested.
-//d:Displaying the site name is a security feature.
+//d:site name that does not match to the one that was given in request the query contains text
 //l:popup_note_window
 //w:
 //r:3.2
 //
-#define qtn_ics_ssl_conf_q_accept_site          "Service %U has sent a certificate with different site name than requested. Accept anyway?"
+#define qtn_ics_ssl_conf_q_accept_site		"This site has sent a certificate with different site name than requested. Accept anyway?"
 
 
 //d:Confirmation query text shown if the server certificate is out-of date
-//d:%U stands for the name of the site where the connection is requested.
-//d:Displaying the site name is a security feature.
 //l:popup_note_window
 //w:
 //r:3.2
 //
-#define qtn_ics_ssl_conf_q_accept_ood           "Service %U has sent a certificate which is out of date. Accept anyway?"
+#define qtn_ics_ssl_conf_q_accept_ood		"This site has sent a certificate which is out of date. Accept anyway?"
 
 
-//d:Confirmation query text shown if the server certificate issued by unknown
+//d:Confirmation query text shown if the server certificate issued by unknown 
 //d:Certification Authority
-//d:%U stands for the name of the site where the connection is requested.
-//d:Displaying the site name is a security feature.
 //l:popup_note_window
 //w:
 //r:3.2
 //
-#define qtn_ics_ssl_conf_q_accept_untrusted     "Service %U has sent an untrusted certificate. Accept anyway?"
+#define qtn_ics_ssl_conf_q_accept_untrusted		"This site has sent an untrusted certificate. Accept anyway?"
 
 //d:Information note text shown if the server certificate has an invalid signature
 //d:Softkeys are SK1 'Close' (text_softkey_close) and SK2 'Details' (text_softkey_details)
--- a/pkiutilities/CertSaver/data/CertSaver.rss	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CertSaver/data/CertSaver.rss	Tue Aug 31 16:04:40 2010 +0300
@@ -22,14 +22,9 @@
 
 //  INCLUDES
 #include <eikon.rh>
-#include <eikon.rsg>
 #include <avkon.rsg>
-#include <avkon.hrh>
 #include <avkon.rh>
-#include <avkon.mbg>
-#include <avkon.loc>
 #include <appinfo.rh>
-#include <certmanui.loc>  //qtn_cm_not_valid_yet
 #include <certsaver.loc>
 #include "certsaver.hrh"
 
@@ -158,6 +153,7 @@
     buf = qtn_cm_not_defined;
     }
 
+
 //----------------------------------------------------
 //
 //    r_certsaver_softkeys_save_discard
@@ -209,8 +205,6 @@
         };
     }
 
-
-
 //----------------------------------------------------
 //
 //    r_message_query_dosave
@@ -282,24 +276,28 @@
 //
 //----------------------------------------------------
 //
-RESOURCE DIALOG r_certsaver_warning_note
-    {
-    flags = EGeneralQueryFlags;
-    buttons = r_certsaver_softkeys_save_discard;
-    items=
-        {
-        DLG_LINE
-            {
-            type=EAknCtQuery;
-            id=EGeneralQuery;
-            control= AVKON_CONFIRMATION_QUERY
-                {
-                layout = EConfirmationLayout;
+RESOURCE TBUF r_certsaver_warning_note { buf = qtn_httpsec_save_rootcertificate; }
+
+/*
+RESOURCE DIALOG r_certsaver_warning_note                 
+    {                                                    
+    flags = EGeneralQueryFlags;                          
+    buttons = r_certsaver_softkeys_save_discard;         
+    items=                                               
+        {                                                
+        DLG_LINE                                         
+            {                                            
+            type=EAknCtQuery;                            
+            id=EGeneralQuery;                            
+            control= AVKON_CONFIRMATION_QUERY            
+                {                                        
+                layout = EConfirmationLayout;            
                 label = qtn_httpsec_save_rootcertificate;
-                };
-            }
-        };
-    }
+                };                                       
+            }                                            
+        };                                               
+    }                                                    
+*/
 
 //-----------------------------------------------------------------------------
 //
@@ -472,6 +470,7 @@
 RESOURCE TBUF r_certsaver_one_private_key{ buf = qtn_cm_one_private_key; }
 RESOURCE TBUF r_certsaver_one_personal_certificate { buf = qtn_cm_one_personal_certificate; }
 RESOURCE TBUF r_certsaver_one_authority_certificate { buf = qtn_cm_one_authority_certificate; }
-RESOURCE TBUF r_certsaver_trustedsite_warning { buf = qtn_cm_save_trustedsite_certificate_warning_text; }
+RESOURCE TBUF r_certsaver_trustedsite_warning 
+                { buf = qtn_cm_save_trustedsite_certificate_warning_text; }
 
 // End of File
--- a/pkiutilities/CertSaver/group/CertSaver.mmp	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CertSaver/group/CertSaver.mmp	Tue Aug 31 16:04:40 2010 +0300
@@ -54,11 +54,16 @@
 
 USERINCLUDE ../inc
 USERINCLUDE ../../Include
+USERINCLUDE ../../../securitydialogs/SecUi/Inc
 
 MW_LAYER_SYSTEMINCLUDE
 SYSTEMINCLUDE   ../../PKCS12/CrPkcs12/Inc
 SYSTEMINCLUDE   ../../DeviceToken/Inc
 
+SYSTEMINCLUDE   /epoc32/include/mw/hb/hbcore 
+SYSTEMINCLUDE   /epoc32/include/mw/hb/hbwidgets
+
+
 LIBRARY euser.lib
 LIBRARY apparc.lib
 LIBRARY cone.lib
@@ -81,5 +86,9 @@
 LIBRARY aknskins.lib
 LIBRARY DevTokenClient.lib
 
+LIBRARY HbCore.lib
+LIBRARY HbWidgets.lib
+LIBRARY	secui.lib
+
 SMPSAFE
 
--- a/pkiutilities/CertSaver/inc/CertSaverModel.h	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CertSaver/inc/CertSaverModel.h	Tue Aug 31 16:04:40 2010 +0300
@@ -77,12 +77,6 @@
         void SavePKCS12L();
 
 
-        /**
-        * Shows a error note with given text.
-        * @param aResourceID Id of the resource text to be shown.
-        */
-        void ShowErrorNoteL( TInt aResourceID ) const;
-
     private:  // New functions
 
         /**
@@ -198,11 +192,6 @@
         */
         void AddNewlinesToMessage( TDes& aMessage ) const;
 
-        /**
-        * Shows a confirmation note with given text.
-        * @param aResourceID Id of the resource text to be shown.
-        */
-        void ShowConfirmationNoteL( TInt aResourceID ) const;
 
         /**
         * Shows a information note with given text.
@@ -310,10 +299,12 @@
         */
         void DivideToBlocks( const TDesC8& aInput, TDes& aOutput ) const;
 
-        TBool DoMessageQueryL(
-            TInt aDialogResId,
+/*
+        TBool DoMessageQueryL( 
+            TInt aDialogResId, 
             TInt aHeadingResId,
-            TDesC& aMessage );
+            TDesC& aMessage ); 
+*/
 
     private: //data
         TCertificateOwnerType     iCertOwnerType;
@@ -336,6 +327,8 @@
         TInt  iSavedUserCertsCount;
         TInt  iSelectedKeyStore;
         TBool iKeyAlreadyExists;
+
+        CEikonEnv*        iEikEnv;
     };
 
 #endif
--- a/pkiutilities/CertSaver/loc/certsaver.loc	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CertSaver/loc/certsaver.loc	Tue Aug 31 16:04:40 2010 +0300
@@ -30,6 +30,7 @@
 //l:control_pane_t1/opt7
 #define text_wmls_list_disc_recvd_cert    "Discard"
 
+
 //d:Item in save-confirmation query pop up.
 //d:This represents to whom the certificate
 //d:has been issued to.
--- a/pkiutilities/CertSaver/src/CertSaverAppUi.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CertSaver/src/CertSaverAppUi.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -18,7 +18,6 @@
 
 // INCLUDE FILES
 #include <sysutil.h>            // For FFSSpaceBelowCriticalLevelL(..)
-#include <aknnotewrappers.h>    // Note dialogs
 #include <mpkcs12.h>
 #include <cryptostrength.h>
 #include <CertSaver.rsg>
--- a/pkiutilities/CertSaver/src/CertSaverDocument.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CertSaver/src/CertSaverDocument.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -112,7 +112,7 @@
 
     OpenFileL( docStore, file );
 
-    CleanupStack::PopAndDestroy(); // Close file
+    CleanupStack::PopAndDestroy(&file); // Close file
 
     return docStore;
     }
@@ -137,7 +137,7 @@
     iAO = new (ELeave) CShutterAO;
     iAO->Exit();
     #ifdef _DEBUG
-        RDebug::Print( _L("Exiting OpenFileL") );
+        
     #endif
     }
 
--- a/pkiutilities/CertSaver/src/CertSaverModel.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CertSaver/src/CertSaverModel.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -16,9 +16,6 @@
 */
 
 
-// INCLUDE FILES
-#include <aknnotewrappers.h>        // Note dialogs
-#include <aknmessagequerydialog.h>  // For CAknMessageQueryDialog
 #include <StringLoader.h>           // For loading resource strings
 #include <unifiedcertstore.h>       // For saving the certificates
 #include <mctwritablecertstore.h>   // For saving the certificates
@@ -35,6 +32,8 @@
 #include <x509certext.h>
 #include <mctkeystore.h>
 #include <TrustedSitesStore.h>
+#include <eikenv.h>                 // CEikonEnv
+#include <AknUtils.h>               // AknTextUtils
 
 #include <CertSaver.rsg>
 #include "CertSaverModel.h"
@@ -44,7 +43,14 @@
 #include "certsaver.hrh"
 #include "securityuisvariant.hrh"
 
+#include <hbdevicemessageboxsymbian.h>
+#include <hbdevicenotificationdialogsymbian.h>
+#include <hbsymbianvariant.h>
+
+#include "SecQueryUi.h"                   // needed for label dialog
+
 // CONSTANTS
+
 const TInt32 KWTLSTrusterUID( 268479059 );
 const TInt32 KInternetTrusterUID( 268441661 );
 const TInt32 KApplicationControllerTrusterUID( 268452523 );
@@ -56,12 +62,14 @@
 
 const TInt KMaxLengthTextMeassageBody( 5000 );
 const TInt KMaxLengthTextDateString( 11 );    // "dd/mm/yyyy0"
+const TInt KMaxLengthTextCheckBoxData( 255 );    // "dd/mm/yyyy0"
 
 //Issuer and Owner max visible length
 const TInt KMaxLengthTextCertIdentifierVisible( 1000 );
 const TInt KAttempts( 3 );
 
 const TInt KFingerprintLength( 50 );
+const TInt KTokenLength( 32 );
 
 _LIT( KCertSaverListBoxItemPrefix, "1\t" );
 const TInt KItemBufLen = 2 + KMaxName;
@@ -116,6 +124,7 @@
             const TCertificateOwnerType& aOwnerType,
             const TCertificateFormat& aCertFormat )
     {
+
     iCertOwnerType = aOwnerType;
     iCertFormat = aCertFormat;
     iNewCert = &aCertificate;
@@ -139,6 +148,7 @@
 //
 void CCertSaverModel::DoSavePrivateKeyL( const TDesC8& aKey )
     {
+
     CheckFSSpaceL( aKey );
 
     TKeyIdentifier keyIdentifier;
@@ -158,7 +168,8 @@
     CleanupStack::PopAndDestroy( pkcs8Data );
     if (KeyAlreadyExistsL( startDate, endDate, keyIdentifier, keyUsage) )
         {
-        User::Leave( KErrNone );
+        // used to leave with error none
+        return;
         }
 
     TInt accessType( 0 );
@@ -196,7 +207,7 @@
         case KErrKeySize:
         case KErrArgument:
             {
-            ShowErrorNoteL( R_CERTSAVER_KEY_TYPE_NOT_SUPPORTED );
+            ShowInformationNoteL( R_CERTSAVER_KEY_TYPE_NOT_SUPPORTED );
             User::Leave( KErrCancel );
             break;
             }
@@ -207,21 +218,21 @@
             }
         case KErrKeyUsage:
             {
-            ShowErrorNoteL( R_CERTSAVER_PRIVATE_KEY_CORRUPTED );
+            ShowInformationNoteL( R_CERTSAVER_PRIVATE_KEY_CORRUPTED );
             User::Leave( KErrCancel );
             break;
             }
         case KErrCancel:
         case KErrPermissionDenied:
             {
-            ShowErrorNoteL( R_CERTSAVER_PKCS12_DISCARDED );
+            ShowInformationNoteL( R_CERTSAVER_PKCS12_DISCARDED );
             User::Leave( KErrCancel );
             break;
             }
         case KErrCorrupt:
         case KErrEof:
             {
-            ShowErrorNoteL( R_CERTSAVER_KEYSTORE_CORRUPTED );
+            ShowInformationNoteL( R_CERTSAVER_KEYSTORE_CORRUPTED );
             User::Leave( KErrCancel );
             break;
             }
@@ -254,6 +265,7 @@
     const TKeyIdentifier& aKeyIdentifier,
     TKeyUsagePKCS15& aKeyUsage )
     {
+
     TBool ret = EFalse;
     TCTKeyAttributeFilter keyFilter;
     keyFilter.iKeyAlgorithm = CKeyInfoBase::EInvalidAlgorithm;
@@ -272,7 +284,7 @@
         case KErrCorrupt:
         case KErrEof:
             {
-            ShowErrorNoteL( R_CERTSAVER_KEYSTORE_CORRUPTED );
+            ShowInformationNoteL( R_CERTSAVER_KEYSTORE_CORRUPTED );
             User::Leave( KErrCancel );
             }
         default:
@@ -304,6 +316,7 @@
     const TKeyIdentifier& aKeyIdentifier )
     {
 
+
     for ( TInt i = 0; i < iParser.UserCertificates().Count(); i++ )
         {
         const CX509Certificate* cert = iParser.UserCertificates().At( i );
@@ -330,6 +343,7 @@
 //
 void CCertSaverModel::CreateKeyLabelL( TDes& aLabel )
     {
+
     TTime time;
     time.UniversalTime();
     TBuf<KPrivaKeyLabelLength> dateBuf;
@@ -349,6 +363,7 @@
 //
 void CCertSaverModel::SavePrivateKeyL()
     {
+
     if ( iParser.Keys().Count() <= 0 )
         {
         return;
@@ -397,6 +412,7 @@
     TAlgorithmId aAlgorithm )
     {
 
+
     TKeyUsagePKCS15 pkcs15KeyUsage = EPKCS15UsageNone;
     TKeyUsageX509 x509Usage = EX509UsageNone;
 
@@ -485,16 +501,13 @@
 //
 void CCertSaverModel::CheckFSSpaceL( const TDesC8& aDataToSave )
     {
+
     if (SysUtil::FFSSpaceBelowCriticalLevelL( &iFs, aDataToSave.Size() ))
         {
-        HBufC* p = StringLoader::LoadLC( R_CERTSAVER_MEMORY );
-        CAknErrorNote* note = new (ELeave) CAknErrorNote( ETrue );
-        note->ExecuteLD( p->Des() );
-        CleanupStack::PopAndDestroy( p );
+        ShowInformationNoteL(R_CERTSAVER_MEMORY);
         User::Leave( KErrExitApp );
         }
     }
-
 // ----------------------------------------------------------
 // CCertSaverModel::SaveCertL()
 // Saves certificate
@@ -502,48 +515,44 @@
 //
 void CCertSaverModel::SaveCertL()
   {
+
     if ( !CertificateOkL() )
         {
         User::Leave( KErrCancel );
         }
-
+ 
     HBufC* message = HBufC::NewLC( KMaxLengthTextMeassageBody );
     TPtr msgPtr = message->Des();
     ConstructMessageL( msgPtr );
-    CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL( *message );
-    CleanupStack::PopAndDestroy( message );
-    CleanupStack::PushL( dlg );
-
-
-    dlg->PrepareLC( R_MESSAGE_QUERY_DOSAVE );
-
-    HBufC* header = StringLoader::LoadLC( R_CERTSAVER_DETAILS_HEADING );
-    dlg->QueryHeading()->SetTextL( header->Des() );
-    CleanupStack::PopAndDestroy( header );
-    CleanupStack::Pop( dlg );
-    TBool doSave = dlg->RunLD();
-
+    CHbDeviceMessageBoxSymbian::TButtonId selection = 
+        CHbDeviceMessageBoxSymbian::QuestionL(msgPtr, KNullDesC, KNullDesC);
+    TBool doSave= (selection == CHbDeviceMessageBoxSymbian::EAcceptButton);
+    CleanupStack::PopAndDestroy(message);
+/*
     if ( doSave && iCertOwnerType == ECACertificate )
         {
         // warn user about security risk
-        CAknQueryDialog* warningDialog = CAknQueryDialog::NewL();
-        doSave = warningDialog->ExecuteLD( R_CERTSAVER_WARNING_NOTE );
+        HBufC* stringHolder = StringLoader::LoadLC( R_CERTSAVER_WARNING_NOTE );
+        CHbDeviceMessageBoxSymbian::TButtonId selection = 
+            CHbDeviceMessageBoxSymbian::QuestionL(stringHolder->Des(),KNullDesC, KNullDesC);
+        CleanupStack::PopAndDestroy(stringHolder);
+	    doSave=(selection == CHbDeviceMessageBoxSymbian::EAcceptButton);
         }
-
+*/
     if ( doSave )
         {
-        //Check that there still is enough space to store the
-        //certificate.
+        //Check that there still is enough space to store the certificate.
         CheckFSSpaceL( iNewCert->Encoding() );
         DoSaveCertL();
         }
     else
         {
-        ShowConfirmationNoteL( R_CERTSAVER_CERT_DISCARDED );
+        ShowInformationNoteL(R_CERTSAVER_CERT_DISCARDED);
         User::Leave( KErrCancel );
         }
   }
 
+
 // ----------------------------------------------------------
 // CCertSaverModel::InitCertStoreL()
 //
@@ -551,12 +560,13 @@
 //
 void CCertSaverModel::InitCertStoreL()
     {
+
     if ( !iUnifiedCertStore )
         {
         TRAPD( status, iUnifiedCertStore = CUnifiedCertStore::NewL( iFs, ETrue ) );
         if ( status != KErrNone )
             {
-            ShowErrorNoteL( R_CERTSAVER_ERROR_CACERTS_DB_CORRUPTED );
+            ShowInformationNoteL( R_CERTSAVER_ERROR_CACERTS_DB_CORRUPTED );
             User::Leave( KErrExitApp );
             }
         // initialize unified cert store
@@ -576,6 +586,7 @@
 //
 void CCertSaverModel::DoSaveCertL()
     {
+
     TInt status = KErrNone;
     CCertAttributeFilter* filter = NULL;
     TCertificateFormat certFormat = EX509Certificate;
@@ -678,7 +689,8 @@
 
             MCTToken& token = writableCertStore.Token();
             TUid tokenuid = token.Handle().iTokenTypeUid;
-            if ( ( tokenuid == KTrustedServerTokenUid ) && ( iCertOwnerType == EPeerCertificate ) ||
+            if ( ( tokenuid == KTrustedServerTokenUid ) && 
+                 ( iCertOwnerType == EPeerCertificate ) ||
                  ( tokenuid == KFileTokensUid ) && ( iCertOwnerType == ECACertificate ) ||
                  ( tokenuid == KFileTokensUid ) && ( iCertOwnerType == EUserCertificate ) )
                 {
@@ -690,7 +702,7 @@
         if ( certstoreIndex < 0 )
             {
             // Couldn't find certificate storage
-            ShowErrorNoteL( R_CERTSAVER_ERROR_CACERTS_DB_CORRUPTED );
+            ShowInformationNoteL( R_CERTSAVER_ERROR_CACERTS_DB_CORRUPTED );
             User::Leave( KErrExitApp );
             }
 
@@ -729,7 +741,7 @@
         {
         // If there is none WritableCertStore,
         // then at least cacerts.dat is corrupted.
-        ShowErrorNoteL( R_CERTSAVER_ERROR_CACERTS_DB_CORRUPTED );
+        ShowInformationNoteL( R_CERTSAVER_ERROR_CACERTS_DB_CORRUPTED );
         User::Leave( KErrExitApp );
         }
 
@@ -786,6 +798,7 @@
 //
 TInt CCertSaverModel::QueryLabelL( TCertLabel& aLabel, CUnifiedCertStore& aStore )
     {
+
     CCertAttributeFilter* filter = NULL;
     TInt status = KErrNone;
     RMPointerArray<CCTCertInfo> entries;
@@ -793,11 +806,21 @@
 
     while ( loop )
         {
-        CAknTextQueryDialog* dialog = CAknTextQueryDialog::NewL( aLabel );
-      if ( !dialog->ExecuteLD( R_CERTSAVER_LABEL_QUERY ) )
+    HBufC* labelprompt =  CEikonEnv::Static()->AllocReadResourceLC( R_CERTSAVER_ENTER_LABEL );
+    CSecQueryUi* SecQueryUi = CSecQueryUi::NewL();                                       
+    TInt queryAccepted = SecQueryUi->SecQueryDialog(labelprompt->Des(), aLabel,
+                                                1,KMaxCertLabelLength,          
+                                                ESecUiAlphaSupported |          
+                                                ESecUiCancelSupported |         
+                                                ESecUiEmergencyNotSupported);   
+    CleanupStack::PopAndDestroy( labelprompt );
+    delete SecQueryUi;  
+    SecQueryUi=NULL;
+
+      if ( queryAccepted!=KErrNone )
             {
             // cancel
-            ShowConfirmationNoteL( R_CERTSAVER_CERT_DISCARDED );
+            ShowInformationNoteL(R_CERTSAVER_CERT_DISCARDED);
             return KErrCancel;
             }
         // Create filter to confirm that label doesn't already exist.
@@ -840,31 +863,32 @@
 //
 void CCertSaverModel::HandleSaveErrorL( TInt aStatus ) const
     {
+
     switch ( aStatus )
         {
         case KErrNone:
             {
-            ShowConfirmationNoteL( R_CERTSAVER_ERROR_SAVEOK );
+            ShowInformationNoteL(R_CERTSAVER_ERROR_SAVEOK);
             break;
             }
         case KErrNotSupported:
             {
-            ShowErrorNoteL( R_CERTSAVER_ERROR_UNSUPPORTED_CERT );
+            ShowInformationNoteL(R_CERTSAVER_ERROR_UNSUPPORTED_CERT);
             break;
             }
         case KErrBadName:
             {
-            ShowErrorNoteL( R_CERTSAVER_ERROR_LABEL_ALREADY_EXISTS );
+            ShowInformationNoteL(R_CERTSAVER_ERROR_LABEL_ALREADY_EXISTS);
             break;
             }
         case KErrAlreadyExists:
             {
-            ShowErrorNoteL( R_CERTSAVER_ERROR_ALREADY_EXISTS );
+            ShowInformationNoteL(R_CERTSAVER_ERROR_ALREADY_EXISTS);
             break;
             }
         case KErrArgument:
             {
-            ShowErrorNoteL( R_CERTSAVER_ERROR_CACERTS_DB_CORRUPTED );
+            ShowInformationNoteL(R_CERTSAVER_ERROR_CACERTS_DB_CORRUPTED);
             break;
             }
         default:
@@ -884,6 +908,7 @@
 void CCertSaverModel::AddToMessageWithStringL(
     TDes& aMessage, TInt aStringResID, const TDesC& aString ) const
     {
+
     HBufC* promptPtr = NULL;
     promptPtr = StringLoader::LoadL( aStringResID, aString );
     CleanupStack::PushL( promptPtr );
@@ -904,6 +929,7 @@
     TInt aStringResID,
     TInt aInt ) const
     {
+
     HBufC* promptPtr = NULL;
     promptPtr = StringLoader::LoadL( aStringResID, aInt );
     CleanupStack::PushL( promptPtr );
@@ -922,6 +948,7 @@
 //
 void CCertSaverModel::AddToMessageL( TDes& aMessage, TInt aStringResID ) const
     {
+
     HBufC* promptPtr = NULL;
     promptPtr = StringLoader::LoadL( aStringResID );
     CleanupStack::PushL( promptPtr );
@@ -940,6 +967,7 @@
 //
 void CCertSaverModel::ConstructMessageL( TDes& aMessage ) const
     {
+
     HBufC16* issuerName = NULL;
     HBufC16* subjectName = NULL;
 
@@ -996,6 +1024,7 @@
 //
 void CCertSaverModel::AddKeyUsageL( TDes& aMessage, const CX509Certificate& aCert ) const
     {
+
     TKeyUsageX509 x509Usage = EX509UsageNone;
     TKeyUsagePKCS15 pkcs15KeyUsage = EPKCS15UsageNone;
     const CX509CertExtension* ext = aCert.Extension( KKeyUsage );
@@ -1079,6 +1108,7 @@
 void CCertSaverModel::AddValidityPeriodL(
     TDes& aMessage, const CX509Certificate& aCert ) const
     {
+
     // Hometime's offset to UTC
     TLocale locale;
     TTimeIntervalSeconds offSet = locale.UniversalTimeOffset();
@@ -1108,7 +1138,7 @@
     // format the date to user readable format. The format is locale dependent
     finishValue.FormatL( finishString, *dateFormatString );
     AknTextUtils::DisplayTextLanguageSpecificNumberConversion( finishString );
-    CleanupStack::PopAndDestroy(); // dateFormatString
+    CleanupStack::PopAndDestroy(dateFormatString); // dateFormatString
     aMessage.Append( finishString );
     AddNewlinesToMessage( aMessage );
     }
@@ -1120,6 +1150,7 @@
 //
 void CCertSaverModel::AddNewlinesToMessage( TDes& aMessage ) const
     {
+
     aMessage.Append( KDoubleEnter );
     }
 
@@ -1130,6 +1161,7 @@
 //
 TBool CCertSaverModel::CertificateSupported() const
     {
+
     if ( iCertFormat == EX509Certificate &&
        ( iCertOwnerType == ECACertificate ||
          iCertOwnerType == EPeerCertificate ||
@@ -1151,19 +1183,20 @@
 //
 TBool CCertSaverModel::CertificateOkL() const
     {
-    if ( !CertificateSupported() )
+
+    if ( !CertificateSupported() ) 
         {
-        ShowErrorNoteL( R_CERTSAVER_ERROR_UNSUPPORTED_CERT );
+        ShowInformationNoteL(R_CERTSAVER_ERROR_UNSUPPORTED_CERT);
         return EFalse;
         }
     if ( CertNotValidAnymore() )
         {
-        ShowErrorNoteL( R_CERTSAVER_ERROR_CERT_NOT_VALID );
+        ShowInformationNoteL(R_CERTSAVER_ERROR_CERT_NOT_VALID);
         return ETrue;
         }
     else if ( CertNotValidYet() )
         {
-        ShowErrorNoteL( R_CERTSAVER_ERROR_CERT_NOT_VALID_YET );
+        ShowInformationNoteL(R_CERTSAVER_ERROR_CERT_NOT_VALID_YET);
         }
     return ETrue;
     }
@@ -1175,6 +1208,7 @@
 //
 TBool CCertSaverModel::CertNotValidAnymore() const
     {
+
     TTime homeTime;
     homeTime.HomeTime();
     if ( iNewCert->ValidityPeriod().Finish() < homeTime )
@@ -1191,6 +1225,7 @@
 //
 TBool CCertSaverModel::CertNotValidYet() const
     {
+
     TTime homeTime;
     homeTime.HomeTime();
     if ( iNewCert->ValidityPeriod().Start() > homeTime )
@@ -1207,35 +1242,15 @@
 //
 void CCertSaverModel::ShowInformationNoteL( TInt aResourceID ) const
     {
-    HBufC* buffer = iAppUi->CoeEnv()->AllocReadResourceLC( aResourceID );
-    CAknInformationNote* note = new (ELeave) CAknInformationNote( ETrue );
-    note->ExecuteLD( buffer->Des() );
-    CleanupStack::PopAndDestroy( buffer );
-    }
-// ----------------------------------------------------------
-// CCertSaverModel::ShowConfirmationNoteL() const
-// Creates and shows a confirmation note.
-// ----------------------------------------------------------
-//
-void CCertSaverModel::ShowConfirmationNoteL( TInt aResourceID ) const
-    {
+
     HBufC* buffer = iAppUi->CoeEnv()->AllocReadResourceLC( aResourceID );
-    CAknConfirmationNote* note = new (ELeave) CAknConfirmationNote( ETrue );
-    note->ExecuteLD( buffer->Des() );
-    CleanupStack::PopAndDestroy( buffer );
-    }
-
-// ----------------------------------------------------------
-// CCertSaverModel::ShowErrorNoteL() const
-// Creates and shows an error note.
-// ----------------------------------------------------------
-//
-void CCertSaverModel::ShowErrorNoteL( TInt aResourceID ) const
-    {
-    HBufC* buffer = iAppUi->CoeEnv()->AllocReadResourceLC( aResourceID );
-    CAknErrorNote* note = new (ELeave) CAknErrorNote( ETrue );
-    note->ExecuteLD(buffer->Des());
-    CleanupStack::PopAndDestroy( buffer );
+    CHbDeviceMessageBoxSymbian* iMessageBox = CHbDeviceMessageBoxSymbian::NewL(CHbDeviceMessageBoxSymbian::EInformation);
+    CleanupStack::PushL(iMessageBox);                                                                                    
+    iMessageBox->SetTextL(buffer->Des());                                                                                
+    iMessageBox->SetTimeout(6000);                                                                                      
+    iMessageBox->ExecL();                                                                                                
+    CleanupStack::PopAndDestroy(iMessageBox);                                                                            
+    CleanupStack::PopAndDestroy( buffer );      
     }
 
 // ----------------------------------------------------------
@@ -1247,6 +1262,7 @@
 //
 TPtrC CCertSaverModel::TrimCertificateFields( TPtrC aField ) const
     {
+
     TPtrC cutField = CutCertificateField( aField );
     // Find one semicolon at a time and crop the
     // helpField from the left to search for the next semicolon
@@ -1298,6 +1314,7 @@
 //
 TPtrC CCertSaverModel::CutCertificateField( TPtrC aField ) const
     {
+
     TInt fieldLength = aField.Length();
     if ( fieldLength >= KMaxLengthTextCertIdentifierVisible )
         {
@@ -1314,10 +1331,8 @@
 //
 TInt CCertSaverModel::QueryTrusterUidsL( RArray<TUid>& aUids )
     {
+
     TInt ret = KErrCancel;
-    CArrayFixFlat<TInt>* selectionArray =
-        new (ELeave)  CArrayFixFlat<TInt>( KTrusterArrayInitSize );
-    CleanupStack::PushL( selectionArray );
     CDesCArray* itemsArray = new (ELeave) CDesCArrayFlat( KTrusterArrayInitSize );
     CleanupStack::PushL( itemsArray );
 
@@ -1330,28 +1345,52 @@
     CleanupClosePushL( appsInItemArray );
     UpdateTrustListboxItemL( apps, appsInItemArray, *itemsArray );
 
-    CAknListQueryDialog* dlg = new (ELeave) CAknListQueryDialog( selectionArray );
-    CleanupStack::PushL( dlg );
-    dlg->PrepareLC( R_CERTSAVER_TRUST_SETTINGS_QUERY );
-    dlg->SetItemTextArray( itemsArray );
-    dlg->SetOwnershipType( ELbmDoesNotOwnItemArray );
-    if ( dlg->RunLD() )
+    HBufC* title = CEikonEnv::Static()->AllocReadResourceLC( R_CERTSAVER_SELECT_TRUSTED_APPS);
+
+    RBuf rBuf;     // buffer for items with big enough space
+    rBuf.CreateL(KMaxLengthTextMeassageBody);
+    CleanupClosePushL(rBuf);
+    for(TInt i = 0; i<itemsArray->Count(); i++) 
+        rBuf.Append( (*itemsArray)[i] ); 
+
+    CSecQueryUi* SecQueryUi = CSecQueryUi::NewL();     
+    TInt saved = SecQueryUi->SecQueryDialog(*title, rBuf,1,KTokenLength,              
+                                             ESecUiAlphaSupported | ESecUiCancelSupported |
+                                             ESecUiBasicTypeMultiCheck |
+                                             ESecUiEmergencyNotSupported);   
+    delete SecQueryUi;
+    SecQueryUi=NULL;
+
+    if (saved==KErrNone)
         {
-        aUids.Reset();
-        for ( TInt i = 0; i < selectionArray->Count(); ++i )
-            {
-            TInt ii = (*selectionArray)[ i ];
-            aUids.Append( appsInItemArray[ ii ].Id() );
-            }
+        TLex16 lex(rBuf);
+        TChar ch;                                        
+        TBuf16<KTokenLength> token;          
+        TInt  val;
+        while((ch = lex.Get()) != 0 ){                   
+           while ((ch = lex.Peek()) != '|' && ch!=0) lex.Inc();
+           token.Copy(lex.MarkedToken());                
+           TLex lexc(token);
+           if(lexc.Val(val)!=KErrNone) val=0;
+           if(val<=appsInItemArray.Count()-1)
+               aUids.Append( appsInItemArray[ val ].Id() );
+           lex.Inc();                                    
+           lex.Mark();                                   
+         }  
         ret = KErrNone;
         }
     else
         {
-        ShowConfirmationNoteL( R_CERTSAVER_CERT_DISCARDED );
+        ShowInformationNoteL(R_CERTSAVER_CERT_DISCARDED);
         ret = KErrCancel;
         }
-    CleanupStack::Pop( dlg );
-    CleanupStack::PopAndDestroy( 4, selectionArray );
+
+    rBuf.Close();
+    CleanupStack::PopAndDestroy(&rBuf);
+    CleanupStack::PopAndDestroy(title);
+    CleanupStack::PopAndDestroy(&appsInItemArray);
+    CleanupStack::PopAndDestroy(appInfoManager);
+    CleanupStack::PopAndDestroy(itemsArray);
     return ret;
     }
 
@@ -1362,6 +1401,7 @@
 //
 TInt CCertSaverModel::QueryTrustedSiteL()
     {
+
     TInt ret = KErrCancel;
     HBufC* label = NULL;
     HBufC* secondaryName = NULL;
@@ -1373,27 +1413,19 @@
     delete secondaryName;
     secondaryName = NULL;
     labelBuf = label->Des().Left( CERTSAVER_MAX_LABEL_LEN );
-
-
     HBufC* prompt = StringLoader::LoadLC( R_CERTSAVER_TRUSTEDSITE_WARNING, labelBuf );
-
-    CAknMessageQueryDialog* note = CAknMessageQueryDialog::NewL( *prompt );
-
-    note->PrepareLC( R_CERTSAVER_TRUSTED_SITE_QUERY );
-    note->SetPromptL( *prompt );
-
-    if ( note->RunLD() )
+    CHbDeviceMessageBoxSymbian::TButtonId selection =
+        CHbDeviceMessageBoxSymbian::QuestionL(prompt->Des(), KNullDesC, KNullDesC);
+    if ( selection == CHbDeviceMessageBoxSymbian::EAcceptButton)
         {
         ret = KErrNone;
         }
     else
         {
-        ShowConfirmationNoteL( R_CERTSAVER_CERT_DISCARDED );
+        ShowInformationNoteL(R_CERTSAVER_CERT_DISCARDED);
         ret = KErrCancel;
         }
-
     CleanupStack::PopAndDestroy( prompt );
-
     CleanupStack::PopAndDestroy( label );
     return ret;
     }
@@ -1408,6 +1440,7 @@
     RArray<TCertificateAppInfo>& aAppsInItemArray,
     CDesCArray& aItemsArray ) const
   {
+
     for ( TInt i = 0; i < aApps.Count(); i++ )
         {
         TCertificateAppInfo appInfo = aApps[ i ];
@@ -1470,6 +1503,7 @@
 //
 void CCertSaverModel::DivideToBlocks( const TDesC8& aInput, TDes& aOutput ) const
     {
+
     _LIT( KBlockSeparator, " " );
     const TInt KBlockLength = 2;
     TInt blockIndex = 0;
@@ -1492,25 +1526,37 @@
 //
 void CCertSaverModel::SavePKCS12L()
     {
+
     HBufC* message = HBufC::NewLC( KMaxLengthTextMeassageBody );
     TPtr msgPtr = message->Des();
     ConstructPKCS12QueryMsgL(msgPtr, iParser.Keys().Count(),
                             iParser.UserCertificates().Count(),
                             iParser.CACertificates().Count() );
-    TBool save = DoMessageQueryL(
-        R_MESSAGE_QUERY_DOSAVE, R_CERTSAVER_HEADER_PKCS12_FILE_CONTAINS,
-        *message );
-    CleanupStack::PopAndDestroy( message );
+
+    //TODO: Should be in loc file but hardcoded now
+    _LIT(KCheckBoxCaption,"Protect with Password|1");
+    TBuf<KMaxLengthTextCheckBoxData> CheckeBoxData(KCheckBoxCaption);
+
+    CSecQueryUi* SecQueryUi = CSecQueryUi::NewL();    
+    TInt save = SecQueryUi->SecQueryDialog(*message, CheckeBoxData,1,1,
+                                            ESecUiAlphaSupported | ESecUiCancelSupported |
+                                            ESecUiBasicTypeCheck | ESecUiEmergencyNotSupported);
+    CleanupStack::Pop(message);
     message = NULL;
-    if ( !save )
+    delete SecQueryUi;
+    SecQueryUi=NULL;
+
+    if ( save!=KErrNone )
         {
         ShowInformationNoteL( R_CERTSAVER_PKCS12_DISCARDED );
         User::Leave( KErrExitApp );
         }
     TInt status = KErrNone;
     // save private keys
-    TRAP( status, SavePrivateKeyL() );
-
+   if(CheckeBoxData.Compare(_L("1"))==0)
+   {
+       TRAP( status, SavePrivateKeyL() );
+   }
     // save user certificates if private key was saved.
     if ( ( iSavedKeysCount > 0 || iKeyAlreadyExists ) && iParser.UserCertificates().Count() > 0 )
         {
@@ -1543,42 +1589,28 @@
                 }
             }
         }
+/*
     if ( iSavedCACertsCount != 0 || iSavedKeysCount != 0
         || iSavedUserCertsCount != 0 )
         {
-        message = HBufC::NewLC( KMaxLengthTextMeassageBody );
-        TPtr msgPtr2 = message->Des();
-        ConstructPKCS12QueryMsgL(
+// show how many have been saved
+        HBufC* p = StringLoader::LoadLC( R_CERTSAVER_HEADER_SAVED );             
+        message = HBufC::NewLC( KMaxLengthTextMeassageBody );                    
+        message->Des().Append(p->Des());                                         
+        TPtr msgPtr2 = message->Des();                                           
+        ConstructPKCS12QueryMsgL(                                                
             msgPtr2, iSavedKeysCount, iSavedUserCertsCount, iSavedCACertsCount );
-        DoMessageQueryL(
-            R_MESSAGE_QUERY_SAVED, R_CERTSAVER_HEADER_SAVED, *message );
-        CleanupStack::PopAndDestroy( message );
+        CHbDeviceMessageBoxSymbian::InformationL(message->Des());                
+        CleanupStack::PopAndDestroy( message );                                  
+        CleanupStack::PopAndDestroy( p );                                        
         }
     else
         {
+        // the contents could not be saved is dropped
         ShowInformationNoteL( R_QTN_CM_PKCS12_SAVING_FAILED );
+        CleanupStack::PopAndDestroy( message );
         }
-    }
-
-// ----------------------------------------------------------
-// CCertSaverModel::DoMessageQuery()
-// Displays message query dialog for user.
-// ----------------------------------------------------------
-//
-TBool CCertSaverModel::DoMessageQueryL(
-    TInt aDialogResId,
-    TInt aHeadingResId,
-    TDesC& aMessage )
-    {
-    CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL( aMessage );
-    CleanupStack::PushL( dlg );
-    dlg->PrepareLC( aDialogResId );
-
-    HBufC* header = StringLoader::LoadLC( aHeadingResId );
-    dlg->QueryHeading()->SetTextL( header->Des() );
-    CleanupStack::PopAndDestroy( header );
-    CleanupStack::Pop( dlg );
-    return dlg->RunLD();
+*/
     }
 
 // ----------------------------------------------------------
@@ -1592,6 +1624,7 @@
     TInt aUserCerts,
     TInt aCACerts ) const
     {
+
     if ( aPrivateKeys > 0 )
         {
         if ( aPrivateKeys == 1 )
--- a/pkiutilities/CertSaver/src/certparser.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CertSaver/src/certparser.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -25,14 +25,17 @@
 #include <X509CertNameParser.h>
 #include <featmgr.h>
 #include <data_caging_path_literals.hrh>
-#include <AknQueryDialog.h>
 #include <CertSaver.rsg>
 #include <StringLoader.h>
 #include <securityerr.h>
-#include <aknnotewrappers.h>              // Note dialogs
 #include <apmrec.h>
+#include <eikenv.h>                       // CEikonEnv
 #include "certparser.h"
 
+#include "SecQueryUi.h"                   // needed for password dialog
+
+#include <hbdevicemessageboxsymbian.h>    // needed for Note dialogs    
+
 // CONSTANTS
 _LIT( KPKCS12DllName, "crpkcs12.dll" );   // PKCS12 DLL name
 const TInt KX509Version3 = 3;
@@ -94,6 +97,7 @@
 //
 void CCertParser::SetContentL( RFile& aFile )
     {
+
     delete iCert;
     iCert = NULL;
     TInt fileSize = 0;
@@ -126,7 +130,8 @@
 //
 void CCertParser::CreatePKCS12L()
     {
-    // Load PKCS#12 dll
+
+        // Load PKCS#12 dll
 #ifdef __WINS__
     User::LeaveIfError ( iLibrary.Load( KPKCS12DllName ) );
 #else
@@ -151,6 +156,7 @@
     const TDesC8& aPKCS12,
     const TDesC& aFileName )
     {
+
     CreatePKCS12L();
 
     if ( !iPKCS12->IsPKCS12Data( aPKCS12 ) )
@@ -161,21 +167,12 @@
 
     TBool done = EFalse;
     TBuf<KPwMaxLength> password;
-    HBufC* buffer = NULL;
-
-    if ( !iEikEnv )
-        {
-        iEikEnv = CEikonEnv::Static();
-        }
 
     while ( !done )
         {
         if ( !GetPasswordL( password, aFileName ) )
             {
-            buffer = iEikEnv->AllocReadResourceLC( R_CERTSAVER_PKCS12_DISCARDED );
-            CAknInformationNote* note = new (ELeave) CAknInformationNote( ETrue );
-            note->ExecuteLD(buffer->Des());
-            CleanupStack::PopAndDestroy( buffer );
+            ShowErrorNoteL(R_CERTSAVER_PKCS12_DISCARDED);
             User::Leave( KErrExitApp );
             }
         TRAPD( err, iPKCS12->ParseL( aPKCS12, password ) );
@@ -226,15 +223,19 @@
 //
 TInt CCertParser::GetPasswordL( TDes& aPassword, const TDesC& aFileName )
     {
-    CAknTextQueryDialog* query = CAknTextQueryDialog::NewL( aPassword );
-    CleanupStack::PushL( query );
-    HBufC* prompt =
-        StringLoader::LoadLC( R_QTN_CM_TITLE_P12_PASSWORD, aFileName );
-    query->SetPromptL( *prompt );
-    CleanupStack::PopAndDestroy( prompt );
-    CleanupStack::Pop( query );
-    return query->ExecuteLD( R_PKCS12_PW_QUERY_DIALOG );
-    }
+    CSecQueryUi* SecQueryUi = CSecQueryUi::NewL();                                       
+    HBufC* prompt =StringLoader::LoadLC( R_QTN_CM_TITLE_P12_PASSWORD, aFileName );        
+    TInt queryAccepted = SecQueryUi->SecQueryDialog(prompt->Des(), aPassword,                
+                                                1,KPwMaxLength,                               
+                                                ESecUiAlphaSupported |                        
+                                                ESecUiCancelSupported |                       
+                                                ESecUiSecretSupported |                
+                                                ESecUiEmergencyNotSupported); 
+    CleanupStack::PopAndDestroy( prompt );                                                
+    delete SecQueryUi;                                                                   
+    SecQueryUi=NULL;
+    return (queryAccepted==KErrNone);
+  }
 
 // ----------------------------------------------------------
 // CCertParser::CheckIfX509CertificateL()
@@ -243,6 +244,7 @@
 //
 TBool CCertParser::CheckIfX509CertificateL(const TDesC8& aCert)
     {
+
     TRAPD( err,
            iCert = CX509Certificate::NewL(aCert);
          );
@@ -302,6 +304,7 @@
 //
 const CArrayPtr<CX509Certificate>&  CCertParser::CACertificates() const
     {
+
     __ASSERT_ALWAYS( iPKCS12, User::Panic( KCertSaverPanic, KPanicNullPointer ) );
     return iPKCS12->CACertificates();
     }
@@ -312,6 +315,7 @@
 //
 const CArrayPtr<CX509Certificate>&  CCertParser::UserCertificates() const
     {
+
     __ASSERT_ALWAYS( iPKCS12, User::Panic( KCertSaverPanic, KPanicNullPointer ) );
     return iPKCS12->UserCertificates();
     }
@@ -322,6 +326,7 @@
 //
 const CArrayPtr<HBufC8>& CCertParser::Keys() const
     {
+
     __ASSERT_ALWAYS( iPKCS12, User::Panic( KCertSaverPanic, KPanicNullPointer ) );
     return iPKCS12->PrivateKeys();
     }
@@ -332,6 +337,7 @@
 //
  CCertParser::TCertType CCertParser::CertType() const
     {
+
     return iCertType;
     }
 
@@ -342,6 +348,7 @@
 //
 const TPtrC8 CCertParser::CertificateBuf() const
     {
+
     __ASSERT_ALWAYS( iCert, User::Panic( KCertSaverPanic, KPanicNullPointer ) );
     return iCert->Encoding();
     }
@@ -353,6 +360,7 @@
 //
 const CX509Certificate& CCertParser::Certificate() const
     {
+
     __ASSERT_ALWAYS( iCert, User::Panic( KCertSaverPanic, KPanicNullPointer ) );
     return *((CX509Certificate*)iCert);
     }
@@ -369,9 +377,13 @@
         iEikEnv = CEikonEnv::Static();
         }
     HBufC* buffer = iEikEnv->AllocReadResourceLC( aResourceID );
-    CAknErrorNote* note = new (ELeave) CAknErrorNote( ETrue );
-    note->ExecuteLD(buffer->Des());
-    CleanupStack::PopAndDestroy( buffer );
+    CHbDeviceMessageBoxSymbian* iMessageBox = CHbDeviceMessageBoxSymbian::NewL(CHbDeviceMessageBoxSymbian::EWarning);
+    CleanupStack::PushL(iMessageBox);                                                                                    
+    iMessageBox->SetTextL(buffer->Des());                                                                                
+    iMessageBox->SetTimeout(6000);                                                                                      
+    iMessageBox->ExecL();                                                                                                
+    CleanupStack::PopAndDestroy(iMessageBox);                                                                            
+    CleanupStack::PopAndDestroy( buffer );                                                                               
     }
 
 //  End of File
--- a/pkiutilities/CertmanUi/INC/CertmanuiCommon.h	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CertmanUi/INC/CertmanuiCommon.h	Tue Aug 31 16:04:40 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2003-2007 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -73,8 +73,8 @@
 const TInt KMaxLengthTextDateString = 11;
 // HH0
 const TInt KMaxLengthTextSerialNumberFormatting = 3;
-// CertLabel, Issuer, Owner max length 1024 bytes
-const TInt KMaxLengthTextCertLabel = 1024;
+// CertLabel, Issuer, Owner max length 510 bytes
+const TInt KMaxLengthTextCertLabel = 510;
 // CertLabel, Issuer, Owner max visible length
 const TInt KMaxLengthTextCertLabelVisible = 200;
 // CertWimLabel, KeyLabel, KeyWimLabel max length 255 bytes
--- a/pkiutilities/CertmanUi/INC/CertmanuiKeeper.h	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CertmanUi/INC/CertmanuiKeeper.h	Tue Aug 31 16:04:40 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -195,16 +195,11 @@
         */
         TBool   iStartup;
 
-        /**
+         /**
         * Certificate helper class
         */
         CCertManUICertificateHelper*    iCertificateHelper;
 
-        /**
-        * Index for the current CA cert for changing trust settings
-        */
-        TInt iCurrentCACertForTrustSettings;
-
     private: // functions
 
         /**
--- a/pkiutilities/CertmanUi/INC/CertmanuicontainerTrust.h	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CertmanUi/INC/CertmanuicontainerTrust.h	Tue Aug 31 16:04:40 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2003-2007 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -33,7 +33,6 @@
 const TInt KTrustSettingsResourceIndexJavaInstall = 3;
 const TInt KTrustSettingsResourceIndexOCSPCheck = 4;
 const TInt KTrustSettingsResourceIndexVPN = 5;
-const TInt KTrustSettingsResourceIndexWidget = 6;
 const TInt KTrustSettingsResourceIndexValueYes = 0;
 const TInt KTrustSettingsResourceIndexValueNo = 1;
 
@@ -240,8 +239,6 @@
         void ShowTrustChangeSettingPageL( const TUid aClientUid,
             TDesC& aClientName, CCTCertInfo& aEntry );
 
-        void ChangeTrustChangeSettingSingleClickL();
-
         void InsertItemToTrustListL( const TInt index, const TUid id,
                                    CCTCertInfo& entry, CDesCArray* itemArray,
                                    TInt position );
--- a/pkiutilities/CertmanUi/INC/Certmanuitrustids.h	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CertmanUi/INC/Certmanuitrustids.h	Tue Aug 31 16:04:40 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2003-2007 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -28,7 +28,6 @@
 const TUid KCertManUIViewTrustJavaInstallingId = {270506792};
 const TUid KCertManUIViewOCSPCheckInstallingId = {268478646};
 const TUid KCertManUIViewTrustVPNId = {270498195};
-const TUid KCertManUIViewTrustWidgetInstallingId = {537028562};
 
 #endif // __CERTMANUITRUSTIDS_H
 
--- a/pkiutilities/CertmanUi/SRC/CertmanuiCertificateHelper.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CertmanUi/SRC/CertmanuiCertificateHelper.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -527,6 +527,7 @@
 // HBufC& aMessage, TPtrC aValue, TInt aResourceOne)
 // Reads dynamic text from CertManAPI, if the string is empty
 // put a not defined text from the resource in its place
+// KMaxLengthTextCertLabel = 510, used by CertLabel(), Issuer(), Owner()
 // ---------------------------------------------------------
 //
 void CCertManUICertificateHelper::DetailsDynamicL(
@@ -535,29 +536,26 @@
     CERTMANUILOGGER_ENTERFN(
         "CCertManUICertificateHelper::DetailsDynamicL" );
 
-    HBufC* buf = aValue.AllocLC();
-    TPtr trimmedValue( buf->Des() );
-    trimmedValue.TrimLeft();
-
-    if( trimmedValue.Length() > KMaxLengthTextCertLabelVisible )
-        {
-        trimmedValue.SetLength( KMaxLengthTextCertLabelVisible - 1 );
-        trimmedValue.Append( KTextUtilClipEndChar );
-        }
-
-    if ( trimmedValue.Length() == 0 )
+    HBufC* buf = HBufC::NewLC( KMaxLengthTextCertLabel );
+    buf->Des() = aValue;
+    buf->Des().TrimLeft();
+    // Cut CertLabel after fourth semi colon
+    TPtrC trimmedCertLabel = CutCertificateField( buf->Des() );
+    buf->Des().Copy( trimmedCertLabel );
+    TInt length = buf->Des().Length();
+    if ( length == 0 )
         {
         DetailsResourceL( aMessage, aResourceOne );
         }
     else
         {
-        //LRM (Left-to-Right mark 0x200E)
+        //LRM (Left-to-Right mark 200E)
         const TInt KLRMark = 0x200E;
-        aMessage.Des().Append( trimmedValue );
-        aMessage.Des().Append( KLRMark );
+        aMessage.Des().Append( buf->Des() );
+        aMessage.Des().Append(KLRMark);
         aMessage.Des().Append( KCertManUIDetailsViewEnter );
         }
-    CleanupStack::PopAndDestroy( buf );
+    CleanupStack::PopAndDestroy();  // buf
 
     CERTMANUILOGGER_LEAVEFN(
         "CCertManUICertificateHelper::DetailsDynamicL" );
--- a/pkiutilities/CertmanUi/SRC/CertmanuiKeeper.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CertmanUi/SRC/CertmanuiKeeper.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -170,8 +170,7 @@
 // Constructor with parent
 // ---------------------------------------------------------
 //
-CCertManUIKeeper::CCertManUIKeeper() : iCurrentCACertForTrustSettings( KErrNotFound ),
-        iResourceLoader( *iCoeEnv )
+CCertManUIKeeper::CCertManUIKeeper(): iResourceLoader( *iCoeEnv )
     {
     CERTMANUILOGGER_CREATE; //lint !e960
     CERTMANUILOGGER_WRITE_TIMESTAMP( "CCertManUIKeeper::CCertManUIKeeper" );
--- a/pkiutilities/CertmanUi/SRC/CertmanuicontainerAuthority.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CertmanUi/SRC/CertmanuicontainerAuthority.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -79,7 +79,12 @@
     CreateWindowL();
     CreateListBoxL();
     UpdateListBoxL( aCurrentPosition, aTopItem );
-    iListBox->ItemDrawer()->ColumnData()->SetIconArray( iIconHandler->CreateIconArrayL() );
+    if ( iListBox )
+        {
+        // Creates graphic.
+        iListBox->ItemDrawer()->ColumnData()->
+            SetIconArray( iIconHandler->CreateIconArrayL() );
+        }
     SetRect( aRect );
 
     CERTMANUILOGGER_LEAVEFN( " CCertManUIContainerAuthority::ConstructL" );
--- a/pkiutilities/CertmanUi/SRC/CertmanuicontainerDevice.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CertmanUi/SRC/CertmanuicontainerDevice.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -80,7 +80,14 @@
     CreateWindowL();
     CreateListBoxL();
     UpdateListBoxL( aCurrentPosition, aTopItem );
-    iListBox->ItemDrawer()->ColumnData()->SetIconArray( iIconHandler->CreateIconArrayL() );
+
+    if ( iListBox )
+        {
+        // Creates graphic.
+        iListBox->ItemDrawer()->ColumnData()->
+        SetIconArray( iIconHandler->CreateIconArrayL() );
+    }
+
     SetRect( aRect );
 
     CERTMANUILOGGER_LEAVEFN( " CCertManUIContainerDevice::ConstructL" );
--- a/pkiutilities/CertmanUi/SRC/CertmanuicontainerPersonal.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CertmanUi/SRC/CertmanuicontainerPersonal.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -79,7 +79,12 @@
     CreateWindowL();
     CreateListBoxL();
     UpdateListBoxL( aCurrentPosition, aTopItem );
-    iListBox->ItemDrawer()->ColumnData()->SetIconArray( iIconHandler->CreateIconArrayL() );
+    if ( iListBox )
+        {
+        // Creates graphic.
+        iListBox->ItemDrawer()->ColumnData()->
+            SetIconArray( iIconHandler->CreateIconArrayL() );
+        }
     SetRect( aRect );
 
     CERTMANUILOGGER_LEAVEFN( " CCertManUIContainerPersonal::ConstructL" );
--- a/pkiutilities/CertmanUi/SRC/CertmanuicontainerTrust.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CertmanUi/SRC/CertmanuicontainerTrust.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -170,7 +170,10 @@
     switch( aEventType )
         {
         case EEventItemSingleClicked:
-            ChangeTrustChangeSettingSingleClickL();
+            if ( !iKeeper.iWrapper->IsActive() )
+                {
+                iParent.ChangeTrustL();
+                }
             break;
         default:
             {
@@ -432,10 +435,6 @@
         {
         resIndex = KTrustSettingsResourceIndexVPN;
         }
-    else if ( aTrusterUid == KCertManUIViewTrustWidgetInstallingId )
-        {
-        resIndex = KTrustSettingsResourceIndexWidget;
-        }
     else
         {
         resIndex = KErrNotFound;
@@ -596,23 +595,23 @@
             }
         else if ( id == KCertManUIViewTrustMailAndImageConnId )
             {
-            item = (*iTrustedClients)[ KTrustSettingsResourceIndexMailAndImageConn ];
+            item =
+             (*iTrustedClients)[ KTrustSettingsResourceIndexMailAndImageConn ];
             }
         else if ( id == KCertManUIViewTrustJavaInstallingId )
             {
-            item = (*iTrustedClients)[ KTrustSettingsResourceIndexJavaInstall ];
+            item =
+             (*iTrustedClients)[ KTrustSettingsResourceIndexJavaInstall ];
             }
         else if ( id == KCertManUIViewOCSPCheckInstallingId )
             {
-            item = (*iTrustedClients)[ KTrustSettingsResourceIndexOCSPCheck ];
+            item =
+             (*iTrustedClients)[ KTrustSettingsResourceIndexOCSPCheck ];
             }
         else if ( id == KCertManUIViewTrustVPNId )
             {
-            item = (*iTrustedClients)[ KTrustSettingsResourceIndexVPN ];
-            }
-        else if ( id == KCertManUIViewTrustWidgetInstallingId )
-            {
-            item = (*iTrustedClients)[ KTrustSettingsResourceIndexWidget ];
+            item =
+             (*iTrustedClients)[ KTrustSettingsResourceIndexVPN ];
             }
         else
             {
@@ -698,33 +697,6 @@
     }
 
 // ---------------------------------------------------------------------------
-// CCertManUIContainerTrust::ChangeTrustChangeSettingSingleClickL()
-// ---------------------------------------------------------------------------
-//
-void CCertManUIContainerTrust::ChangeTrustChangeSettingSingleClickL()
-    {
-    if( !iKeeper.iWrapper->IsActive() )
-        {
-        TInt certIndex = iKeeper.iCurrentCACertForTrustSettings;
-
-        if( certIndex >= 0 && certIndex < iKeeper.iCALabelEntries.Count() )
-            {
-            CCTCertInfo* entry = iKeeper.iCALabelEntries[ certIndex ]->iCAEntry;
-            if( entry && entry->IsDeletable() )
-                {
-                TInt currentTrustSetting = iListBox->CurrentItemIndex();
-                if( currentTrustSetting >= 0 && currentTrustSetting < iClientUids.Count() )
-                    {
-                    TUid uid = iClientUids[ currentTrustSetting ];
-                    ChangeTrustValueL( *entry, uid );
-                    UpdateTrustListboxItemL( *entry, currentTrustSetting );
-                    }
-                }
-            }
-        }
-    }
-
-// ---------------------------------------------------------------------------
 // CCertManUIContainerTrust::PopupTrustChangeSettingPageL(
 //      TInt aCertificateIndex)
 // Finds out which client was focused in Trust Settings view and calls
@@ -748,7 +720,7 @@
         CERTMANUILOGGER_LEAVEFN( "- PopupTrustChangeSettingPageL - read-only" );
     	return;
     	}
-
+    
     TUid id = KCertManUINullId;
     TInt poppableItems = 0;
 
--- a/pkiutilities/CertmanUi/SRC/CertmanuicontainerTrustedSite.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CertmanUi/SRC/CertmanuicontainerTrustedSite.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -78,7 +78,12 @@
     CreateWindowL();
     CreateListBoxL();
     UpdateListBoxL( aCurrentPosition, aTopItem );
-    iListBox->ItemDrawer()->ColumnData()->SetIconArray( iIconHandler->CreateIconArrayL() );
+    if ( iListBox )
+        {
+        // Creates graphic.
+        iListBox->ItemDrawer()->ColumnData()->
+             SetIconArray( iIconHandler->CreateIconArrayL() );
+    }
     SetRect( aRect );
 
     CERTMANUILOGGER_LEAVEFN( " CCertManUIContainerTrustedSite::ConstructL" );
--- a/pkiutilities/CertmanUi/SRC/Certmanuidialogs.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CertmanUi/SRC/Certmanuidialogs.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -59,8 +59,7 @@
 
     if( !iDialog )
         {
-        iDialog = new( ELeave ) CAknWaitDialog(
-                reinterpret_cast< CEikDialog** >( &iDialog ), ETrue );
+        iDialog = new( ELeave ) CAknWaitDialog( reinterpret_cast< CEikDialog** >( &iDialog ) );
 
         TInt dialog = 0;
         switch( aDialogSelector )
--- a/pkiutilities/CertmanUi/SRC/CertmanuiviewAuthority.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CertmanUi/SRC/CertmanuiviewAuthority.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -364,7 +364,6 @@
                 }
             CleanupStack::PopAndDestroy();  // buf
 
-            iKeeper.iCurrentCACertForTrustSettings = helpIndex3;
             ((CAknViewAppUi*)iAvkonAppUi)->ActivateLocalViewL(
                 KCertManUIViewTrustId, TUid::Uid( helpIndex3), KNullDesC8 );
             break;
--- a/pkiutilities/CertmanUi/SRC/CertmanuiviewPersonal.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CertmanUi/SRC/CertmanuiviewPersonal.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -496,17 +496,11 @@
     {
     CERTMANUILOGGER_ENTERFN( "CCertManUIViewPersonal::DoDeactivate" );
 
-    if( iContainerPersonal )
+    iCurrentPosition = iContainerPersonal->iListBox->CurrentItemIndex();
+    iTopItem = iContainerPersonal->iListBox->TopItemIndex();
+    if ( iContainerPersonal )
         {
-        CEikColumnListBox* listBox = iContainerPersonal->iListBox;
-        if( listBox )
-            {
-            iCurrentPosition = listBox->CurrentItemIndex();
-            iTopItem = listBox->TopItemIndex();
-            }
-
-        iAvkonAppUi->RemoveFromViewStack( *this, iContainerPersonal );
-
+        ((CAknViewAppUi*)iAvkonAppUi)->RemoveFromViewStack(*this, iContainerPersonal);
         delete iContainerPersonal;
         iContainerPersonal = NULL;
         }
--- a/pkiutilities/CertmanUi/SRC/CertmanuiviewTrust.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CertmanUi/SRC/CertmanuiviewTrust.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2003-2007 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -302,7 +302,6 @@
         }
 
     RemoveNaviPane();
-    iKeeper.iCurrentCACertForTrustSettings = KErrNotFound;
 
     CERTMANUILOGGER_LEAVEFN( " CCertManUIViewTrust::DoDeactivate" );
     }
--- a/pkiutilities/CertmanUi/data/certmanui.rss	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CertmanUi/data/certmanui.rss	Tue Aug 31 16:04:40 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -1120,10 +1120,6 @@
     {
     buf = qtn_cm_algorithm_sha1;
     }
-RESOURCE TBUF r_text_resource_details_view_algorithm_SHA2
-    {
-    buf = qtn_cm_algorithm_sha2;
-    }
 
 //----------------------------------------------------
 //
@@ -1338,10 +1334,6 @@
         LBUF
             {//VPN
             txt = " \t"qtn_cm_lipri_vpn"\t\t";
-            },
-        LBUF
-            {//Widget installer
-            txt = " \t"qtn_cm_lipri_widget_installing"\t\t";
             }
         };
     }
--- a/pkiutilities/CertmanUi/loc/certmanui.loc	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/CertmanUi/loc/certmanui.loc	Tue Aug 31 16:04:40 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -109,10 +109,6 @@
 //l:popup_info_list_pane_t1
 #define qtn_cm_algorithm_sha1           "SHA1"
 
-//d:Certificate details algorithm name
-//l:popup_info_list_pane_t1
-#define qtn_cm_algorithm_sha2           "SHA2"
-
 //d:Certificate details algorithm unknown
 //l:popup_info_list_pane_t1
 #define qtn_cm_algorithm_unknown        "Unknown"
@@ -237,12 +233,6 @@
 //l:list_single_graphic_pane_t1_cp2
 #define qtn_cm_lipri_native_installing    "Native installing"
 
-//d:Certificate trust settings widget installing.
-//d:With this user can decide if certificate is trusted for
-//d:installing widgets.
-//l:list_single_graphic_pane_t1_cp2
-#define qtn_cm_lipri_widget_installing    "Widget installing"
-
 //d:Certificate trust settings for OCSP validation.
 //d:With this user can decide if certificate is trusted to
 //d:validate ocsp response (i.e. SOS applications).
--- a/pkiutilities/PKCS12/CrPkcs12/group/crpkcs12.mmp	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/PKCS12/CrPkcs12/group/crpkcs12.mmp	Tue Aug 31 16:04:40 2010 +0300
@@ -42,7 +42,7 @@
 CAPABILITY  CAP_GENERAL_DLL
 VENDORID    VID_DEFAULT
 
-#if defined(ARMCC)
+#if defined( EABI )
 deffile ../eabi/ 
 #else
 deffile ../bwinscw/ 
--- a/pkiutilities/SecModUI/src/SecModUIViewAccess.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/SecModUI/src/SecModUIViewAccess.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -349,9 +349,9 @@
     {
     if( R_SECMODUI_VIEW_ACCESS_MENU == aResourceId )
         {        
-        if( !FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+        if( aResourceId == !FeatureManager::FeatureSupported( KFeatureIdHelp ) )
             {
-            aMenuPane->DeleteMenuItem( EAknCmdHelp );
+            aMenuPane->DeleteMenuItem( EAknCmdHelp ); //remove help
             }     
 
         TInt currentItem = iContainer->ListBox().CurrentItemIndex();
--- a/pkiutilities/SecModUI/src/SecModUIViewSignature.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/SecModUI/src/SecModUIViewSignature.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -172,9 +172,9 @@
         {
         case R_SECMODUI_VIEW_SIGNATURE_MENU:
             {
-            if( !FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+            if( aResourceId == !FeatureManager::FeatureSupported( KFeatureIdHelp ) )
                 {
-                aMenuPane->DeleteMenuItem( EAknCmdHelp );
+                aMenuPane->DeleteMenuItem( EAknCmdHelp ); //remove help
                 } 
             // The security module list is empty.  
             // All except Exit and Help is dimmed.
--- a/pkiutilities/StubSIS/swipolicy.ini	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-AllowUnsigned = false
-MandatePolicies = false
-MandateCodeSigningExtension = false
-Oid = 1.2.3.4.5.6
-Oid = 2.3.4.5.6.7
-DRMEnabled = true
-DRMIntent = 3
-OcspMandatory = false
-OcspEnabled = true
-AllowGrantUserCapabilities = true
-AllowOrphanedOverwrite = true
-UserCapabilities = NetworkServices LocalServices ReadUserData WriteUserData UserEnvironment Location 
-AllowPackagePropagate = true
-SISCompatibleIfNoTargetDevices = false
-RunWaitTimeoutSeconds = 600
-AllowRunOnInstallUninstall = false
-DeletePreinstalledFilesOnUninstall = true
-AlternativeCodeSigningOID = 1.3.6.1.4.1.94.1.49.1.2.2.1 1.3.6.1.4.1.94.1.49.1.2.2.5
-RemoveOnlyWithLastDependent = true
-PhoneTsyName = phonetsy
--- a/pkiutilities/StubSIS/tlsproviderpolicy.ini	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-ClientAuthDlgEnabled = true
-
--- a/pkiutilities/group/bld.inf	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/group/bld.inf	Tue Aug 31 16:04:40 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2005-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"
@@ -18,36 +18,22 @@
 
 #include "../x509certnameparser/group/bld.inf"
 #include "../PKCS12/group/bld.inf"
-#include "../CertmanUi/GROUP/bld.inf"
-#include "../CTSecurityDialogs/Group/bld.inf"
 #include "../CertSaver/group/bld.inf"
-#include "../SecModUI/group/bld.inf"
 #include "../DeviceToken/Group/bld.inf"
+#include "../securitydialognotifier/group/bld.inf"
+#include "../securitydialognotifiersrv/group/bld.inf"
 
 //Stub SIS
 PRJ_EXPORTS
 ../StubSIS/CenRepStub.sis   /epoc32/data/z/system/install/CenRepStub.sis
 
 
-//SWI and TLSProvider config files
-../StubSIS/swipolicy.ini    /epoc32/release/winscw/udeb/z/system/data/swipolicy.ini
-../StubSIS/swipolicy.ini    /epoc32/release/winscw/urel/z/system/data/swipolicy.ini
-../StubSIS/swipolicy.ini    /epoc32/data/z/system/data/swipolicy.ini
-                            
-../StubSIS/tlsproviderpolicy.ini  /epoc32/release/winscw/urel/z/resource/tlsproviderpolicy.ini
-../StubSIS/tlsproviderpolicy.ini  /epoc32/release/winscw/udeb/z/resource/tlsproviderpolicy.ini
-
 // export iby files
 ../rom/x509certnameparser.iby   CORE_MW_LAYER_IBY_EXPORT_PATH( x509certnameparser.iby )
 ../rom/pkcs12.iby               CORE_MW_LAYER_IBY_EXPORT_PATH( pkcs12.iby )
-../rom/certmanui.iby            CORE_MW_LAYER_IBY_EXPORT_PATH( certmanui.iby )
-../rom/certmanui_resources.iby  LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( certmanui_resources.iby )
-../rom/CTSecurityDialogs.iby    CORE_MW_LAYER_IBY_EXPORT_PATH( CTSecurityDialogs.iby )
-../rom/CTSecurityDialogs_resources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( CTSecurityDialogs_resources.iby )
+../rom/certmanui_resources.iby  LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( certmanui_resources.iby )    // needed by CTSecurityDialogs
 ../rom/CertSaver.iby            CORE_MW_LAYER_IBY_EXPORT_PATH( CertSaver.iby )
 ../rom/CertSaver_resources.iby  LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( CertSaver_resources.iby )
-../rom/SecModUI.iby             CORE_MW_LAYER_IBY_EXPORT_PATH( SecModUI.iby )
-../rom/SecModUI_resources.iby   LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( SecModUI_resources.iby )
 ../rom/DevToken.iby             CORE_MW_LAYER_IBY_EXPORT_PATH( DevToken.iby )
 ../rom/StubSIS.iby              CORE_MW_LAYER_IBY_EXPORT_PATH( StubSIS.iby )
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/pkiutilities.pro	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,20 @@
+#
+# 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:  pkiutilities project file
+#
+
+TEMPLATE = subdirs
+
+SUBDIRS += untrustedcertificatedialog/untrustedcertificateplugin.pro
+
--- a/pkiutilities/rom/CTSecurityDialogs.iby	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/rom/CTSecurityDialogs.iby	Tue Aug 31 16:04:40 2010 +0300
@@ -27,7 +27,7 @@
 
 file=ABI_DIR\BUILD_DIR\CTSecDialogImpl.dll 	SHARED_LIB_DIR\CTSecDialogImpl.dll
 
-ECOM_PLUGIN(CTSECDLGNOTIFIER.dll, 10008D4F.rsc)
+//ECOM_PLUGIN(CTSECDLGNOTIFIER.dll, 10008D4F.rsc)
 
 #endif // __CTSECURITYDIALOGS_IBY
 
--- a/pkiutilities/rom/StubSIS.iby	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/rom/StubSIS.iby	Tue Aug 31 16:04:40 2010 +0300
@@ -25,6 +25,4 @@
 
 data=ZSYSTEM\install\CenRepStub.sis    System\Install\CenRepStub.sis
 
-//data = EPOCROOT##epoc32\release\winscw\urel\z\system\data\swipolicy.ini  System\data\swipolicy.ini
-
 #endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/securitydialognotifier/data/20031DB3.rss	Tue Aug 31 16:04:40 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:  Security dialog notifier plug-in resource file.
+*
+*/
+
+
+#include <ecom/registryinfov2.rh>
+#include <uikon.hrh>
+
+RESOURCE REGISTRY_INFO r_registry
+	{
+	resource_format_version = RESOURCE_FORMAT_VERSION_2;
+	dll_uid = 0x20031DB3;
+	interfaces =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid = KUikonUidPluginInterfaceNotifiers;
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = 0x101F883C;
+					version_no = 1;
+					display_name = "SecurityDialogs Plugin";
+					default_data = "SecurityDialogs";    
+					opaque_data = "0";
+					rom_only = 1;
+					}
+				};
+			}
+		};
+	} 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/securitydialognotifier/group/bld.inf	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Security dialog notifier
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/securitydialognotifier.iby   CORE_MW_LAYER_IBY_EXPORT_PATH( securitydialognotifier.iby )
+
+PRJ_MMPFILES
+securitydialognotifier.mmp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/securitydialognotifier/group/securitydialognotifier.mmp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Security dialog notifier
+*
+*/
+
+#include <platform_paths.hrh>
+
+TARGET          securitydialognotifier.dll
+CAPABILITY      CAP_ECOM_PLUGIN
+TARGETTYPE      PLUGIN 
+UID             0x10009D8D 0x20031DB3
+VENDORID        VID_DEFAULT
+
+SOURCEPATH      ../data
+START RESOURCE  20031DB3.rss
+TARGET          securitydialognotifier.rsc
+END
+
+MW_LAYER_SYSTEMINCLUDE /epoc32/include/mw/hb/hbcore /epoc32/include/mw/hb/hbwidgets
+USERINCLUDE     ../inc
+
+SOURCEPATH      ../src
+SOURCE          securitydialogmain.cpp
+SOURCE          securitydialognotifier.cpp
+SOURCE          securitydialognotifiersrv.cpp
+SOURCE          securitydialogs.cpp
+
+LIBRARY         euser.lib
+LIBRARY         eiksrv.lib
+LIBRARY         ctframework.lib
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/securitydialognotifier/inc/securitydialognotifier.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Security dialog notifier
+*
+*/
+
+#ifndef SECURITYDIALOGNOTIFIER_H
+#define SECURITYDIALOGNOTIFIER_H
+
+#include <eiknotapi.h>                  // MEikSrvNotifierManager
+
+class CSecurityDialogs;
+
+
+/**
+ * Security Dialog Notifier
+ * CSecurityDialogNotifier is a RNotifier that implements security dialogs
+ * defined in secdlgimpldefs.h (see TSecurityDialogOperation operations).
+ */
+NONSHARABLE_CLASS( CSecurityDialogNotifier ) : public CBase, public MEikSrvNotifierBase2
+    {
+    public:     // constructors and destructor
+        static CSecurityDialogNotifier* NewL();
+        ~CSecurityDialogNotifier();
+
+    private:    // from MEikSrvNotifierBase2
+        void Release();
+        TNotifierInfo RegisterL();
+        TNotifierInfo Info() const;
+        void StartL( const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage );
+        TPtrC8 StartL( const TDesC8& aBuffer );
+        void Cancel();
+        TPtrC8 UpdateL( const TDesC8& aBuffer );
+
+    private:    // new functions
+        CSecurityDialogNotifier();
+        void ConstructL();
+        void DoStartL( const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage );
+
+    private:    // data
+        CSecurityDialogs* iSecurityDialogs;
+        TBool iIsSecurityDialogsDeleted;
+    };
+
+#endif // SECURITYDIALOGNOTIFIER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/securitydialognotifier/inc/securitydialognotifiersrv.h	Tue Aug 31 16:04:40 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:  Security dialog notifier server, client-side API.
+*
+*/
+
+#ifndef SECURITYDIALOGNOTIFIERSRV_H
+#define SECURITYDIALOGNOTIFIERSRV_H
+
+#include <e32std.h>             // RSessionBase
+#include <secdlgimpldefs.h>     // TSecurityDialogOperation
+
+
+/**
+ * Security Dialog Notifier Server API
+ * Security dialogs provide TSecurityDialogOperation functionality defined in secdlgimpldefs.h.
+ * Implementation consist of two components: a notifier DLL (CSecurityDialogNotifier, ECom DLL)
+ * and a server executable (CSecurityDialogNotifierSrv). CSecurityDialogNotifier runs in UIKON
+ * server that has limited capabilities. It passes the requests to the server component
+ * (CSecurityDialogNotifierSrv) that provides the actual functionality.
+ */
+NONSHARABLE_CLASS( RSecurityDialogNotifierSrv ) : public RSessionBase
+    {
+    public:     // constructors and destructor
+        RSecurityDialogNotifierSrv();
+        ~RSecurityDialogNotifierSrv();
+
+    public:     // new functions
+        TInt Connect();
+        TVersion Version() const;
+        void SecurityDialogOperation( TSecurityDialogOperation aOperation,
+                const TDesC8& aInputBuffer, TDes8& aOutputBuffer,
+                TRequestStatus& aStatus );
+        void CancelOperation();
+
+    private:    // new functions
+        TInt StartServer();
+
+    private:    // data
+        TIpcArgs iArgs;
+    };
+
+#endif // SECURITYDIALOGNOTIFIERSRV_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/securitydialognotifier/inc/securitydialogs.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  CSecurityDialogs active object
+*
+*/
+
+#ifndef SECURITYDIALOGS_H
+#define SECURITYDIALOGS_H
+
+#include <e32base.h>                    // CActive
+#include <secdlgimpldefs.h>             // TSecurityDialogOperation
+#include "securitydialognotifiersrv.h"  // RSecurityDialogNotifierSrv
+
+
+/**
+ * Security Dialogs
+ * CSecurityDialogs class provides implementation for the security dialog
+ * operations (TSecurityDialogOperation) defined in secdlgimpldefs.h.
+ * When RNotifier class is used to open security dialogs, CSecurityDialogNotifier
+ * class calls CSecurityDialogs to show the requested dialogs. CSecurityDialogs
+ * uses RSecurityDialogNotifierSrv server to do the actual work.
+ */
+NONSHARABLE_CLASS( CSecurityDialogs ) : public CActive
+    {
+    public:     // constructors and destructor
+        static CSecurityDialogs* NewL( TBool& aIsDeleted );
+        ~CSecurityDialogs();
+
+    public:     // new functions
+        /**
+        * Starts handling the requested operation.
+        * @param aBuffer - Data passed from client RNotifier::StartNotifierAndGetResponse() call
+        * @param aReplySlot - Identifies which message argument to use for the reply
+        * @param aMessage - Encapsulates the client request
+        */
+        void StartLD( const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage );
+
+    protected:  // from CActive
+        void RunL();
+        void DoCancel();
+        TInt RunError( TInt aError );
+
+    private:    // new functions
+        CSecurityDialogs( TBool& aIsDeleted );
+
+    private:    // data
+        TBool& iIsDeleted;
+
+        TInt iRetry;
+        TInt iReplySlot;
+        RMessagePtr2 iMessagePtr;
+        TSecurityDialogOperation iOperation;
+
+        RSecurityDialogNotifierSrv iServer;
+        HBufC8* iInputBuffer;
+        TAny* iOutputBuffer;
+        TPtr8 iOutputPtr;
+    };
+
+#endif  // SECURITYDIALOGS_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/securitydialognotifier/inc/securitydialogstrace.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  TRACE macros for security dialogs
+*
+*/
+
+#ifndef SECURITYDIALOGSTRACE_H
+#define SECURITYDIALOGSTRACE_H
+
+#include <e32debug.h>                   // RDebug
+
+
+// TODO: replace with OST tracing
+#ifdef _DEBUG
+#define TRACE( a, ARGS... ) DebugPrint( _L( a ), ##ARGS )
+#else
+#define TRACE( a, ARGS... )
+#endif
+
+
+// ---------------------------------------------------------------------------
+// DebugPrint()
+// ---------------------------------------------------------------------------
+//
+#ifdef _DEBUG
+const TInt KMaxPrintSize = 256;
+inline void DebugPrint( TRefByValue<const TDesC> aFmt, ... )
+    {
+    VA_LIST list;
+    VA_START( list, aFmt );
+    TBuf<KMaxPrintSize> buf;
+    buf.AppendFormatList( aFmt, list );
+    RDebug::Print( buf );
+    }
+#endif
+
+
+#endif  // SECURITYDIALOGSTRACE_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/securitydialognotifier/rom/securitydialognotifier.iby	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Security dialog notifier
+*
+*/
+
+#ifndef SECURITYDIALOGNOTIFIER_IBY
+#define SECURITYDIALOGNOTIFIER_IBY
+#include <bldvariant.hrh>
+
+ECOM_PLUGIN( securitydialognotifier.dll, securitydialognotifier.rsc )
+
+#endif // SECURITYDIALOGNOTIFIER_IBY
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/securitydialognotifier/src/securitydialogmain.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,80 @@
+/*
+* 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:  Security Dialog notifier entry point
+*
+*/
+
+#include "securitydialognotifier.h"         // CSecurityDialogNotifier
+#include <ecom/implementationproxy.h>       // TImplementationProxy definition
+
+const TInt KNumberOfImplementations = 1;
+
+
+// ----------------------------------------------------------------------------
+// CreateNotifiersL()
+// ----------------------------------------------------------------------------
+//
+void CreateNotifiersL( CArrayPtr<MEikSrvNotifierBase2>& aNotifierArray )
+    {
+    CSecurityDialogNotifier* notifier = CSecurityDialogNotifier::NewL();
+    CleanupStack::PushL( notifier );
+    aNotifierArray.AppendL( notifier );
+    CleanupStack::Pop( notifier );
+    }
+
+// ----------------------------------------------------------------------------
+// NotifierArray()
+// ----------------------------------------------------------------------------
+//
+CArrayPtr<MEikSrvNotifierBase2>* NotifierArray()
+    {
+    CArrayPtr<MEikSrvNotifierBase2>* notifierArray =
+        new CArrayPtrFlat<MEikSrvNotifierBase2>( KNumberOfImplementations );
+    if( notifierArray )
+        {
+        TRAPD( err, CreateNotifiersL( *notifierArray ) );
+        if( err )
+            {
+            TInt count = notifierArray->Count();
+            while( count-- )
+                {
+                (*notifierArray)[ count ]->Release();
+                }
+            delete notifierArray;
+            notifierArray = NULL;
+            }
+        }
+    return notifierArray;
+    }
+
+// ----------------------------------------------------------------------------
+// Provides a key value pair table, that ECOM uses to identify
+// the correct construction function for the requested interface.
+// ----------------------------------------------------------------------------
+//
+const TImplementationProxy ImplementationTable[] =
+    {
+    // UID is the implementation uid defined in .rss file
+    IMPLEMENTATION_PROXY_ENTRY( 0x101F883C, NotifierArray )
+    };
+
+// ----------------------------------------------------------------------------
+// Main entry function used to return an instance of the proxy table.
+// ----------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
+    {
+    aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy );
+    return ImplementationTable;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/securitydialognotifier/src/securitydialognotifier.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,169 @@
+/*
+* 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:  Security dialog notifier
+*
+*/
+
+#include "securitydialognotifier.h"     // CSecurityDialogNotifier
+#include "securitydialogs.h"            // CSecurityDialogs
+#include "securitydialogstrace.h"       // TRACE macro
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogNotifier::~CSecurityDialogNotifier()
+// ---------------------------------------------------------------------------
+//
+CSecurityDialogNotifier::~CSecurityDialogNotifier()
+    {
+    TRACE( "CSecurityDialogNotifier::~CSecurityDialogNotifier" );
+    Cancel();
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogNotifier::NewL()
+// ---------------------------------------------------------------------------
+//
+CSecurityDialogNotifier* CSecurityDialogNotifier::NewL()
+    {
+    CSecurityDialogNotifier* self = new( ELeave ) CSecurityDialogNotifier;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogNotifier::Release()
+// ---------------------------------------------------------------------------
+//
+void CSecurityDialogNotifier::Release()
+    {
+    TRACE( "CSecurityDialogNotifier::Release" );
+    delete this;
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogNotifier::RegisterL()
+// ---------------------------------------------------------------------------
+//
+CSecurityDialogNotifier::TNotifierInfo CSecurityDialogNotifier::RegisterL()
+    {
+    return Info();
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogNotifier::Info()
+// ---------------------------------------------------------------------------
+//
+CSecurityDialogNotifier::TNotifierInfo CSecurityDialogNotifier::Info() const
+    {
+    TNotifierInfo info;
+    info.iUid = KUidSecurityDialogNotifier;
+    info.iChannel = KUidSecurityDialogNotifier;
+    info.iPriority = ENotifierPriorityAbsolute;
+    return info;
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogNotifier::StartL()
+// ---------------------------------------------------------------------------
+//
+void CSecurityDialogNotifier::StartL( const TDesC8& aBuffer, TInt aReplySlot,
+        const RMessagePtr2& aMessage )
+    {
+    TRACE( "CSecurityDialogNotifier::StartL, begin" );
+
+    TRAPD( err, DoStartL( aBuffer, aReplySlot, aMessage ) );
+    TRACE( "CSecurityDialogNotifier::StartL, DoStartL err=%d", err );
+    if( err )
+        {
+        if( iSecurityDialogs && !iIsSecurityDialogsDeleted )
+            {
+            TRACE( "CSecurityDialogNotifier::StartL, deleting iSecurityDialogs" );
+            delete iSecurityDialogs;
+            iSecurityDialogs = NULL;
+            }
+        if( !aMessage.IsNull() )
+            {
+            TRACE( "CSecurityDialogNotifier::StartL, completing message" );
+            aMessage.Complete( err );
+            }
+        }
+
+    TRACE( "CSecurityDialogNotifier::StartL, end" );
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogNotifier::StartL()
+// ---------------------------------------------------------------------------
+//
+TPtrC8 CSecurityDialogNotifier::StartL( const TDesC8& /*aBuffer*/ )
+    {
+    return KNullDesC8();
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogNotifier::Cancel()
+// ---------------------------------------------------------------------------
+//
+void CSecurityDialogNotifier::Cancel()
+    {
+    TRACE( "CSecurityDialogNotifier::Cancel" );
+    if( iSecurityDialogs && !iIsSecurityDialogsDeleted )
+        {
+        TRACE( "CSecurityDialogNotifier::Cancel, deleting iSecurityDialogs" );
+        delete iSecurityDialogs;
+        iSecurityDialogs = NULL;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogNotifier::UpdateL()
+// ---------------------------------------------------------------------------
+//
+TPtrC8 CSecurityDialogNotifier::UpdateL( const TDesC8& /*aBuffer*/ )
+    {
+    return KNullDesC8();
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogNotifier::CSecurityDialogNotifier()
+// ---------------------------------------------------------------------------
+//
+CSecurityDialogNotifier::CSecurityDialogNotifier()
+    {
+    TRACE( "CSecurityDialogNotifier::CSecurityDialogNotifier" );
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogNotifier::ConstructL()
+// ---------------------------------------------------------------------------
+//
+void CSecurityDialogNotifier::ConstructL()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogNotifier::DoStartL()
+// ---------------------------------------------------------------------------
+//
+void CSecurityDialogNotifier::DoStartL( const TDesC8& aBuffer, TInt aReplySlot,
+        const RMessagePtr2& aMessage )
+    {
+    iSecurityDialogs = CSecurityDialogs::NewL( iIsSecurityDialogsDeleted );
+    iSecurityDialogs->StartLD( aBuffer, aReplySlot, aMessage );
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/securitydialognotifier/src/securitydialognotifiersrv.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,148 @@
+/*
+* 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:  Security dialog notifier server, client-side API.
+*
+*/
+
+#include "securitydialognotifiersrv.h"      // RSecurityDialogNotifierSrv
+#include "../../securitydialognotifiersrv/inc/securitydialognotifierservername.h"
+#include "securitydialogstrace.h"           // TRACE macro
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// RSecurityDialogNotifierSrv::RSecurityDialogNotifierSrv()
+// ---------------------------------------------------------------------------
+//
+RSecurityDialogNotifierSrv::RSecurityDialogNotifierSrv()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// RSecurityDialogNotifierSrv::~RSecurityDialogNotifierSrv()
+// ---------------------------------------------------------------------------
+//
+RSecurityDialogNotifierSrv::~RSecurityDialogNotifierSrv()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// RSecurityDialogNotifierSrv::Connect()
+// ---------------------------------------------------------------------------
+//
+TInt RSecurityDialogNotifierSrv::Connect()
+    {
+    TRACE( "RSecurityDialogNotifierSrv::Connect" );
+    const TInt KMaxCreateSessionAttepmts = 2;
+    TInt retry = KMaxCreateSessionAttepmts;
+    FOREVER
+        {
+        TInt err = CreateSession( KSecurityDialogNotifierServerName, Version() );
+        TRACE( "RSecurityDialogNotifierSrv::Connect, create session err=%d", err );
+        if( err != KErrNotFound && err != KErrServerTerminated )
+            {
+            return err;
+            }
+
+        if( --retry == 0 )
+            {
+            return err;
+            }
+
+        err = StartServer();
+        if( err != KErrNone && err != KErrAlreadyExists )
+            {
+            return err;
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// RSecurityDialogNotifierSrv::Version()
+// ---------------------------------------------------------------------------
+//
+TVersion RSecurityDialogNotifierSrv::Version() const
+    {
+    return TVersion( KSecurityDialogNotifierServerMajorVersionNumber,
+            KSecurityDialogNotifierServerMinorVersionNumber,
+            KSecurityDialogNotifierServerBuildVersionNumber );
+    }
+
+// ---------------------------------------------------------------------------
+// RSecurityDialogNotifierSrv::SecurityDialogOperationL()
+// ---------------------------------------------------------------------------
+//
+void RSecurityDialogNotifierSrv::SecurityDialogOperation(
+        TSecurityDialogOperation aOperation,
+        const TDesC8& aInputBuffer, TDes8& aOutputBuffer,
+        TRequestStatus& aStatus )
+    {
+    TRACE( "RSecurityDialogNotifierSrv::SecurityDialogOperation" );
+    iArgs = TIpcArgs( &aInputBuffer, &aOutputBuffer );
+    SendReceive( aOperation, iArgs, aStatus );
+    }
+
+// ---------------------------------------------------------------------------
+// RSecurityDialogNotifierSrv::CancelOperation()
+// ---------------------------------------------------------------------------
+//
+void RSecurityDialogNotifierSrv::CancelOperation()
+    {
+    TRACE( "RSecurityDialogNotifierSrv::CancelOperation" );
+    SendReceive( KSecurityDialogCancelOperation );
+    }
+
+// ---------------------------------------------------------------------------
+// RSecurityDialogNotifierSrv::StartServer()
+// ---------------------------------------------------------------------------
+//
+TInt RSecurityDialogNotifierSrv::StartServer()
+{
+    TRACE( "RSecurityDialogNotifierSrv::StartServer, begin" );
+    RProcess server;
+    TInt err = server.Create( KSecurityDialogNotifierServerName, KNullDesC );
+    if( err )
+        {
+        TRACE( "RSecurityDialogNotifierSrv::StartServer, create failed, err=%d", err );
+        return err;
+        }
+
+    TRequestStatus status;
+    server.Rendezvous( status );
+    if( status == KRequestPending )
+        {
+        server.Resume();
+        }
+    else
+        {
+        server.Kill( KErrNone );
+        }
+
+    TRACE( "RSecurityDialogNotifierSrv::StartServer, waiting rendezvous" );
+    User::WaitForRequest( status );
+    if( server.ExitType() == EExitPanic )
+        {
+        err = KErrGeneral;
+        }
+    else
+        {
+        err = status.Int();
+        }
+    server.Close();
+
+    TRACE( "RSecurityDialogNotifierSrv::StartServer, end err=%d", err );
+    return err;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/securitydialognotifier/src/securitydialogs.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,187 @@
+/*
+* 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:  CSecurityDialogs active object
+*
+*/
+
+#include "securitydialogs.h"            // CSecurityDialogs
+#include "securitydialogstrace.h"       // TRACE macro
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogs::NewL()
+// ---------------------------------------------------------------------------
+//
+CSecurityDialogs* CSecurityDialogs::NewL(  TBool& aIsDeleted )
+    {
+    return new( ELeave ) CSecurityDialogs( aIsDeleted );
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogs::~CSecurityDialogs()
+// ---------------------------------------------------------------------------
+//
+CSecurityDialogs::~CSecurityDialogs()
+    {
+    TRACE( "CSecurityDialogs::~CSecurityDialogs, begin" );
+    Cancel();
+    iServer.Close();
+    delete iInputBuffer;
+    iInputBuffer = NULL;
+    delete iOutputBuffer;
+    iOutputBuffer = NULL;
+    iIsDeleted = ETrue;
+    TRACE( "CSecurityDialogs::~CSecurityDialogs, end" );
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogs::StartLD()
+// ---------------------------------------------------------------------------
+//
+void CSecurityDialogs::StartLD( const TDesC8& aBuffer, TInt aReplySlot,
+        const RMessagePtr2& aMessage )
+    {
+    TRACE( "CSecurityDialogs::StartLD, begin" );
+    User::LeaveIfError( iServer.Connect() );
+
+    const TInt* ptr = reinterpret_cast< const TInt* >( aBuffer.Ptr() );
+    iOperation = static_cast< TSecurityDialogOperation >( *ptr & KSecurityDialogOperationMask );
+    iReplySlot = aReplySlot;
+
+    TRACE( "CSecurityDialogs::StartLD, message 0x%08x", iMessagePtr.Handle() );
+    iMessagePtr = aMessage;
+
+    TRACE( "CSecurityDialogs::StartLD, iOperation=%d", iOperation );
+    __ASSERT_DEBUG( iOutputBuffer == NULL, User::Invariant() );
+    TInt outputBufLen = 0;
+    switch( iOperation )
+        {
+        case ESecureConnection:
+        case ESignText:
+            iOutputBuffer = new( ELeave ) TCTTokenObjectHandleBuf;
+            outputBufLen = sizeof( TCTTokenObjectHandleBuf );
+            break;
+        case EEnterPIN:
+        case EEnablePIN:
+        case EDisablePIN:
+            iOutputBuffer = new( ELeave ) TPINValueBuf;
+            outputBufLen = sizeof( TPINValueBuf );
+            break;
+        case EChangePIN:
+        case EUnblockPIN:
+            iOutputBuffer = new( ELeave ) TTwoPINOutputBuf;
+            outputBufLen = sizeof( TTwoPINOutputBuf );
+            break;
+        case EPINBlocked:
+        case ETotalBlocked:
+            break;
+        case EUnblockPINInClear:
+            iOutputBuffer = new( ELeave ) TUnblockPINInClearOutputBuf;
+            outputBufLen = sizeof( TUnblockPINInClearOutputBuf );
+            break;
+        case EServerAuthenticationFailure:
+            iOutputBuffer = new( ELeave ) TServerAuthenticationFailureOutputBuf;
+            outputBufLen = sizeof( TServerAuthenticationFailureOutputBuf );
+            break;
+        default:
+            User::Leave( KErrNotSupported );
+            break;
+        }
+
+    __ASSERT_DEBUG( iInputBuffer == NULL, User::Invariant() );
+    iInputBuffer = aBuffer.AllocL();
+
+    if( iOutputBuffer )
+        {
+        iOutputPtr.Set( static_cast< TUint8* >( iOutputBuffer ), outputBufLen, outputBufLen );
+        iServer.SecurityDialogOperation( iOperation, *iInputBuffer, iOutputPtr, iStatus );
+        }
+    else
+        {
+        User::Leave( KErrNotSupported );
+        }
+    SetActive();
+    TRACE( "CSecurityDialogs::StartLD, end" );
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogs::RunL()
+// ---------------------------------------------------------------------------
+//
+void CSecurityDialogs::RunL()
+    {
+    TRACE( "CSecurityDialogs::RunL, iStatus.Int()=%d", iStatus.Int() );
+    TInt error = iStatus.Int();
+    User::LeaveIfError( error );
+    __ASSERT_DEBUG( iOutputPtr.Ptr(), User::Invariant() );
+    iMessagePtr.WriteL( iReplySlot, iOutputPtr );
+
+    TRACE( "CSecurityDialogs::RunL, completing message 0x%08x", iMessagePtr.Handle() );
+    iMessagePtr.Complete( error );
+
+    TRACE( "CSecurityDialogs::RunL, deleting this" );
+    delete this;
+    TRACE( "CSecurityDialogs::RunL, end" );
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogs::DoCancel()
+// ---------------------------------------------------------------------------
+//
+void CSecurityDialogs::DoCancel()
+    {
+    TRACE( "CSecurityDialogs::DoCancel, begin" );
+    iServer.CancelOperation();
+    if( !iMessagePtr.IsNull() )
+        {
+        TRACE( "CSecurityDialogs::DoCancel, completing message 0x%08x", iMessagePtr.Handle() );
+        iMessagePtr.Complete( KErrCancel );
+        }
+    TRACE( "CSecurityDialogs::DoCancel(), end" );
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogs::RunError()
+// ---------------------------------------------------------------------------
+//
+TInt CSecurityDialogs::RunError( TInt aError )
+    {
+    TRACE( "CSecurityDialogs::RunError, aError=%d", aError );
+    if( !iMessagePtr.IsNull() )
+        {
+        TRACE( "CSecurityDialogs::RunError, completing message 0x%08x", iMessagePtr.Handle() );
+        iMessagePtr.Complete( aError );
+        }
+
+    TRACE( "CSecurityDialogs::RunError, deleting this" );
+    delete this;
+
+    TRACE( "CSecurityDialogs::RunError, end" );
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogs::CSecurityDialogs()
+// ---------------------------------------------------------------------------
+//
+CSecurityDialogs::CSecurityDialogs( TBool& aIsDeleted ) : CActive( CActive::EPriorityLow ),
+        iIsDeleted( aIsDeleted ), iOutputPtr( NULL, 0, 0 )
+    {
+    TRACE( "CSecurityDialogs::CSecurityDialogs" );
+    CActiveScheduler::Add( this );
+    iIsDeleted = EFalse;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/securitydialognotifier/tsrc/srvauthfaildlglauncher/srvauthfaildlglauncher.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,218 @@
+/*
+* 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:  Test application for untrusted certificate dialog.
+*
+*/
+
+#include "srvauthfaildlglauncher.h"
+#include <HbMainWindow>
+#include <HbView>
+#include <HbLabel>
+#include <HbComboBox>
+#include <HbTextEdit>
+#include <HbCheckBox>
+#include <HbPushButton>
+#include <HbDeviceDialog>
+#include <HbMessageBox>
+#include <QDir>
+#include <QBuffer>
+#include <QGraphicsLinearLayout>
+
+
+#ifdef Q_OS_SYMBIAN
+#include <securitydefs.h>       // TValidationError
+#include <secdlgimpldefs.h>     // TServerAuthenticationFailureInput, KUidSecurityDialogNotifier
+
+HBufC8* GetInputBufferL( const QString& server, const QByteArray& certificate, int reason )
+    {
+    const TPtrC16 serverNameUnicode(reinterpret_cast<const TText*>(server.constData()),
+        server.length());
+    const TPtrC8 encodedCert(reinterpret_cast<const TText8*>(certificate.constData()),
+        certificate.length());
+
+    const TInt KServerNameMaxLength = 512;
+    TBuf8<KServerNameMaxLength> serverName;
+    serverName.Copy(serverNameUnicode);
+
+    TServerAuthenticationFailureInput serverAuthenticationInput;
+    serverAuthenticationInput.iOperation = EServerAuthenticationFailure;
+    serverAuthenticationInput.iFailureReason = static_cast<TValidationError>(reason);
+    serverAuthenticationInput.iServerNameLength = serverName.Length();
+    serverAuthenticationInput.iEncodedCertLength = encodedCert.Length();
+
+    TServerAuthenticationFailureInputBuf inputBuf( serverAuthenticationInput );
+
+    TInt bufferSize = sizeof( inputBuf ) + serverName.Length() + encodedCert.Length();
+    HBufC8* packedBuffer = HBufC8::NewL( bufferSize );
+    TPtr8 packedBufferPtr( packedBuffer->Des() );
+
+    packedBufferPtr.Append( inputBuf );
+    packedBufferPtr.Append( serverName );
+    packedBufferPtr.Append( encodedCert );
+
+    return packedBuffer;
+    }
+
+bool ShowDialogL( const QString& server, const QByteArray& certificate, int reason, bool cancel )
+    {
+    RNotifier notifier;
+    User::LeaveIfError( notifier.Connect() );
+    CleanupClosePushL( notifier );
+
+    HBufC8* buffer = GetInputBufferL( server, certificate, reason );
+    CleanupStack::PushL( buffer );
+
+    TRequestStatus status;
+    TPckgBuf<TServerAuthenticationFailureDialogResult> resultPckg;
+    notifier.StartNotifierAndGetResponse( status, KUidSecurityDialogNotifier,
+        *buffer, resultPckg );
+    if( cancel )
+        {
+        const TInt KTenSecDelay = 10000000;
+        User::After( KTenSecDelay );
+        notifier.CancelNotifier( KUidSecurityDialogNotifier );
+        }
+    User::WaitForRequest( status );
+    User::LeaveIfError( status.Int() );
+
+    CleanupStack::PopAndDestroy( buffer );
+    CleanupStack::PopAndDestroy( &notifier );
+    return( resultPckg() == EContinue );
+    }
+
+#endif  // Q_OS_SYMBIAN
+
+
+const QString KTestCertDir = "c:/data/testCerts";
+
+SrvAuthFailDlgLauncher::SrvAuthFailDlgLauncher(int& argc, char* argv[])
+    : HbApplication(argc, argv), mMainWindow(0), mMainView(0)
+{
+    mMainWindow = new HbMainWindow();
+    mMainView = new HbView();
+    mMainView->setTitle(tr("SrvAuthFailDlgLauncher"));
+
+    QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical);
+
+    layout->addItem(new HbLabel(tr("Server host name:")));
+    mHostName = new HbTextEdit(tr("some.host.com"));
+    layout->addItem(mHostName);
+    layout->addStretch();
+
+    layout->addItem(new HbLabel(tr("Certificate file:")));
+    mFilesList = new HbComboBox;
+    mFilesList->setEditable(false);
+    QDir dir(KTestCertDir);
+    if (dir.exists()) {
+        QFileInfoList list = dir.entryInfoList(QDir::Files);
+        QListIterator<QFileInfo> iter(list);
+        while (iter.hasNext()) {
+            const QFileInfo &info(iter.next());
+            mFilesList->addItem(info.fileName());
+        }
+    }
+    layout->addItem(mFilesList);
+    layout->addStretch();
+
+    layout->addItem(new HbLabel(tr("Validation result:")));
+    mValidationResult = new HbComboBox;
+    QStringList validationResults;
+    validationResults
+	    << "EValidatedOK"
+	    << "EChainHasNoRoot"
+	    << "ESignatureInvalid"
+	    << "EDateOutOfRange"
+	    << "ENameIsExcluded"
+	    << "ENameNotPermitted"
+	    << "ENotCACert"
+	    << "ECertificateRevoked"
+	    << "EUnrecognizedCriticalExtension"
+	    << "ENoBasicConstraintInCACert"
+	    << "ENoAcceptablePolicy"
+	    << "EPathTooLong"
+	    << "ENegativePathLengthSpecified"
+	    << "ENamesDontChain"
+	    << "ERequiredPolicyNotFound"
+	    << "EBadKeyUsage"
+	    << "ERootCertNotSelfSigned"
+	    << "ECriticalExtendedKeyUsage"
+	    << "ECriticalCertPoliciesWithQualifiers"
+	    << "ECriticalPolicyMapping"
+	    << "ECriticalDeviceId"
+	    << "ECriticalSid"
+	    << "ECriticalVid"
+	    << "ECriticalCapabilities";
+    mValidationResult->addItems(validationResults);
+    mValidationResult->setCurrentIndex(1);      // EChainHasNoRoot
+    layout->addItem(mValidationResult);
+    layout->addStretch();
+
+    mCancelShortly = new HbCheckBox("Cancel after 10 seconds");
+    layout->addItem(mCancelShortly);
+
+    HbPushButton *button = 0;
+    button = new HbPushButton("Launch dialog");
+    connect(button, SIGNAL(clicked()), this, SLOT(activateDialog()));
+    layout->addItem(button);
+
+    button = new HbPushButton("Exit");
+    connect(button, SIGNAL(clicked()), qApp, SLOT(quit()));
+    layout->addItem(button);
+
+    mMainView->setLayout(layout);
+    mMainWindow->addView(mMainView);
+    mMainWindow->show();
+}
+
+SrvAuthFailDlgLauncher::~SrvAuthFailDlgLauncher()
+{
+    delete mMainView;
+    delete mMainWindow;
+}
+
+void SrvAuthFailDlgLauncher::activateDialog()
+{
+    QString server = mHostName->toPlainText();
+
+    QString fileName = mFilesList->currentText();
+    QFile file;
+    QDir::setCurrent(KTestCertDir);
+    file.setFileName(fileName);
+    file.open(QIODevice::ReadOnly);
+    QByteArray fileContent = file.readAll();
+    file.close();
+
+    int reason = mValidationResult->currentIndex();
+    bool cancel = mCancelShortly->isChecked();
+
+    int error = 0;
+    bool accepted = false;
+#ifdef Q_OS_SYMBIAN
+    TRAP( error, accepted = ShowDialogL(server, fileContent, reason, cancel) );
+#endif // Q_OS_SYMBIAN
+    if (!error) {
+        if (accepted) {
+            HbMessageBox::information(QString("Accepted"));
+        } else {
+            HbMessageBox::information(QString("Declined"));
+        }
+    } else {
+        if (error == KErrCancel) {
+            HbMessageBox::information(QString("Cancelled"));
+        } else {
+            HbMessageBox::information(QString("Failed, error %1").arg(error));
+        }
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/securitydialognotifier/tsrc/srvauthfaildlglauncher/srvauthfaildlglauncher.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,51 @@
+/*
+* 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:  Test application for untrusted certificate dialog.
+*
+*/
+
+#ifndef SRVAUTHFAILDLGLAUNCHER_H
+#define SRVAUTHFAILDLGLAUNCHER_H
+
+#include <hbapplication.h>
+
+class HbMainWindow;
+class HbView;
+class HbComboBox;
+class HbTextEdit;
+class HbCheckBox;
+
+
+class SrvAuthFailDlgLauncher : public HbApplication
+{
+    Q_OBJECT
+
+public:     // constructor and destructor
+    SrvAuthFailDlgLauncher(int& argc, char* argv[]);
+    ~SrvAuthFailDlgLauncher();
+
+private slots:  // new functions
+    void activateDialog();
+
+private:    // data
+    HbMainWindow *mMainWindow;
+    HbView       *mMainView;
+    HbComboBox   *mFilesList;
+    HbTextEdit   *mHostName;
+    HbComboBox   *mValidationResult;
+    HbCheckBox   *mCancelShortly;
+};
+
+#endif  // SRVAUTHFAILDLGLAUNCHER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/securitydialognotifier/tsrc/srvauthfaildlglauncher/srvauthfaildlglauncher.iby	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Test application for untrusted certificate dialog.
+*
+*/
+
+
+#ifndef __SRVAUTHFAILDLGLAUNCHER_IBY__
+#define __SRVAUTHFAILDLGLAUNCHER_IBY__
+
+file=ABI_DIR/BUILD_DIR/srvauthfaildlglauncher.exe SHARED_LIB_DIR/srvauthfaildlglauncher.exe
+HB_UPGRADABLE_APP_REG_RSC( srvauthfaildlglauncher )
+S60_APP_RESOURCE( srvauthfaildlglauncher )
+
+#endif  // __SRVAUTHFAILDLGLAUNCHER_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/securitydialognotifier/tsrc/srvauthfaildlglauncher/srvauthfaildlglauncher.pkg	Tue Aug 31 16:04:40 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:  Test application for untrusted certificate dialog.
+;
+
+; Language
+&EN
+
+; SIS header: name, uid, version
+#{"srvauthfaildlglauncher"},(0xE9bbd80d),1,0,0
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+; Manual PKG pre-rules from PRO files
+; Default dependency to Qt libraries
+(0x2001E61C), 4, 6, 3, {"Qt"}
+
+; Default HW/platform dependencies
+[0x101F7961],0,0,0,{"S60ProductID"}
+[0x102032BE],0,0,0,{"S60ProductID"}
+[0x102752AE],0,0,0,{"S60ProductID"}
+[0x1028315F],0,0,0,{"S60ProductID"}
+
+; Executable and default resource files
+"/epoc32/release/armv5/urel/srvauthfaildlglauncher.exe" - "!:\sys\bin\srvauthfaildlglauncher.exe"
+"/epoc32/data/z/resource/apps/srvauthfaildlglauncher.rsc" - "!:\resource\apps\srvauthfaildlglauncher.rsc"
+"/epoc32/data/z/private/10003a3f/import/apps/srvauthfaildlglauncher_reg.rsc" - "!:\private\10003a3f\import\apps\srvauthfaildlglauncher_reg.rsc"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/securitydialognotifier/tsrc/srvauthfaildlglauncher/srvauthfaildlglauncher.pro	Tue Aug 31 16:04:40 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:  Test application for untrusted certificate dialog.
+#
+
+TEMPLATE = app
+TARGET = srvauthfaildlglauncher
+CONFIG += hb
+DEPENDPATH += .
+INCLUDEPATH += .
+
+HEADERS += srvauthfaildlglauncher.h
+SOURCES += srvauthfaildlglaunchermain.cpp srvauthfaildlglauncher.cpp
+
+symbian {
+    TARGET.CAPABILITY = CAP_APPLICATION
+}
+
+BLD_INF_RULES.prj_exports += \
+    "$${LITERAL_HASH}include <platform_paths.hrh>" \
+    "srvauthfaildlglauncher.iby CORE_APP_LAYER_IBY_EXPORT_PATH(srvauthfaildlglauncher.iby)" \
+    "testCerts/RootCert.cer /epoc32/winscw/c/data/testCerts/RootCert.cer" \
+    "testCerts/IntermediateCert.cer /epoc32/winscw/c/data/testCerts/IntermediateCert.cer" \
+    "testCerts/ServerCert1.cer /epoc32/winscw/c/data/testCerts/ServerCert1.cer" \
+    "testCerts/ServerCert2_noCN.cer /epoc32/winscw/c/data/testCerts/ServerCert2_noCN.cer" \
+    "testCerts/ServerCert3_exp.cer /epoc32/winscw/c/data/testCerts/ServerCert3_exp.cer" \
+    "testCerts/ServerCert4_exp2.cer /epoc32/winscw/c/data/testCerts/ServerCert4_exp2.cer" \
+    "testCerts/ServerCert5_alg.cer /epoc32/winscw/c/data/testCerts/ServerCert5_alg.cer" \
+    "testCerts/ServerCert6_key.cer /epoc32/winscw/c/data/testCerts/ServerCert6_key.cer" \
+    "testCerts/SevverCert7_ocsp.cer /epoc32/winscw/c/data/testCerts/ServerCert7_ocsp.cer" \
+    "testCerts/ServerCert8_aia.cer /epoc32/winscw/c/data/testCerts/ServerCert8_aia.cer" \
+    "testCerts/ServerCert9_san.cer /epoc32/winscw/c/data/testCerts/ServerCert9_san.cer"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/securitydialognotifier/tsrc/srvauthfaildlglauncher/srvauthfaildlglaunchermain.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Test application for untrusted certificate dialog.
+*
+*/
+
+#include "srvauthfaildlglauncher.h"
+
+int main(int argc, char *argv[])
+{
+    SrvAuthFailDlgLauncher app(argc, argv);
+    return app.exec();
+}
+
Binary file pkiutilities/securitydialognotifier/tsrc/srvauthfaildlglauncher/testCerts/IntermediateCert.cer has changed
Binary file pkiutilities/securitydialognotifier/tsrc/srvauthfaildlglauncher/testCerts/RootCert.cer has changed
Binary file pkiutilities/securitydialognotifier/tsrc/srvauthfaildlglauncher/testCerts/ServerCert1.cer has changed
Binary file pkiutilities/securitydialognotifier/tsrc/srvauthfaildlglauncher/testCerts/ServerCert2_noCN.cer has changed
Binary file pkiutilities/securitydialognotifier/tsrc/srvauthfaildlglauncher/testCerts/ServerCert3_exp.cer has changed
Binary file pkiutilities/securitydialognotifier/tsrc/srvauthfaildlglauncher/testCerts/ServerCert4_exp2.cer has changed
Binary file pkiutilities/securitydialognotifier/tsrc/srvauthfaildlglauncher/testCerts/ServerCert5_alg.cer has changed
Binary file pkiutilities/securitydialognotifier/tsrc/srvauthfaildlglauncher/testCerts/ServerCert6_key.cer has changed
Binary file pkiutilities/securitydialognotifier/tsrc/srvauthfaildlglauncher/testCerts/ServerCert8_aia.cer has changed
Binary file pkiutilities/securitydialognotifier/tsrc/srvauthfaildlglauncher/testCerts/ServerCert9_san.cer has changed
Binary file pkiutilities/securitydialognotifier/tsrc/srvauthfaildlglauncher/testCerts/SevverCert7_ocsp.cer has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/securitydialognotifiersrv/group/bld.inf	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Security dialog notifier server
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/securitydialognotifiersrv.iby   CORE_MW_LAYER_IBY_EXPORT_PATH( securitydialognotifiersrv.iby )
+
+PRJ_MMPFILES
+securitydialognotifiersrv.mmp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/securitydialognotifiersrv/group/securitydialognotifiersrv.mmp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Security dialog notifier server
+*
+*/
+
+#include <platform_paths.hrh>
+
+TARGET          securitydialognotifiersrv.exe
+CAPABILITY      CAP_SERVER
+TARGETTYPE      EXE
+UID             0x0 0x20031DCE
+VENDORID        VID_DEFAULT
+
+MW_LAYER_SYSTEMINCLUDE /epoc32/include/mw/hb/hbcore /epoc32/include/mw/hb/hbwidgets
+USERINCLUDE     ../inc
+
+SOURCEPATH      ../src
+SOURCE          securitydialognotifierservermain.cpp
+SOURCE          securitydialognotifierserver.cpp
+SOURCE          securitydialognotifiersession.cpp
+SOURCE          securitydialogoperation.cpp
+SOURCE          securitydialogoperserverauthfail.cpp
+SOURCE          untrustedcertquery.cpp
+
+LIBRARY         euser.lib           // Base classes
+LIBRARY         efsrv.lib           // RFs
+LIBRARY         ctframework.lib     // CServerAuthenticationFailureInput
+LIBRARY         x509.lib            // CX509Certificate
+LIBRARY         x500.lib            // CX500DistinguishedName
+LIBRARY         crypto.lib          // CSignedObject
+LIBRARY         certstore.lib       // CUnifiedCertStore
+LIBRARY         DevTokenClient.lib  // CTrustSitesStore 
+LIBRARY         HbCore.lib          // CHbDeviceDialog
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/securitydialognotifiersrv/inc/securitydialognotifierserver.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,51 @@
+/*
+* 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:  Security dialog notifier server
+*
+*/
+
+#ifndef SECURITYDIALOGNOTIFIERSERVER_H
+#define SECURITYDIALOGNOTIFIERSERVER_H
+
+#include <e32base.h>                    // CPolicyServer
+
+
+/**
+ * CSecurityDialogNotifierServer is the work-horse for TSecurityDialogOperation
+ * operations  defined for security dialogs in secdlgimpldefs.h. It's client
+ * is CSecurityDialogs class in securitydialognotifier component.
+ */
+NONSHARABLE_CLASS( CSecurityDialogNotifierServer ) : public CPolicyServer
+    {
+    public:     // constructor and destructor
+        static CSecurityDialogNotifierServer* NewLC();
+        ~CSecurityDialogNotifierServer();
+
+    public:     // new functions
+        void AddSession();
+        void RemoveSession();
+
+    private:    // from CServer2 (via CPolicyServer)
+        CSession2* NewSessionL(const TVersion &aVersion, const RMessage2& aMessage) const;
+
+    private:    // new functions
+        CSecurityDialogNotifierServer();
+        void ConstructL();
+
+    private:    // data
+        TInt iSessionCount;
+    };
+
+#endif  // SECURITYDIALOGNOTIFIERSERVER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/securitydialognotifiersrv/inc/securitydialognotifierservername.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,30 @@
+/*
+* 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:  Security dialog notifier server name
+*
+*/
+
+#ifndef SECURITYDIALOGNOTIFIERSERVERNAME_H
+#define SECURITYDIALOGNOTIFIERSERVERNAME_H
+
+_LIT( KSecurityDialogNotifierServerName, "securitydialognotifiersrv" );
+const TInt KSecurityDialogNotifierServerMajorVersionNumber = 1;
+const TInt KSecurityDialogNotifierServerMinorVersionNumber = 0;
+const TInt KSecurityDialogNotifierServerBuildVersionNumber = 0;
+
+// See TSecurityDialogOperation in secdlgimpldefs.h for other function codes.
+const TInt KSecurityDialogCancelOperation = 0;
+
+#endif // SECURITYDIALOGNOTIFIERSERVERNAME_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/securitydialognotifiersrv/inc/securitydialognotifiersession.h	Tue Aug 31 16:04:40 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:  Security dialog notifier server session
+*
+*/
+
+#ifndef SECURITYDIALOGNOTIFIERSESSION_H
+#define SECURITYDIALOGNOTIFIERSESSION_H
+
+#include <e32base.h>                            // CSession2
+#include "securitydialogoperationobserver.h"    // MSecurityDialogOperationObserver
+
+class CSecurityDialogNotifierServer;
+class CSecurityDialogOperation;
+
+
+/**
+ * CSecurityDialogNotifierSession is the session object in security
+ * dialog notifier server (CSecurityDialogNotifierServer).
+ */
+NONSHARABLE_CLASS( CSecurityDialogNotifierSession ) : public CSession2,
+        public MSecurityDialogOperationObserver
+    {
+    public:     // constructor and destructor
+        static CSecurityDialogNotifierSession* NewL();
+        ~CSecurityDialogNotifierSession();
+
+    public:     // from CSession2
+        void CreateL();
+        void ServiceL( const RMessage2& aMessage );
+
+    public:     // from MSecurityDialogOperationObserver
+        void OperationComplete();
+
+    private:    // new functions
+        CSecurityDialogNotifierSession();
+        void ConstructL();
+        CSecurityDialogNotifierServer& Server();
+        void DispatchMessageL( const RMessage2& aMessage );
+        TBool IsOperationCancelled( const RMessage2& aMessage );
+        void ServerAuthenticationFailureL( const RMessage2& aMessage );
+        void GetInputBufferL( const RMessage2& aMessage );
+
+    private:    // data
+        HBufC8* iInputBuffer;
+        CSecurityDialogOperation* iOperationHandler;
+    };
+
+#endif  // SECURITYDIALOGNOTIFIERSESSION_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/securitydialognotifiersrv/inc/securitydialogoperation.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,56 @@
+/*
+* 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:  Base class for CSecurityDialog operations
+*
+*/
+
+#ifndef SECURITYDIALOGOPERATION_H
+#define SECURITYDIALOGOPERATION_H
+
+#include <e32base.h>                    // CActive
+
+class MSecurityDialogOperationObserver;
+
+
+/**
+ * CSecurityDialogOperation is a base class for different kinds of operations
+ * defined for security dialogs in /epoc32/include/platform/secdlgimpldefs.h.
+ * TSecurityDialogOperation lists the possible operations. A derived class
+ * implements each operation separately. This base class works as common API
+ * between different operation classes and the main CSecurityDialog class.
+ */
+NONSHARABLE_CLASS( CSecurityDialogOperation ) : public CActive
+    {
+    protected:  // constructor
+        CSecurityDialogOperation( MSecurityDialogOperationObserver& aObserver,
+                const RMessage2& aMessage, TInt aReplySlot );
+
+    public:     // destructor
+        ~CSecurityDialogOperation();
+
+    public:     // new function
+        virtual void StartL( const TDesC8& aBuffer ) = 0;
+        virtual void CancelOperation() = 0;
+
+    protected:  // from CActive
+        TInt RunError( TInt aError );
+
+    protected:  // data
+        MSecurityDialogOperationObserver& iObserver;
+        RMessage2 iMessage;
+        const TInt iReplySlot;
+    };
+
+#endif  // SECURITYDIALOGOPERATION_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/securitydialognotifiersrv/inc/securitydialogoperationobserver.h	Tue Aug 31 16:04:40 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:  Observer definition for CSecurityDialog operations
+*
+*/
+
+#ifndef SECURITYDIALOGOPERATIONOBSERVER_H
+#define SECURITYDIALOGOPERATIONOBSERVER_H
+
+
+/**
+ * CSecurityDialogOperations inform observer when they are complete.
+ * Completed operations can be deleted safely. Deleting an incomplete
+ * operation cancels the ongoing request.
+ */
+class MSecurityDialogOperationObserver
+    {
+    public:
+        virtual void OperationComplete() = 0;
+    };
+
+#endif  // SECURITYDIALOGOPERATIONOBSERVER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/securitydialognotifiersrv/inc/securitydialogoperserverauthfail.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,99 @@
+/*
+* 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:  Server authentication failure operation in security dialog
+*
+*/
+
+#ifndef SECURITYDIALOGOPERSERVERAUTHFAIL_H
+#define SECURITYDIALOGOPERSERVERAUTHFAIL_H
+
+#include "securitydialogoperation.h"    // CSecurityDialogOperation
+#include <securitydefs.h>               // TValidationError
+#include <ct/rmpointerarray.h>          // RMPointerArray
+#include <f32file.h>                    // RFs
+#include <secdlgimpldefs.h>             // TServerAuthenticationFailureDialogResult
+
+class MSecurityDialogOperationObserver;
+class CServerAuthenticationFailureInput;
+class CUnifiedCertStore;
+class MCTWritableCertStore;
+class CCertAttributeFilter;
+class CCTCertInfo;
+class CUntrustedCertQuery;
+
+
+/**
+ * CServerAuthFailOperation is a CSecurityDialogOperation that handles
+ * the EServerAuthenticationFailure operation.
+ */
+NONSHARABLE_CLASS( CServerAuthFailOperation ) : public CSecurityDialogOperation
+    {
+    public:     // constructors and destructor
+        static CServerAuthFailOperation* NewL( MSecurityDialogOperationObserver& aObserver,
+                const RMessage2& aMessage, TInt aReplySlot );
+        ~CServerAuthFailOperation();
+
+    public:     // from CSecurityDialogOperation
+        void StartL( const TDesC8& aBuffer );
+        void CancelOperation();
+
+    protected:  // from CActive (via CSecurityDialogOperation)
+        void RunL();
+        void DoCancel();
+
+    private:    // new functions
+        CServerAuthFailOperation( MSecurityDialogOperationObserver& aObserver,
+                const RMessage2& aMessage, TInt aReplySlot );
+        void InitializeUnifiedCertStoreL();
+        void ProcessServerAuthorizationFailureL();
+        void OpenTrustedSiteCertificateStoreL();
+        TBool IsAlreadyTrustedSiteL();
+        void StartFetchingTrustedSiteCertsL();
+        void ShowUntrustedCertificateDialogL();
+        void SaveServerCertToTrustedSiteCertStoreL();
+        void SaveServerNameToTrustedSitesStoreL();
+        void ReturnResultL( TServerAuthenticationFailureDialogResult aResult );
+        void RetrieveFirstTrustedSiteCertL();
+        void RetrieveNextTrustedSiteCertL();
+        TBool IsRetrievedCertSameAsServerCertL();
+
+    private:    // data
+        CServerAuthenticationFailureInput* iInput;
+
+        TValidationError iAuthFailReason;
+        TPtrC8 iEncodedServerCert;
+        HBufC8* iServerCertFingerprint;
+        HBufC* iServerName;
+        HBufC* iCertLabel;
+
+        CUntrustedCertQuery* iUntrustedCertQuery;
+
+        RFs iFs;
+        CUnifiedCertStore* iCertStore;
+        MCTWritableCertStore* iTrustedSiteCertStore;
+        CCertAttributeFilter* iCertAttributeFilter;
+        RMPointerArray<CCTCertInfo> iCertInfos;
+        TInt iRetrieveCertIndex;
+        HBufC8* iRetrievedCertBuffer;
+
+        enum {
+            EInitialiseCertStore,
+            EListTrustedSiteCerts,
+            ERetrieveTrustedSiteCert,
+            ESavingServerCert
+        } iMode;
+    };
+
+#endif  // SECURITYDIALOGOPERSERVERAUTHFAIL_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/securitydialognotifiersrv/inc/securitydialogstrace.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  TRACE macros for security dialogs
+*
+*/
+
+#ifndef SECURITYDIALOGSTRACE_H
+#define SECURITYDIALOGSTRACE_H
+
+#include <e32debug.h>                   // RDebug
+
+
+// TODO: replace with OST tracing
+#ifdef _DEBUG
+#define TRACE( a, ARGS... ) DebugPrint( _L( a ), ##ARGS )
+#else
+#define TRACE( a, ARGS... )
+#endif
+
+
+// ---------------------------------------------------------------------------
+// DebugPrint()
+// ---------------------------------------------------------------------------
+//
+#ifdef _DEBUG
+const TInt KMaxPrintSize = 256;
+inline void DebugPrint( TRefByValue<const TDesC> aFmt, ... )
+    {
+    VA_LIST list;
+    VA_START( list, aFmt );
+    TBuf<KMaxPrintSize> buf;
+    buf.AppendFormatList( aFmt, list );
+    RDebug::Print( buf );
+    }
+#endif
+
+
+#endif  // SECURITYDIALOGSTRACE_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/securitydialognotifiersrv/inc/untrustedcertquery.h	Tue Aug 31 16:04:40 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:  Displays untrusted certificate dialog
+*
+*/
+
+#ifndef C_UNTRUSTEDCERTQUERY_H
+#define C_UNTRUSTEDCERTQUERY_H
+
+#include <e32base.h>                            // CActive
+#include <hb/hbcore/hbdevicedialogsymbian.h>    // MHbDeviceDialogObserver
+#include <securitydefs.h>                       // TValidationError
+
+class CHbDeviceDialogSymbian;
+class CHbSymbianVariantMap;
+
+
+/**
+* Displays untrusted certificate query.
+* Untrusted certificate query dialog is displayed for secure connection
+* (SSL/TLS) server authentication failure errors. CCTUntrustedCertQuery
+* class uses UntrustedCertificateDialog device dialog to show the query.
+*/
+NONSHARABLE_CLASS( CUntrustedCertQuery ) : public CActive, public MHbDeviceDialogObserver
+    {
+    public:     // constructors and destructor
+        static CUntrustedCertQuery* NewL( TValidationError aValidationError,
+                const TDesC8& aCertificate, const TDesC& aServerName,
+                TBool aCanHandlePermanentAccept );
+        ~CUntrustedCertQuery();
+
+    public:     // new functions
+        enum TResponse {
+            EQueryRejected,
+            EQueryAccepted,
+            EQueryAcceptedPermanently
+        };
+        void ShowQueryAndWaitForResponseL( TResponse& aResponse );
+
+    protected:  // from CActive
+        void DoCancel();
+        void RunL();
+
+    private:    // from MHbDeviceDialogObserver
+        void DataReceived( CHbSymbianVariantMap& aData );
+        void DeviceDialogClosed( TInt aCompletionCode );
+
+    private:    // new functions
+        CUntrustedCertQuery( TValidationError aValidationError,
+                const TDesC8& aCertificate, const TDesC& aServerName,
+                TBool aCanHandlePermanentAccept );
+        void ConstructL();
+
+    private:    // data
+        TValidationError iValidationError;
+        const TDesC8& iCertificate;
+        const TDesC& iServerName;
+        TBool iCanHandlePermanentAccept;
+        CActiveSchedulerWait *iWait;
+        TInt iWaitCompletionCode;
+        CHbDeviceDialogSymbian* iDeviceDialog;
+        CHbSymbianVariantMap* iVariantMap;
+        TResponse iResponse;
+    };
+
+#endif  // C_UNTRUSTEDCERTQUERY_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/securitydialognotifiersrv/rom/securitydialognotifiersrv.iby	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Security dialog notifier server
+*
+*/
+
+#ifndef SECURITYDIALOGNOTIFIERSRV_IBY
+#define SECURITYDIALOGNOTIFIERSRV_IBY
+#include <bldvariant.hrh>
+
+file=ABI_DIR\BUILD_DIR\securitydialognotifiersrv.exe    sys\bin\securitydialognotifiersrv.exe
+
+#endif // SECURITYDIALOGNOTIFIERSRV_IBY
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/securitydialognotifiersrv/src/securitydialognotifierserver.cpp	Tue Aug 31 16:04:40 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:  Security dialog notifier server
+*
+*/
+
+#include "securitydialognotifierserver.h"   // CSecurityDialogNotifierServer
+#include "securitydialognotifiersession.h"  // CSecurityDialogNotifierSession
+#include "securitydialognotifierservername.h" // KSecurityDialogNotifierServerName
+#include "securitydialogstrace.h"           // TRACE macro
+
+
+const TUint KRangeCount = 1;
+
+const TInt KRanges[ KRangeCount ] =
+    {
+    0
+    };
+
+const TUint8 KElementsIndex[ KRangeCount ] =
+    {
+    0
+    };
+
+const TInt KUikonServerId = 0x10003a4a;
+const CPolicyServer::TPolicyElement KPolicyElements[] =
+    {
+    { _INIT_SECURITY_POLICY_S0( KUikonServerId ), CPolicyServer::EFailClient }
+    };
+
+const CPolicyServer::TPolicy KSecurityDialogNotifierServerPolicy =
+    {
+    CPolicyServer::EAlwaysPass,
+    KRangeCount,
+    KRanges,
+    KElementsIndex,
+    KPolicyElements
+    };
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogNotifierServer::NewLC()
+// ---------------------------------------------------------------------------
+//
+CSecurityDialogNotifierServer* CSecurityDialogNotifierServer::NewLC()
+    {
+    CSecurityDialogNotifierServer* self = new( ELeave ) CSecurityDialogNotifierServer;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogNotifierServer::~CSecurityDialogNotifierServer()
+// ---------------------------------------------------------------------------
+//
+CSecurityDialogNotifierServer::~CSecurityDialogNotifierServer()
+    {
+    TRACE( "CSecurityDialogNotifierServer::~CSecurityDialogNotifierServer" );
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogNotifierServer::AddSession()
+// ---------------------------------------------------------------------------
+//
+void CSecurityDialogNotifierServer::AddSession()
+    {
+    TRACE( "CSecurityDialogNotifierServer::AddSession" );
+    ++iSessionCount;
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogNotifierServer::RemoveSession()
+// ---------------------------------------------------------------------------
+//
+void CSecurityDialogNotifierServer::RemoveSession()
+    {
+    TRACE( "CSecurityDialogNotifierServer::RemoveSession" );
+    --iSessionCount;
+    if( iSessionCount == 0 )
+        {
+        TRACE( "CSecurityDialogNotifierServer::RemoveSession, shutting down" );
+        CActiveScheduler::Stop();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogNotifierServer::NewSessionL()
+// ---------------------------------------------------------------------------
+//
+CSession2* CSecurityDialogNotifierServer::NewSessionL( const TVersion &aVersion,
+        const RMessage2& /*aMessage*/ ) const
+    {
+    TRACE( "CSecurityDialogNotifierServer::NewSessionL" );
+    TVersion version( KSecurityDialogNotifierServerMajorVersionNumber,
+            KSecurityDialogNotifierServerMinorVersionNumber,
+            KSecurityDialogNotifierServerBuildVersionNumber );
+    if( !User::QueryVersionSupported( version, aVersion ) )
+        {
+        TRACE( "CSecurityDialogNotifierServer::NewSessionL, version not supported" );
+        User::Leave( KErrNotSupported );
+        }
+
+    return CSecurityDialogNotifierSession::NewL();
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogNotifierServer::CSecurityDialogNotifierServer()
+// ---------------------------------------------------------------------------
+//
+CSecurityDialogNotifierServer::CSecurityDialogNotifierServer() :
+        CPolicyServer( CActive::EPriorityStandard, KSecurityDialogNotifierServerPolicy )
+    {
+    TRACE( "CSecurityDialogNotifierServer::CSecurityDialogNotifierServer" );
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogNotifierServer::ConstructL()
+// ---------------------------------------------------------------------------
+//
+void CSecurityDialogNotifierServer::ConstructL()
+    {
+    StartL( KSecurityDialogNotifierServerName );
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/securitydialognotifiersrv/src/securitydialognotifierservermain.cpp	Tue Aug 31 16:04:40 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:  Security dialog notifier server
+*
+*/
+
+#include "securitydialognotifierserver.h"   // CSecurityDialogNotifierServer
+#include "securitydialognotifierservername.h" // KSecurityDialogNotifierServerName
+#include "securitydialogstrace.h"           // TRACE macro
+
+
+// ---------------------------------------------------------------------------
+// MainL()
+// ---------------------------------------------------------------------------
+//
+LOCAL_C void MainL()
+    {
+    TRACE( "SecurityDialogNotifierServer: MainL" );
+    CActiveScheduler* scheduler = new( ELeave ) CActiveScheduler;
+    CleanupStack::PushL( scheduler );
+    CActiveScheduler::Install( scheduler );
+
+    CSecurityDialogNotifierServer* server = CSecurityDialogNotifierServer::NewLC();
+    User::LeaveIfError( User::RenameThread( KSecurityDialogNotifierServerName ) );
+    TRACE( "SecurityDialogNotifierServer: MainL, rendezvous" );
+
+    RProcess::Rendezvous( KErrNone );
+    TRACE( "SecurityDialogNotifierServer: MainL, activescheduler start" );
+    CActiveScheduler::Start();
+
+    TRACE( "SecurityDialogNotifierServer: MainL, cleanup" );
+    CleanupStack::PopAndDestroy( server );
+    CleanupStack::PopAndDestroy( scheduler );
+    }
+
+// ---------------------------------------------------------------------------
+// E32Main()
+// ---------------------------------------------------------------------------
+//
+GLDEF_C TInt E32Main()
+    {
+    CTrapCleanup* cleanup = CTrapCleanup::New();
+
+    TRAPD( err, MainL() );
+    __ASSERT_ALWAYS( !err, User::Panic( KSecurityDialogNotifierServerName, err ) );
+
+    delete cleanup;
+    return err;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/securitydialognotifiersrv/src/securitydialognotifiersession.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,220 @@
+/*
+* 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:  Security dialog notifier server session
+*
+*/
+
+#include "securitydialognotifiersession.h"  // CSecurityDialogNotifierSession
+#include "securitydialognotifierserver.h"   // CSecurityDialogNotifierServer
+#include "securitydialognotifierservername.h" // KSecurityDialogsCancelOperation
+#include "securitydialogoperserverauthfail.h" // CServerAuthFailOperation
+#include "securitydialogstrace.h"           // TRACE macro
+#include <secdlgimpldefs.h>                 // TSecurityDialogOperation
+
+const TInt KInputParam = 0;
+const TInt KOutputParam = 1;
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogNotifierSession::NewL()
+// ---------------------------------------------------------------------------
+//
+CSecurityDialogNotifierSession* CSecurityDialogNotifierSession::NewL()
+    {
+    CSecurityDialogNotifierSession* self = new( ELeave ) CSecurityDialogNotifierSession;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogNotifierSession::~CSecurityDialogNotifierSession()
+// ---------------------------------------------------------------------------
+//
+CSecurityDialogNotifierSession::~CSecurityDialogNotifierSession()
+    {
+    TRACE( "CSecurityDialogNotifierSession::~CSecurityDialogNotifierSession, begin" );
+    Server().RemoveSession();
+    delete iOperationHandler;
+    iOperationHandler = NULL;
+    delete iInputBuffer;
+    iInputBuffer = NULL;
+    TRACE( "CSecurityDialogNotifierSession::~CSecurityDialogNotifierSession, end" );
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogNotifierSession::CreateL()
+// ---------------------------------------------------------------------------
+//
+void CSecurityDialogNotifierSession::CreateL()
+    {
+    TRACE( "CSecurityDialogNotifierSession::~CSecurityDialogNotifierSession" );
+    Server().AddSession();
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogNotifierSession::ServiceL()
+// ---------------------------------------------------------------------------
+//
+void CSecurityDialogNotifierSession::ServiceL( const RMessage2& aMessage )
+    {
+    TRACE( "CSecurityDialogNotifierSession::ServiceL, message 0x%08x", aMessage.Handle() );
+    TRAPD( error, DispatchMessageL( aMessage ) );
+    TRACE( "CSecurityDialogNotifierSession::ServiceL, dispatched, error %d", error );
+    if( error && !aMessage.IsNull() )
+        {
+        TRACE( "CSecurityDialogNotifierSession::ServiceL, completing msg 0x%08x",
+                aMessage.Handle() );
+        aMessage.Complete( error );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogNotifierSession::OperationComplete()
+// ---------------------------------------------------------------------------
+//
+void CSecurityDialogNotifierSession::OperationComplete()
+    {
+    TRACE( "CSecurityDialogNotifierSession::OperationComplete, begin" );
+    delete iOperationHandler;
+    iOperationHandler = NULL;
+    TRACE( "CSecurityDialogNotifierSession::OperationComplete, end" );
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogNotifierSession::CSecurityDialogNotifierSession()
+// ---------------------------------------------------------------------------
+//
+CSecurityDialogNotifierSession::CSecurityDialogNotifierSession()
+    {
+    TRACE( "CSecurityDialogNotifierSession::CSecurityDialogNotifierSession" );
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogNotifierSession::ConstructL()
+// ---------------------------------------------------------------------------
+//
+void CSecurityDialogNotifierSession::ConstructL()
+    {
+    TRACE( "CSecurityDialogNotifierSession::ConstructL" );
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogNotifierSession::Server()
+// ---------------------------------------------------------------------------
+//
+CSecurityDialogNotifierServer& CSecurityDialogNotifierSession::Server()
+    {
+    return *static_cast< CSecurityDialogNotifierServer* >(
+            const_cast< CServer2* >( CSession2::Server() ) );
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogNotifierSession::DispatchMessageL()
+// ---------------------------------------------------------------------------
+//
+void CSecurityDialogNotifierSession::DispatchMessageL( const RMessage2& aMessage )
+    {
+    TRACE( "CSecurityDialogNotifierSession::DispatchMessageL, begin" );
+    if( !IsOperationCancelled( aMessage ) )
+        {
+        TSecurityDialogOperation operation =
+                static_cast< TSecurityDialogOperation >( aMessage.Function() );
+        TRACE( "CSecurityDialogNotifierSession::DispatchMessageL, operation=%d", operation );
+        switch( operation )
+            {
+            case ESecureConnection:
+            case ESignText:
+            case EEnterPIN:
+            case EEnablePIN:
+            case EDisablePIN:
+            case EChangePIN:
+            case EUnblockPIN:
+            case EPINBlocked:
+            case ETotalBlocked:
+            case EUnblockPINInClear:
+                User::Leave( KErrNotSupported );
+                break;
+            case EServerAuthenticationFailure:
+                ServerAuthenticationFailureL( aMessage );
+                break;
+            default:
+                User::Leave( KErrNotSupported );
+                break;
+            }
+        }
+    TRACE( "CSecurityDialogNotifierSession::DispatchMessageL, end" );
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogNotifierSession::IsOperationCancelled()
+// ---------------------------------------------------------------------------
+//
+TBool CSecurityDialogNotifierSession::IsOperationCancelled( const RMessage2& aMessage )
+    {
+    TBool isCancelled = EFalse;
+    if( aMessage.Function() == KSecurityDialogCancelOperation )
+        {
+        if( iOperationHandler )
+            {
+            TRACE( "CSecurityDialogNotifierSession::CheckIfOperationCancelledL, cancelling" );
+            iOperationHandler->CancelOperation();
+            }
+        TRACE( "CSecurityDialogNotifierSession::CheckIfOperationCancelledL, completing msg 0x%08x",
+                aMessage.Handle() );
+        aMessage.Complete( KErrNone );
+        isCancelled = ETrue;
+        }
+    return isCancelled;
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogNotifierSession::ServerAuthenticationFailureL()
+// ---------------------------------------------------------------------------
+//
+void CSecurityDialogNotifierSession::ServerAuthenticationFailureL( const RMessage2& aMessage )
+    {
+    TRACE( "CSecurityDialogNotifierSession::ServerAuthenticationFailureL, begin" );
+    GetInputBufferL( aMessage );
+
+    __ASSERT_DEBUG( iOperationHandler == NULL, User::Invariant() );
+    iOperationHandler = CServerAuthFailOperation::NewL( *this, aMessage, KOutputParam );
+    iOperationHandler->StartL( *iInputBuffer );
+
+    TRACE( "CSecurityDialogNotifierSession::ServerAuthenticationFailureL, end" );
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogNotifierSession::GetInputBufferL()
+// ---------------------------------------------------------------------------
+//
+void CSecurityDialogNotifierSession::GetInputBufferL( const RMessage2& aMessage )
+    {
+    TInt inputLength = aMessage.GetDesLength( KInputParam );
+    TRACE( "CSecurityDialogNotifierSession::GetInputBufferL, inputLength=%d", inputLength );
+    __ASSERT_ALWAYS( inputLength > 0, User::Leave( KErrCorrupt ) );
+    if( iInputBuffer )
+        {
+        delete iInputBuffer;
+        iInputBuffer = NULL;
+        }
+    iInputBuffer = HBufC8::NewL( inputLength );
+    TPtr8 inputBufferPtr( iInputBuffer->Des() );
+    aMessage.ReadL( KInputParam, inputBufferPtr );
+    TRACE( "CSecurityDialogNotifierSession::GetInputBufferL, read complete" );
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/securitydialognotifiersrv/src/securitydialogoperation.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,65 @@
+/*
+* 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:  Base class for CSecurityDialog operations
+*
+*/
+
+#include "securitydialogoperation.h"    // CSecurityDialogOperation
+#include "securitydialogoperationobserver.h" // MSecurityDialogOperationObserver
+#include "securitydialogstrace.h"       // TRACE macro
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogOperation::CSecurityDialogOperation()
+// ---------------------------------------------------------------------------
+//
+CSecurityDialogOperation::CSecurityDialogOperation(
+        MSecurityDialogOperationObserver& aObserver, const RMessage2& aMessage,
+        TInt aReplySlot ) : CActive( CActive::EPriorityStandard ), iObserver( aObserver ),
+        iMessage( aMessage ), iReplySlot( aReplySlot )
+    {
+    TRACE( "CSecurityDialogOperation::CSecurityDialogOperation, iMessage 0x%08x",
+            iMessage.Handle() );
+    CActiveScheduler::Add( this );
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogOperation::~CSecurityDialogOperation()
+// ---------------------------------------------------------------------------
+//
+CSecurityDialogOperation::~CSecurityDialogOperation()
+    {
+    TRACE( "CSecurityDialogOperation::~CSecurityDialogOperation, begin" );
+    Cancel();
+    TRACE( "CSecurityDialogOperation::~CSecurityDialogOperation, end" );
+    }
+
+// ---------------------------------------------------------------------------
+// CSecurityDialogOperation::RunError()
+// ---------------------------------------------------------------------------
+//
+TInt CSecurityDialogOperation::RunError( TInt aError )
+    {
+    TRACE( "CSecurityDialogOperation::RunError, aError=%d", aError );
+    if( !iMessage.IsNull() )
+        {
+        TRACE( "CSecurityDialogOperation::RunError, completing message 0x%08x",
+                iMessage.Handle() );
+        iMessage.Complete( aError );
+        }
+    return KErrNone;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/securitydialognotifiersrv/src/securitydialogoperserverauthfail.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,498 @@
+/*
+* 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:  Server authentication failure operation in security dialog
+*
+*/
+
+#include "securitydialogoperserverauthfail.h" // CServerAuthFailOperation
+#include "securitydialogoperationobserver.h" // MSecurityDialogOperationObserver
+#include "untrustedcertquery.h"         // CUntrustedCertQuery
+#include "../../DeviceToken/Inc/TrustedSitesStore.h" // CTrustSitesStore
+#include <mctwritablecertstore.h>       // MCTWritableCertStore
+#include <unifiedcertstore.h>           // CUnifiedCertStore
+#include <cctcertinfo.h>                // CCTCertInfo
+#include <x509cert.h>                   // CX509Certificate
+#include "securitydialogstrace.h"       // TRACE macro
+
+const TUid KTrustedSiteCertificatesTokenTypeUid = { 0x101FB66F };
+const TInt KMaxCommonNameLength = 64;   // from RFC3280
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CServerAuthFailOperation::NewL()
+// ---------------------------------------------------------------------------
+//
+CServerAuthFailOperation* CServerAuthFailOperation::NewL(
+        MSecurityDialogOperationObserver& aObserver, const RMessage2& aMessage,
+        TInt aReplySlot )
+    {
+    TRACE( "CServerAuthFailOperation::NewL, aMessage 0x%08x", aMessage.Handle() );
+    return new( ELeave ) CServerAuthFailOperation( aObserver, aMessage, aReplySlot );
+    }
+
+// ---------------------------------------------------------------------------
+// CServerAuthFailOperation::~CServerAuthFailOperation()
+// ---------------------------------------------------------------------------
+//
+CServerAuthFailOperation::~CServerAuthFailOperation()
+    {
+    TRACE( "CServerAuthFailOperation::~CServerAuthFailOperation, begin" );
+    Cancel();
+
+    delete iUntrustedCertQuery;
+    iUntrustedCertQuery = NULL;
+
+    delete iInput;
+    iInput = NULL;
+    delete iCertLabel;
+    iCertLabel = NULL;
+    delete iServerName;
+    iServerName = NULL;
+
+    delete iCertStore;
+    iCertStore = NULL;
+    iTrustedSiteCertStore = NULL;   // not owned
+
+    delete iCertAttributeFilter;
+    iCertAttributeFilter = NULL;
+    delete iRetrievedCertBuffer;
+    iRetrievedCertBuffer = NULL;
+
+    iCertInfos.Close();
+    iFs.Close();
+    TRACE( "CServerAuthFailOperation::~CServerAuthFailOperation, end" );
+    }
+
+// ---------------------------------------------------------------------------
+// CServerAuthFailOperation::StartL()
+// ---------------------------------------------------------------------------
+//
+void CServerAuthFailOperation::StartL( const TDesC8& aBuffer )
+    {
+    TRACE( "CServerAuthFailOperation::StartL, begin" );
+    __ASSERT_DEBUG( iInput == NULL, User::Invariant() );
+    iInput = CServerAuthenticationFailureInput::NewL( aBuffer );
+
+    iInput->GetEncodedCert( iEncodedServerCert );
+
+    TPtrC8 serverName;
+    iInput->GetServerName( serverName );
+    __ASSERT_DEBUG( iServerName == NULL, User::Invariant() );
+    iServerName = HBufC::NewL( serverName.Length() );
+    iServerName->Des().Copy( serverName );
+    TRACE( "CServerAuthFailOperation::StartL, iServerName=%S", iServerName );
+
+    iAuthFailReason = iInput->FailureReason();
+    TRACE( "CServerAuthFailOperation::StartL, iAuthFailReason=%d", iAuthFailReason );
+
+    InitializeUnifiedCertStoreL();
+    // This is async function, processing continues in RunL().
+    // Basically trusted site certificates are fetched and the
+    // server certificate is compared to them. If the server
+    // certificate is already in trusted site cert store, then
+    // connection is accepted silently. If it is not, then
+    // untrusted certificate dialog is displayed.
+    }
+
+// ---------------------------------------------------------------------------
+// CServerAuthFailOperation::CancelOperation()
+// ---------------------------------------------------------------------------
+//
+void CServerAuthFailOperation::CancelOperation()
+    {
+    TRACE( "CServerAuthFailOperation::CancelOperation, begin" );
+    Cancel();
+    if( iUntrustedCertQuery )
+        {
+        TRACE( "CServerAuthFailOperation::CancelOperation, cancelling untrusted query" );
+        iUntrustedCertQuery->Cancel();
+        }
+    if( !iMessage.IsNull() )
+        {
+        TRACE( "CServerAuthFailOperation::CancelOperation, completing message 0x%08x",
+                iMessage.Handle() );
+        iMessage.Complete( KErrCancel );
+        }
+    TRACE( "CServerAuthFailOperation::CancelOperation, end" );
+    }
+
+// ---------------------------------------------------------------------------
+// CServerAuthFailOperation::RunL()
+// ---------------------------------------------------------------------------
+//
+void CServerAuthFailOperation::RunL()
+    {
+    TRACE( "CServerAuthFailOperation::RunL, iStatus.Int()=%d, iMode=%d",
+            iStatus.Int(), iMode );
+    User::LeaveIfError( iStatus.Int() );
+    switch( iMode )
+        {
+        case EInitialiseCertStore:
+            ProcessServerAuthorizationFailureL();
+            break;
+        case EListTrustedSiteCerts:
+            RetrieveFirstTrustedSiteCertL();
+            break;
+        case ERetrieveTrustedSiteCert:
+            if( IsRetrievedCertSameAsServerCertL() )
+                {
+                ReturnResultL( EContinue );
+                }
+            else
+                {
+                RetrieveNextTrustedSiteCertL();
+                }
+            break;
+        case ESavingServerCert:
+            SaveServerNameToTrustedSitesStoreL();
+            ReturnResultL( EContinue );
+            break;
+        default:
+            User::Leave( KErrGeneral );
+            break;
+        }
+    TRACE( "CServerAuthFailOperation::RunL(), end" );
+    }
+
+// ---------------------------------------------------------------------------
+// CServerAuthFailOperation::DoCancel()
+// ---------------------------------------------------------------------------
+//
+void CServerAuthFailOperation::DoCancel()
+    {
+    TRACE( "CServerAuthFailOperation::DoCancel, iMode=%d", iMode );
+    switch( iMode )
+        {
+        case EInitialiseCertStore:
+            if( iCertStore )
+                {
+                iCertStore->CancelInitialize();
+                }
+            break;
+        case EListTrustedSiteCerts:
+            if( iTrustedSiteCertStore )
+                {
+                iTrustedSiteCertStore->CancelList();
+                }
+            break;
+        case ERetrieveTrustedSiteCert:
+            if( iTrustedSiteCertStore )
+                {
+                iTrustedSiteCertStore->CancelRetrieve();
+                }
+            break;
+        case ESavingServerCert:
+            if( iTrustedSiteCertStore )
+                {
+                iTrustedSiteCertStore->CancelAdd();
+                }
+            break;
+        default:
+            break;
+        }
+    TRACE( "CServerAuthFailOperation::DoCancel, end" );
+    }
+
+// ---------------------------------------------------------------------------
+// CServerAuthFailOperation::CServerAuthFailOperation()
+// ---------------------------------------------------------------------------
+//
+CServerAuthFailOperation::CServerAuthFailOperation(
+        MSecurityDialogOperationObserver& aObserver, const RMessage2& aMessage,
+        TInt aReplySlot ) : CSecurityDialogOperation( aObserver, aMessage, aReplySlot )
+    {
+    TRACE( "CServerAuthFailOperation::CServerAuthFailOperation" );
+    }
+
+// ---------------------------------------------------------------------------
+// CServerAuthFailOperation::InitializeUnifiedCertStoreL()
+// ---------------------------------------------------------------------------
+//
+void CServerAuthFailOperation::InitializeUnifiedCertStoreL()
+    {
+    TRACE( "CServerAuthFailOperation::InitializeUnifiedCertStoreL" );
+    User::LeaveIfError( iFs.Connect() );
+    iCertStore = CUnifiedCertStore::NewL( iFs, ETrue );
+
+    iCertStore->Initialize( iStatus );
+    iMode = EInitialiseCertStore;
+    SetActive();
+    }
+
+// ---------------------------------------------------------------------------
+// CServerAuthFailOperation::ProcessServerAuthorizationFailureL()
+// ---------------------------------------------------------------------------
+//
+void CServerAuthFailOperation::ProcessServerAuthorizationFailureL()
+    {
+    TRACE( "CServerAuthFailOperation::ProcessServerAuthorizationFailureL" );
+    OpenTrustedSiteCertificateStoreL();
+    if( IsAlreadyTrustedSiteL() )
+        {
+        StartFetchingTrustedSiteCertsL();
+        }
+    else
+        {
+        ShowUntrustedCertificateDialogL();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CServerAuthFailOperation::OpenTrustedSiteCertificateStoreL()
+// ---------------------------------------------------------------------------
+//
+void CServerAuthFailOperation::OpenTrustedSiteCertificateStoreL()
+    {
+    TRACE( "CServerAuthFailOperation::OpenTrustedSiteCertificateStoreL, begin" );
+    TInt count = iCertStore->WritableCertStoreCount();
+    for( TInt index = 0; ( index < count ) && !iTrustedSiteCertStore; index++ )
+        {
+        MCTWritableCertStore* certstore = &( iCertStore->WritableCertStore( index ) );
+        TUid tokenTypeUid = certstore->Token().Handle().iTokenTypeUid;
+        if( tokenTypeUid == KTrustedSiteCertificatesTokenTypeUid )
+            {
+            iTrustedSiteCertStore = certstore;
+            }
+        }
+    TRACE( "CServerAuthFailOperation::OpenTrustedSiteCertificateStoreL, store 0x%08x",
+            iTrustedSiteCertStore );
+    }
+
+// ---------------------------------------------------------------------------
+// CServerAuthFailOperation::IsAlreadyTrustedSiteL()
+// ---------------------------------------------------------------------------
+//
+TBool CServerAuthFailOperation::IsAlreadyTrustedSiteL()
+    {
+    TRACE( "CServerAuthFailOperation::IsAlreadyTrustedSiteL, begin" );
+    TBool isTrustedSite = EFalse;
+    if( iTrustedSiteCertStore )
+        {
+        CTrustSitesStore* trustedSitesStore = CTrustSitesStore::NewL();
+        CleanupStack::PushL( trustedSitesStore );
+
+        isTrustedSite = trustedSitesStore->IsTrustedSiteL( iEncodedServerCert, *iServerName );
+        if( isTrustedSite )
+            {
+            TBool isExpiredAccepted = trustedSitesStore->IsOutOfDateAllowedL(
+                    iEncodedServerCert, *iServerName );
+            TRACE( "CServerAuthFailOperation::IsAlreadyTrustedSiteL, isExpiredAccepted=%d",
+                    isExpiredAccepted );
+            if( !isExpiredAccepted && iAuthFailReason == EDateOutOfRange )
+                {
+                TRACE( "CServerAuthFailOperation::IsAlreadyTrustedSiteL, not accepted" );
+                isTrustedSite = EFalse;
+                }
+            }
+
+        CleanupStack::PopAndDestroy( trustedSitesStore );
+        }
+    TRACE( "CServerAuthFailOperation::IsAlreadyTrustedSiteL, isTrustedSite=%d", isTrustedSite );
+    return isTrustedSite;
+    }
+
+// ---------------------------------------------------------------------------
+// CServerAuthFailOperation::StartFetchingTrustedSiteCertsL()
+// ---------------------------------------------------------------------------
+//
+void CServerAuthFailOperation::StartFetchingTrustedSiteCertsL()
+    {
+    TRACE( "CServerAuthFailOperation::StartFetchingTrustedSiteCertsL" );
+    __ASSERT_DEBUG( iCertAttributeFilter == NULL, User::Invariant() );
+    iCertAttributeFilter = CCertAttributeFilter::NewL();
+    iCertAttributeFilter->SetOwnerType( EPeerCertificate );
+    __ASSERT_DEBUG( iTrustedSiteCertStore != NULL, User::Invariant() );
+    iTrustedSiteCertStore->List( iCertInfos, *iCertAttributeFilter, iStatus );
+    iMode = EListTrustedSiteCerts;
+    SetActive();
+    }
+
+// ---------------------------------------------------------------------------
+// CServerAuthFailOperation::ShowUntrustedCertificateDialogL()
+// ---------------------------------------------------------------------------
+//
+void CServerAuthFailOperation::ShowUntrustedCertificateDialogL()
+    {
+    TRACE( "CServerAuthFailOperation::ShowUntrustedCertificateDialogL, begin" );
+
+    // If trusted site certstore open has failed, then it is not possible to save
+    // the host name for permanent use. Hence, choice for permanent accept is not
+    // displayed if trusted site certstore open has failed. Other restrictions for
+    // permanent accept are defined in device dialog (UntrustedCertificateWidget).
+    TBool isTrustedSiteCertStoreOpened = ( iTrustedSiteCertStore != NULL );
+    __ASSERT_DEBUG( iUntrustedCertQuery == NULL, User::Invariant() );
+    iUntrustedCertQuery = CUntrustedCertQuery::NewL( iAuthFailReason, iEncodedServerCert,
+            *iServerName, isTrustedSiteCertStoreOpened );
+
+    CUntrustedCertQuery::TResponse response = CUntrustedCertQuery::EQueryRejected;
+    iUntrustedCertQuery->ShowQueryAndWaitForResponseL( response );
+    switch( response )
+        {
+        case CUntrustedCertQuery::EQueryAccepted:
+            ReturnResultL( EContinue );
+            break;
+        case CUntrustedCertQuery::EQueryAcceptedPermanently:
+            SaveServerCertToTrustedSiteCertStoreL();
+            break;
+        case CUntrustedCertQuery::EQueryRejected:
+        default:
+            ReturnResultL( EStop );
+            break;
+        }
+
+    TRACE( "CServerAuthFailOperation::ShowUntrustedCertificateDialogL, end" );
+    }
+
+// ---------------------------------------------------------------------------
+// CServerAuthFailOperation::SaveServerCertToTrustedSiteCertStoreL()
+// ---------------------------------------------------------------------------
+//
+void CServerAuthFailOperation::SaveServerCertToTrustedSiteCertStoreL()
+    {
+    TRACE( "CServerAuthFailOperation::SaveServerCertToTrustedSiteCertStoreL" );
+
+    __ASSERT_DEBUG( iCertLabel == NULL, User::Invariant() );
+    CX509Certificate* serverCert = CX509Certificate::NewLC( iEncodedServerCert );
+    const CX500DistinguishedName& dName = serverCert->SubjectName();
+    HBufC* commonName = dName.ExtractFieldL( KX520CommonName );
+    if( commonName )
+        {
+        CleanupStack::PushL( commonName );
+        TInt commonNameLen = commonName->Length();
+        if( commonNameLen > 0 && commonNameLen <= KMaxCommonNameLength )
+            {
+            iCertLabel = commonName->AllocL();
+            }
+        CleanupStack::PopAndDestroy( commonName );
+        }
+    CleanupStack::PopAndDestroy( serverCert );
+
+    if( !iCertLabel )
+        {
+        iCertLabel = iServerName->AllocL();
+        }
+
+    iTrustedSiteCertStore->Add( *iCertLabel, EX509Certificate, EPeerCertificate,
+            NULL, NULL, iEncodedServerCert, iStatus );
+    iMode = ESavingServerCert;
+    SetActive();
+    }
+
+// ---------------------------------------------------------------------------
+// CServerAuthFailOperation::SaveServerNameToTrustedSitesStoreL()
+// ---------------------------------------------------------------------------
+//
+void CServerAuthFailOperation::SaveServerNameToTrustedSitesStoreL()
+    {
+    TRACE( "CServerAuthFailOperation::SaveServerNameToTrustedSitesStoreL, begin" );
+    CTrustSitesStore* trustedSitesStore = CTrustSitesStore::NewL();
+    CleanupStack::PushL( trustedSitesStore );
+
+    // CTrustSitesStore::AddL() may leave or it may return an error code.
+    // It leaves if parameters are incorrect, and it returns error code if
+    // saving fails. Both kinds of errors are handled here in the same way.
+    TInt err = trustedSitesStore->AddL( iEncodedServerCert, *iServerName );
+    TRACE( "CServerAuthFailOperation::SaveServerNameToTrustedSitesStoreL, err=%d", err );
+    User::LeaveIfError( err );
+
+    CleanupStack::PopAndDestroy( trustedSitesStore );
+    }
+
+// ---------------------------------------------------------------------------
+// CServerAuthFailOperation::ReturnResultL()
+// ---------------------------------------------------------------------------
+//
+void CServerAuthFailOperation::ReturnResultL( TServerAuthenticationFailureDialogResult aResult )
+    {
+    TRACE( "CServerAuthFailOperation::ReturnResultL, aResult=%d", aResult );
+    TServerAuthenticationFailureOutputBuf output( aResult );
+    iMessage.WriteL( iReplySlot, output );
+    TRACE( "CServerAuthFailOperation::ReturnResultL, completing msg 0x%08x", iMessage.Handle() );
+    iMessage.Complete( KErrNone );
+    TRACE( "CServerAuthFailOperation::ReturnResultL, informing observer" );
+    iObserver.OperationComplete();
+    TRACE( "CServerAuthFailOperation::ReturnResultL, end" );
+    }
+
+// ---------------------------------------------------------------------------
+// CServerAuthFailOperation::RetrieveFirstTrustedSiteCertL()
+// ---------------------------------------------------------------------------
+//
+void CServerAuthFailOperation::RetrieveFirstTrustedSiteCertL()
+    {
+    TRACE( "CServerAuthFailOperation::RetrieveFirstTrustedSiteCertL" );
+    __ASSERT_DEBUG( iRetrievedCertBuffer == NULL, User::Invariant() );
+    iRetrieveCertIndex = 0;
+
+    RetrieveNextTrustedSiteCertL();
+    }
+
+// ---------------------------------------------------------------------------
+// CServerAuthFailOperation::RetrieveNextTrustedSiteCertL()
+// ---------------------------------------------------------------------------
+//
+void CServerAuthFailOperation::RetrieveNextTrustedSiteCertL()
+    {
+    TRACE( "CServerAuthFailOperation::RetrieveNextTrustedSiteCertL" );
+    if( iRetrieveCertIndex < iCertInfos.Count() )
+        {
+        CCTCertInfo& cert = *( iCertInfos[ iRetrieveCertIndex ] );
+
+        if( iRetrievedCertBuffer )
+            {
+            delete iRetrievedCertBuffer;
+            iRetrievedCertBuffer = NULL;
+            }
+        iRetrievedCertBuffer = HBufC8::NewL( cert.Size() );
+        TPtr8 buffer = iRetrievedCertBuffer->Des();
+
+        iTrustedSiteCertStore->Retrieve( cert, buffer, iStatus );
+        iMode = ERetrieveTrustedSiteCert;
+        SetActive();
+        }
+    else
+        {
+        ShowUntrustedCertificateDialogL();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CServerAuthFailOperation::IsRetrievedCertSameAsServerCertL()
+// ---------------------------------------------------------------------------
+//
+TBool CServerAuthFailOperation::IsRetrievedCertSameAsServerCertL()
+    {
+    TRACE( "CServerAuthFailOperation::IsRetrievedCertSameAsServerCertL, begin" );
+    TBool isSame = EFalse;
+    CX509Certificate* cert = CX509Certificate::NewLC( *iRetrievedCertBuffer );
+
+    if( !iServerCertFingerprint )
+        {
+        CX509Certificate* serverCert = CX509Certificate::NewLC( iEncodedServerCert );
+        iServerCertFingerprint = serverCert->Fingerprint().AllocL();
+        CleanupStack::PopAndDestroy( serverCert );
+        }
+
+    if( cert->Fingerprint() == *iServerCertFingerprint )
+        {
+        isSame = ETrue;
+        }
+
+    CleanupStack::PopAndDestroy( cert );
+    TRACE( "CServerAuthFailOperation::IsRetrievedCertSameAsServerCertL, isSame=%d", isSame );
+    return isSame;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/securitydialognotifiersrv/src/untrustedcertquery.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,250 @@
+/*
+* 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:  Displays untrusted certificate dialog
+*
+*/
+
+#include "untrustedcertquery.h"             // CUntrustedCertQuery
+#include <hb/hbcore/hbsymbianvariant.h>     // CHbSymbianVariantMap
+#include "securitydialogstrace.h"           // TRACE macro
+
+// Note that the dialog type string, the parameters name strings, and the return code
+// name string and values must match to those defined in Qt-side untrusted certificate
+// dialog (in untrustedcertificatedefinitions.h file).
+
+// Device dialog type for untrusted certificate dialog
+_LIT( KUntrustedCertificateDialog, "com.nokia.untrustedcert/1.0" );
+
+// Variant map parameter names for untrusted certificate dialog
+_LIT( KUntrustedCertEncodedCertificate, "cert" );   // bytearray, mandatory
+_LIT( KUntrustedCertServerName, "host" );           // string, mandatory
+_LIT( KUntrustedCertValidationError, "err" );       // int (TValidationError), mandatory
+_LIT( KUntrustedCertTrustedSiteStoreFail, "tss" );  // any, prevents permanent acceptance
+
+// Dialog return code name and values
+_LIT( KUntrustedCertDialogResult, "result" );       // int
+const TInt KUntrustedCertDialogRejected = 0;
+const TInt KUntrustedCertDialogAccepted = 1;
+const TInt KUntrustedCertDialogAcceptedPermanently = 2;
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CUntrustedCertQuery::NewL()
+// ---------------------------------------------------------------------------
+//
+CUntrustedCertQuery* CUntrustedCertQuery::NewL(
+        TValidationError aValidationError, const TDesC8& aCertificate,
+        const TDesC& aServerName, TBool aCanHandlePermanentAccept )
+    {
+    TRACE( "CUntrustedCertQuery::NewL" );
+    CUntrustedCertQuery* self = new ( ELeave ) CUntrustedCertQuery(
+            aValidationError, aCertificate, aServerName,
+            aCanHandlePermanentAccept );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CUntrustedCertQuery::~CUntrustedCertQuery()
+// ---------------------------------------------------------------------------
+//
+CUntrustedCertQuery::~CUntrustedCertQuery()
+    {
+    TRACE( "CUntrustedCertQuery::~CUntrustedCertQuery, begin" );
+    Cancel();
+    delete iWait;
+    iWait = NULL;
+    delete iDeviceDialog;
+    iDeviceDialog = NULL;
+    delete iVariantMap;
+    iVariantMap = NULL;
+    TRACE( "CUntrustedCertQuery::~CUntrustedCertQuery, end" );
+    }
+
+// ---------------------------------------------------------------------------
+// CUntrustedCertQuery::ShowQueryAndWaitForResponseL()
+// ---------------------------------------------------------------------------
+//
+void CUntrustedCertQuery::ShowQueryAndWaitForResponseL( TResponse& aResponse )
+    {
+    TRACE( "CUntrustedCertQuery::ShowQueryAndWaitForResponseL, begin" );
+    if( !iDeviceDialog )
+        {
+        iDeviceDialog = CHbDeviceDialogSymbian::NewL();
+        }
+    if( !iVariantMap )
+        {
+        iVariantMap = CHbSymbianVariantMap::NewL();
+        }
+
+    CHbSymbianVariant *variant = NULL;
+    variant = CHbSymbianVariant::NewL( &iCertificate, CHbSymbianVariant::EBinary );
+    User::LeaveIfError( iVariantMap->Add( KUntrustedCertEncodedCertificate, variant ) );
+    variant = CHbSymbianVariant::NewL( &iValidationError, CHbSymbianVariant::EInt );
+    User::LeaveIfError( iVariantMap->Add( KUntrustedCertValidationError, variant ) );
+    variant = CHbSymbianVariant::NewL( &iServerName, CHbSymbianVariant::EDes );
+    User::LeaveIfError( iVariantMap->Add( KUntrustedCertServerName, variant ) );
+    if( !iCanHandlePermanentAccept )
+        {
+        variant = CHbSymbianVariant::NewL( &iCanHandlePermanentAccept, CHbSymbianVariant::EBool );
+        User::LeaveIfError( iVariantMap->Add( KUntrustedCertTrustedSiteStoreFail, variant ) );
+        }
+
+    User::LeaveIfError( iDeviceDialog->Show( KUntrustedCertificateDialog, *iVariantMap, this ) );
+    iStatus = KRequestPending;
+    SetActive();
+
+    TRACE( "CUntrustedCertQuery::ShowQueryAndWaitForResponseL, iWait start" );
+    iWait->Start();
+    TRACE( "CUntrustedCertQuery::ShowQueryAndWaitForResponseL, iWaitCompletionCode=%d",
+            iWaitCompletionCode );
+    User::LeaveIfError( iWaitCompletionCode );
+    TRACE( "CUntrustedCertQuery::ShowQueryAndWaitForResponseL, iResponse=%d", iResponse );
+    aResponse = iResponse;
+    }
+
+// ---------------------------------------------------------------------------
+// CUntrustedCertQuery::DoCancel()
+// ---------------------------------------------------------------------------
+//
+void CUntrustedCertQuery::DoCancel()
+    {
+    TRACE( "CUntrustedCertQuery::DoCancel, begin" );
+    if( iDeviceDialog )
+        {
+        TRACE( "CUntrustedCertQuery::DoCancel, cancelling device dialog" );
+        iDeviceDialog->Cancel();
+        }
+
+    // Have to complete the request here, because cancelled device dialog does not
+    // call DeviceDialogClosed() that normally completes it. The request needs to
+    // be completed since CActive::Cancel() waits until the request is completed.
+    TRACE( "CUntrustedCertQuery::DoCancel, completing self with KErrCancel" );
+    TRequestStatus* status( &iStatus );
+    User::RequestComplete( status, KErrCancel );
+
+    // Normally the above request complete would trigger running RunL(). Now RunL()
+    // is not run since the active object is already cancelled. Hence, have to stop
+    // the waiting here so that iWait->Start() returns.
+    iWaitCompletionCode = KErrCancel;
+    if( iWait && iWait->IsStarted() )
+        {
+        TRACE( "CUntrustedCertQuery::DoCancel, stopping iWait" );
+        iWait->AsyncStop();
+        }
+    TRACE( "CUntrustedCertQuery::DoCancel, end" );
+    }
+
+// ---------------------------------------------------------------------------
+// CUntrustedCertQuery::RunL()
+// ---------------------------------------------------------------------------
+//
+void CUntrustedCertQuery::RunL()
+    {
+    TRACE( "CUntrustedCertQuery::RunL, iStatus.Int()=%d", iStatus.Int() );
+    iWaitCompletionCode = iStatus.Int();
+    if( iWait && iWait->IsStarted() )
+        {
+        TRACE( "CUntrustedCertQuery::RunL, stopping iWait" );
+        iWait->AsyncStop();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CUntrustedCertQuery::DataReceived()
+// ---------------------------------------------------------------------------
+//
+void CUntrustedCertQuery::DataReceived( CHbSymbianVariantMap& aData )
+    {
+    TRACE( "CUntrustedCertQuery::DataReceived" );
+    const CHbSymbianVariant* variant = aData.Get( KUntrustedCertDialogResult );
+    if( variant )
+        {
+        TInt* value = variant->Value<TInt>();
+        if( value )
+            {
+            switch( *value )
+                {
+                case KUntrustedCertDialogRejected:
+                    TRACE( "CUntrustedCertQuery::DataReceived, rejected" );
+                    iResponse = EQueryRejected;
+                    break;
+                case KUntrustedCertDialogAccepted:
+                    TRACE( "CUntrustedCertQuery::DataReceived, accepted" );
+                    iResponse = EQueryAccepted;
+                    break;
+                case KUntrustedCertDialogAcceptedPermanently:
+                    TRACE( "CUntrustedCertQuery::DataReceived, accepted permanently" );
+                    iResponse = EQueryAcceptedPermanently;
+                    break;
+                default:
+                    __ASSERT_DEBUG( EFalse, User::Invariant() );
+                    break;
+                }
+            }
+        else
+            {
+            __ASSERT_DEBUG( EFalse, User::Invariant() );
+            }
+        }
+    else
+        {
+        __ASSERT_DEBUG( EFalse, User::Invariant() );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CUntrustedCertQuery::DeviceDialogClosed()
+// ---------------------------------------------------------------------------
+//
+void CUntrustedCertQuery::DeviceDialogClosed( TInt aCompletionCode )
+    {
+    TRACE( "CUntrustedCertQuery::DeviceDialogClosed, aCompletionCode=%d", aCompletionCode );
+    if( IsActive() )
+        {
+        TRACE( "CUntrustedCertQuery::DeviceDialogClosed, request complete" );
+        TRequestStatus* status( &iStatus );
+        User::RequestComplete( status, aCompletionCode );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CUntrustedCertQuery::CUntrustedCertQuery()
+// ---------------------------------------------------------------------------
+//
+CUntrustedCertQuery::CUntrustedCertQuery(
+        TValidationError aValidationError, const TDesC8& aCertificate,
+        const TDesC& aServerName, TBool aCanHandlePermanentAccept ) :
+        CActive( CActive::EPriorityStandard ), iValidationError( aValidationError ),
+        iCertificate( aCertificate ), iServerName( aServerName ),
+        iCanHandlePermanentAccept( aCanHandlePermanentAccept ),
+        iResponse( EQueryRejected )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+// ---------------------------------------------------------------------------
+// CUntrustedCertQuery::ConstructL()
+// ---------------------------------------------------------------------------
+//
+void CUntrustedCertQuery::ConstructL()
+    {
+    TRACE( "CUntrustedCertQuery::ConstructL" );
+    iWait = new( ELeave ) CActiveSchedulerWait;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/untrustedcertificatedialog/inc/untrustedcertificatedefinitions.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,39 @@
+/*
+* 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:  Parameter definitions for untrusted certificate dialog.
+*               Untrusted certificate dialog is displayed for secure
+*               connection (TLS) server authentication failure errors.
+*
+*/
+
+#ifndef UNTRUSTEDCERTIFICATEDEFINITIONS_H
+#define UNTRUSTEDCERTIFICATEDEFINITIONS_H
+
+// Device dialog type for untrusted certificate dialog
+const QString KUntrustedCertificateDialog = "com.nokia.untrustedcert/1.0";
+
+// Corresponds to CServerAuthenticationFailureInput class
+const QString KUntrustedCertEncodedCertificate = "cert";    // bytearray, mandatory
+const QString KUntrustedCertServerName = "host";            // string, mandatory
+const QString KUntrustedCertValidationError = "err";        // int (TValidationError), mandatory
+const QString KUntrustedCertTrustedSiteStoreFail = "tss";   // any, prevents permanent acceptance
+
+// Dialog return codes
+const QString KUntrustedCertificateDialogResult = "result"; // int
+const int KDialogRejected = 0;
+const int KDialogAccepted = 1;
+const int KDialogAcceptedPermanently = 2;
+
+#endif // UNTRUSTEDCERTIFICATEDEFINITIONS_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/untrustedcertificatedialog/inc/untrustedcertificatedialog.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Device dialog plugin that shows untrusted certificate
+*               dialog for TLS server authentication failure errors.
+*
+*/
+
+#ifndef UNTRUSTEDCERTIFICATEDIALOG_H
+#define UNTRUSTEDCERTIFICATEDIALOG_H
+
+#include <hbdialog.h>
+#include <hbdevicedialoginterface.h>
+
+class UntrustedCertificateWidget;
+
+
+/**
+ * Untrusted certificate dialog.
+ * This dialog is displayed when a secure socket (CSecureSocket) is opened
+ * using EDialogModeAttended mode, and the server sends untrusted certificate.
+ * Untrusted certificate dialog shows the certificate details and prompts if
+ * the secure connection is allowed to proceed.
+ */
+class UntrustedCertificateDialog : public HbDialog, public HbDeviceDialogInterface
+{
+    Q_OBJECT
+
+public:     // constructor and destructor
+    UntrustedCertificateDialog(const QVariantMap &parameters);
+    virtual ~UntrustedCertificateDialog();
+
+public:     // from HbDeviceDialogInterface
+    bool setDeviceDialogParameters(const QVariantMap &parameters);
+    int deviceDialogError() const;
+    void closeDeviceDialog(bool byClient);
+    HbDialog *deviceDialogWidget() const;
+
+signals:    // required by device dialog framework
+    void deviceDialogClosed();
+    void deviceDialogData(const QVariantMap &data);
+
+protected:  // from HbPopup (via HbDialog)
+    void hideEvent(QHideEvent *event);
+    void showEvent(QShowEvent *event);
+
+private:    // new functions
+    bool isParametersValid(const QVariantMap &parameters);
+    bool constructDialog(const QVariantMap &parameters);
+    bool updateFromParameters(const QVariantMap &parameters);
+    void sendResult(int result);
+    void confirmPermanentAccept();
+
+private slots:  // new slots
+    void handleAccepted();
+    void handleRejected();
+    void handlePermanentAcceptance();
+
+private:    // new functions
+    Q_DISABLE_COPY(UntrustedCertificateDialog)
+
+private:    // data
+    int mLastError;
+    UntrustedCertificateWidget *mContent;
+    QVariantMap mResultMap;
+    bool mShowEventReceived;
+    HbAction *mOkAction;
+};
+
+#endif // UNTRUSTEDCERTIFICATEDIALOG_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/untrustedcertificatedialog/inc/untrustedcertificateinfo_symbian.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Certificate info class for TLS untrusted certificate dialog.
+*
+*/
+
+#ifndef UNTRUSTEDCERTIFICATEINFOSYMBIAN_H
+#define UNTRUSTEDCERTIFICATEINFOSYMBIAN_H
+
+#include "untrustedcertificateinfobase.h"
+
+class CX509Certificate;
+
+
+/**
+ * Certificate info class for secure connections (TLS) untrusted certificate dialog.
+ * Symbian-specific concrete implementeation for the certificate info class.
+ */
+class UntrustedCertificateInfoSymbian : public UntrustedCertificateInfoBase
+{
+public:     // constructor and destructor
+    UntrustedCertificateInfoSymbian(const QByteArray &aEncodedCert);
+    ~UntrustedCertificateInfoSymbian();
+
+public:     // from UntrustedCertificateInfoBase
+    bool commonNameMatches(const QString &siteName) const;
+    QString certificateDetails(const QString &siteName) const;
+
+private:    // new functions
+    void ConstructL(const QByteArray &aEncodedCert);
+    bool CommonNameMatchesL(const QString &siteName) const;
+    QByteArray Md5FingerprintL( const TDesC8& aEncodedCert ) const;
+
+private:    // data
+    CX509Certificate* mCert;
+    QByteArray mMd5Fingerprint;
+};
+
+#endif // UNTRUSTEDCERTIFICATEINFOSYMBIAN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/untrustedcertificatedialog/inc/untrustedcertificateinfobase.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,94 @@
+/*
+* 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: Certificate info class for TLS untrusted certificate dialog.
+*
+*/
+
+#ifndef UNTRUSTEDCERTIFICATEINFOBASE_H
+#define UNTRUSTEDCERTIFICATEINFOBASE_H
+
+#include <QObject>
+#include <QDateTime>
+
+/**
+ * Certificate info class for secure connections (TLS) untrusted certificate dialog.
+ * This is abstract class that is used in UI code to get displayable certificate
+ * details. Concrete (possibly platform specific) classes implement the functionality.
+ */
+class UntrustedCertificateInfoBase : public QObject
+{
+    Q_OBJECT
+
+public:     // definitions
+    enum CertificateFormat {
+        UnknownCertificate,
+        X509Certificate,
+        WTLSCertificate,
+        X968Certificate
+    };
+    enum Algorithm {
+        Unknown,
+        RSA,
+        DSA,
+        DH,
+        MD2,
+        MD5,
+        SHA1,
+        SHA224,
+        SHA256,
+        SHA384,
+        SHA512
+    };
+
+protected:  // constructor, available for derived classes only
+    UntrustedCertificateInfoBase();
+
+public:     // destructor
+    virtual ~UntrustedCertificateInfoBase();
+
+public:     // new functions
+    virtual const QString subjectName() const;
+    virtual const QString issuerName() const;
+    virtual const QByteArray fingerprint() const;
+    virtual const QByteArray serialNumber() const;
+    virtual const QDateTime validFrom() const;
+    virtual const QDateTime validTo() const;
+    virtual const QString format() const;
+    virtual const QString digestAlgorithm() const;
+    virtual const QString asymmetricAlgorithm() const;
+    virtual const QString combinedAlgorithmName() const;
+    virtual const QString formattedFingerprint(const QByteArray &fingerprint) const;
+    virtual const QString formattedSerialNumber(const QByteArray &serialNumber) const;
+    virtual bool isDateValid() const;
+
+public:     // new abstract functions
+    virtual bool commonNameMatches(const QString &siteName) const = 0;
+    virtual QString certificateDetails(const QString &siteName) const = 0;
+
+private:    // new functions
+    const QString algorithmName(Algorithm algorithm) const;
+
+protected:  // data
+    QString mSubjectName;
+    QString mIssuerName;
+    QByteArray mFingerprint;
+    QByteArray mSerialNumber;
+    QDateTime mValidFrom;
+    QDateTime mValidTo;
+    CertificateFormat mFormat;
+    Algorithm mDigestAlgorithm;
+    Algorithm mAsymmetricAlgorithm;
+};
+
+#endif // UNTRUSTEDCERTIFICATEINFOBASE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/untrustedcertificatedialog/inc/untrustedcertificateplugin.h	Tue Aug 31 16:04:40 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:  Device dialog plugin that shows untrusted certificate
+*               dialog for TLS server authentication failure errors.
+*
+*/
+
+#ifndef UNTRUSTEDCERTIFICATEPLUGIN_H
+#define UNTRUSTEDCERTIFICATEPLUGIN_H
+
+#include <hbdevicedialogplugin.h>
+
+
+/**
+ * Untrusted certificate plugin.
+ * Device dialog plugin to show untrusted certificate dialog.
+ * See UntrustedCertificateDialog.
+ */
+class UntrustedCertificatePlugin : public HbDeviceDialogPlugin
+{
+    Q_OBJECT
+
+public:
+    UntrustedCertificatePlugin();
+    ~UntrustedCertificatePlugin();
+
+public:     // from HbDeviceDialogPlugin
+    bool accessAllowed(const QString &deviceDialogType, const QVariantMap &parameters,
+            const QVariantMap &securityInfo) const;
+    HbDeviceDialogInterface *createDeviceDialog(const QString &deviceDialogType,
+            const QVariantMap &parameters);
+    bool deviceDialogInfo(const QString &deviceDialogType, const QVariantMap &parameters,
+            DeviceDialogInfo *info) const;
+    QStringList deviceDialogTypes() const;
+    PluginFlags pluginFlags() const;
+    int error() const;
+
+private:
+    Q_DISABLE_COPY(UntrustedCertificatePlugin)
+
+    int mError;
+};
+
+#endif // UNTRUSTEDCERTIFICATEPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/untrustedcertificatedialog/inc/untrustedcertificatewidget.h	Tue Aug 31 16:04:40 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:  Device dialog plugin that shows untrusted certificate
+*               dialog for TLS server authentication failure errors.
+*
+*/
+
+#ifndef UNTRUSTEDCERTIFICATEWIDGET_H
+#define UNTRUSTEDCERTIFICATEWIDGET_H
+
+#include <hbwidget.h>
+
+class UntrustedCertificateInfoBase;
+class QGraphicsLinearLayout;
+class HbLabel;
+class HbCheckBox;
+class HbGroupBox;
+class HbTextEdit;
+
+
+/**
+ * Untrusted certificate widget.
+ * Content widget for untrusted certificate dialog.
+ * See UntrustedCertificateDialog.
+ */
+class UntrustedCertificateWidget : public HbWidget
+{
+    Q_OBJECT
+
+public:     // constructor and destructor
+    UntrustedCertificateWidget(QGraphicsItem *parent=0, Qt::WindowFlags flags=0);
+    virtual ~UntrustedCertificateWidget();
+
+    void constructFromParameters(const QVariantMap &parameters);
+    void updateFromParameters(const QVariantMap &parameters);
+    bool isPermanentAcceptAllowed() const;
+    bool isPermanentAcceptChecked() const;
+    QString serverName() const;
+
+public:     // new platform specific functions
+    bool isCertificateValid();
+
+private:    // new platform specific functions
+    void processEncodedCertificate(const QByteArray &encodedCert);
+    QString descriptionText();
+
+private:    // new functions
+    Q_DISABLE_COPY(UntrustedCertificateWidget)
+    void processParameters(const QVariantMap &parameters);
+
+private:    // data
+    QGraphicsLinearLayout *mMainLayout;
+    HbLabel *mProblemDescription;
+    HbCheckBox *mAcceptPermanently;
+    HbGroupBox *mCertificateDetailsGroupBox;
+    HbTextEdit *mCertificateDetailsText;
+    UntrustedCertificateInfoBase *mCertificateInfo;
+    QString mServerName;
+    int mValidationError;
+    bool mIsSavingServerNamePossible;
+};
+
+
+#endif // UNTRUSTEDCERTIFICATEWIDGET_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/untrustedcertificatedialog/rom/untrustedcertdialog.iby	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,24 @@
+/*
+* 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:  ROM image files for untrusted certificate dialog.
+*
+*/
+
+#ifndef __UNTRUSTEDCERTDIALOG_IBY__
+#define __UNTRUSTEDCERTDIALOG_IBY__
+
+file=ABI_DIR\UREL\untrustedcertdialog.dll SHARED_LIB_DIR\untrustedcertdialog.dll UNPAGED
+data=\epoc32\data\z\pluginstub\untrustedcertdialog.qtplugin \resource\plugins\devicedialogs\untrustedcertdialog.qtplugin
+
+#endif  // __UNTRUSTEDCERTDIALOG_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/untrustedcertificatedialog/rom/untrustedcertdialog_resources.iby	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,24 @@
+/*
+* 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:  ROM image files for untrusted certificate dialog.
+*
+*/
+
+#ifndef __UNTRUSTEDCERTDIALOG_RESOURCES_IBY__
+#define __UNTRUSTEDCERTDIALOG_RESOURCES_IBY__
+
+//TODO: enable when localisations ready
+//data=DATAZ_/QT_TRANSLATIONS_DIR/untrustedcertdialog.qm QT_TRANSLATIONS_DIR/untrustedcertdialog.qm
+
+#endif  // __UNTRUSTEDCERTDIALOG_RESOURCES_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/untrustedcertificatedialog/src/untrustedcertificatedialog.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,294 @@
+/*
+* 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:  Device dialog plugin that shows untrusted certificate
+*               dialog for TLS server authentication failure errors.
+*
+*/
+
+#include "untrustedcertificatedialog.h"
+#include "untrustedcertificatedefinitions.h"
+#include "untrustedcertificatewidget.h"
+#include <hblabel.h>
+#include <hbaction.h>
+#include <hbmessagebox.h>
+#include <QGraphicsLinearLayout>
+
+const int KNoError = 0;             // KErrNone
+const int KParameterError = -6;     // KErrArgument
+
+// TODO: replace with OST tracing
+#ifdef _DEBUG
+#include <QDebug>
+#define TRACE(x)        qDebug() << x
+#define TRACE1(x,y)     qDebug() << x << y
+#else
+#define TRACE(x)
+#define TRACE1(x,y)
+#endif
+
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateDialog::UntrustedCertificateDialog()
+// ----------------------------------------------------------------------------
+//
+UntrustedCertificateDialog::UntrustedCertificateDialog(const QVariantMap &parameters) :
+    HbDialog(), mLastError(KNoError), mContent(0), mResultMap(),
+    mShowEventReceived(false), mOkAction(0)
+{
+    constructDialog(parameters);
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateDialog::~UntrustedCertificateDialog()
+// ----------------------------------------------------------------------------
+//
+UntrustedCertificateDialog::~UntrustedCertificateDialog()
+{
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateDialog::setDeviceDialogParameters()
+// ----------------------------------------------------------------------------
+//
+bool UntrustedCertificateDialog::setDeviceDialogParameters(const QVariantMap &parameters)
+{
+   return updateFromParameters(parameters);
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateDialog::deviceDialogError()
+// ----------------------------------------------------------------------------
+//
+int UntrustedCertificateDialog::deviceDialogError() const
+{
+    return mLastError;
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateDialog::closeDeviceDialog()
+// ----------------------------------------------------------------------------
+//
+void UntrustedCertificateDialog::closeDeviceDialog(bool byClient)
+{
+    Q_UNUSED(byClient);
+    TRACE("UntrustedCertificateDialog::closeDeviceDialog");
+    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();
+    }
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateDialog::deviceDialogWidget()
+// ----------------------------------------------------------------------------
+//
+HbDialog *UntrustedCertificateDialog::deviceDialogWidget() const
+{
+    return const_cast<UntrustedCertificateDialog*>(this);
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateDialog::hideEvent()
+// ----------------------------------------------------------------------------
+//
+void UntrustedCertificateDialog::hideEvent(QHideEvent *event)
+{
+    TRACE("UntrustedCertificateDialog::hideEvent");
+    HbDialog::hideEvent(event);
+    emit deviceDialogClosed();
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateDialog::showEvent()
+// ----------------------------------------------------------------------------
+//
+void UntrustedCertificateDialog::showEvent(QShowEvent *event)
+{
+    TRACE("UntrustedCertificateDialog::showEvent");
+    HbDialog::showEvent(event);
+    mShowEventReceived = true;
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateDialog::isParametersValid()
+// ----------------------------------------------------------------------------
+//
+bool UntrustedCertificateDialog::isParametersValid(const QVariantMap &parameters)
+{
+    if (parameters.contains(KUntrustedCertEncodedCertificate) &&
+        parameters.contains(KUntrustedCertServerName) &&
+        parameters.contains(KUntrustedCertValidationError)) {
+        return true;
+        }
+    mLastError = KParameterError;
+    return false;
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateDialog::constructDialog()
+// ----------------------------------------------------------------------------
+//
+bool UntrustedCertificateDialog::constructDialog(const QVariantMap &parameters)
+{
+    TRACE("UntrustedCertificateDialog::constructDialog");
+    if (!isParametersValid(parameters)) {
+        return false;
+    }
+
+    setTimeout(HbPopup::NoTimeout);
+    setDismissPolicy(HbPopup::NoDismiss);
+    setModal(true);
+
+    //: Title text in untrusted certificate dialog. User is opening secure
+    //: connection to site or service, which authenticity cannot be proved,
+    //: or there are other problems in the site certificate. User needs to
+    //: decide if she/he accepts the risk and opens the secure connection
+    //: anyway, or if the connection is rejected.
+    //TODO: localised UI string
+    //QString titleText = hbTrId("");
+    QString titleText = tr("Untrusted certificate");
+    setHeadingWidget(new HbLabel(titleText, this));
+
+    Q_ASSERT(mContent == 0);
+    mContent = new UntrustedCertificateWidget(this);
+    mContent->constructFromParameters(parameters);
+    setContentWidget(mContent);
+
+    if (mContent->isCertificateValid()) {
+        mOkAction = new HbAction(qtTrId("txt_common_button_ok"), this);
+        addAction(mOkAction);
+        disconnect(mOkAction, SIGNAL(triggered()), this, SLOT(close()));
+        connect(mOkAction, SIGNAL(triggered()), this, SLOT(handleAccepted()));
+
+        HbAction *cancelAction = new HbAction(qtTrId("txt_common_button_cancel"), this);
+        addAction(cancelAction);
+        disconnect(cancelAction, SIGNAL(triggered()), this, SLOT(close()));
+        connect(cancelAction, SIGNAL(triggered()), this, SLOT(handleRejected()));
+    } else {
+        HbAction *closeAction = new HbAction(qtTrId("txt_common_button_close"), this);
+        addAction(closeAction);
+        disconnect(closeAction, SIGNAL(triggered()), this, SLOT(close()));
+        connect(closeAction, SIGNAL(triggered()), this, SLOT(handleRejected()));
+    }
+
+    return true;
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateDialog::updateFromParameters()
+// ----------------------------------------------------------------------------
+//
+bool UntrustedCertificateDialog::updateFromParameters(const QVariantMap &parameters)
+{
+    TRACE("UntrustedCertificateDialog::updateFromParameters");
+    if (!isParametersValid(parameters)) {
+        return false;
+    }
+
+    Q_ASSERT(mContent != 0);
+    mContent->updateFromParameters(parameters);
+    return true;
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateDialog::sendResult()
+// ----------------------------------------------------------------------------
+//
+void UntrustedCertificateDialog::sendResult(int result)
+{
+    TRACE1("UntrustedCertificateDialog::sendResult", result);
+    QVariant resultValue(result);
+    mResultMap.insert(KUntrustedCertificateDialogResult, resultValue);
+    emit deviceDialogData(mResultMap);
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateDialog::confirmPermanentAccept()
+// ----------------------------------------------------------------------------
+//
+void UntrustedCertificateDialog::confirmPermanentAccept()
+{
+    TRACE("UntrustedCertificateDialog::confirmPermanentAccept");
+
+    HbDialog *dialog = new HbDialog();
+    dialog->setAttribute(Qt::WA_DeleteOnClose, true);
+    dialog->setTimeout(HbPopup::NoTimeout);
+    dialog->setDismissPolicy(HbDialog::NoDismiss);
+    dialog->setModal(true);
+
+    // TODO: localised UI string needed
+    QString questionTitle = tr("Certificate access");
+    dialog->setHeadingWidget(new HbLabel(questionTitle));
+
+    HbWidget *widget = new HbWidget();
+    QGraphicsLinearLayout* layout = new QGraphicsLinearLayout();
+    // TODO: localized UI string needed
+    QString questionText =
+        tr("Connections to '%1' will be made without warnings. Continue?")
+        .arg(mContent->serverName());
+    HbLabel *textLabel = new HbLabel(questionText);
+    textLabel->setTextWrapping(Hb::TextWordWrap);
+    layout->addItem(textLabel);
+    widget->setLayout(layout);
+    dialog->setContentWidget(widget);
+
+    HbAction *yesAction = new HbAction(hbTrId("txt_common_button_yes"));
+    dialog->addAction(yesAction);
+    disconnect(yesAction, SIGNAL(triggered()), this, SLOT(close()));
+    connect(yesAction, SIGNAL(triggered()), this, SLOT(handlePermanentAcceptance()));
+    dialog->addAction(new HbAction(hbTrId("txt_common_button_no")));
+
+    dialog->show();
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateDialog::handleAccepted()
+// ----------------------------------------------------------------------------
+//
+void UntrustedCertificateDialog::handleAccepted()
+{
+    TRACE("UntrustedCertificateDialog::handleAccepted");
+    if (mContent->isPermanentAcceptChecked()) {
+        confirmPermanentAccept();
+    } else {
+        sendResult(KDialogAccepted);
+		close();
+    }
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateDialog::handleRejected()
+// ----------------------------------------------------------------------------
+//
+void UntrustedCertificateDialog::handleRejected()
+{
+    TRACE("UntrustedCertificateDialog::handleRejected");
+    sendResult(KDialogRejected);
+    close();
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateDialog::handlePermanentAcceptance()
+// ----------------------------------------------------------------------------
+//
+void UntrustedCertificateDialog::handlePermanentAcceptance()
+{
+    TRACE("UntrustedCertificateDialog::handlePermanentAcceptance");
+    sendResult(KDialogAcceptedPermanently);
+    close();
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/untrustedcertificatedialog/src/untrustedcertificateinfo_symbian.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,227 @@
+/*
+* 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: Certificate info class for TLS untrusted certificate dialog.
+*
+*/
+
+#include "untrustedcertificateinfo_symbian.h"
+#include <signed.h>                             // TAlgorithmId
+#include <x509cert.h>                           // CX509Certificate
+#include <X509CertNameParser.h>                 // X509CertNameParser
+#include <hash.h>                               // CMD5
+
+
+// ======== LOCAL FUNCTIONS ========
+
+// ----------------------------------------------------------------------------
+// mapAlgorithm()
+// ----------------------------------------------------------------------------
+//
+UntrustedCertificateInfoBase::Algorithm mapAlgorithm(TAlgorithmId aAlgId)
+{
+    UntrustedCertificateInfoBase::Algorithm algorithm =
+        UntrustedCertificateInfoBase::Unknown;
+    switch(aAlgId) {
+        case ERSA:
+            algorithm = UntrustedCertificateInfoBase::RSA;
+            break;
+        case EDSA:
+            algorithm = UntrustedCertificateInfoBase::DSA;
+            break;
+        case EDH:
+            algorithm = UntrustedCertificateInfoBase::DH;
+            break;
+        case EMD2:
+            algorithm = UntrustedCertificateInfoBase::MD2;
+            break;
+        case EMD5:
+            algorithm = UntrustedCertificateInfoBase::MD5;
+            break;
+        case ESHA1:
+            algorithm = UntrustedCertificateInfoBase::SHA1;
+            break;
+        case ESHA224:
+            algorithm = UntrustedCertificateInfoBase::SHA224;
+            break;
+        case ESHA256:
+            algorithm = UntrustedCertificateInfoBase::SHA256;
+            break;
+        case ESHA384:
+            algorithm = UntrustedCertificateInfoBase::SHA384;
+            break;
+        case ESHA512:
+            algorithm = UntrustedCertificateInfoBase::SHA512;
+            break;
+        default:
+            break;
+    }
+    return algorithm;
+}
+
+// ----------------------------------------------------------------------------
+// convertDateTime()
+// ----------------------------------------------------------------------------
+//
+void convertDateTime(const TTime& aFromTime, QDateTime& aToDateTime)
+{
+    const TDateTime &symbianDateTime = aFromTime.DateTime();
+
+    QDate date(symbianDateTime.Year(), symbianDateTime.Month()+1, symbianDateTime.Day()+1);
+    QTime time(symbianDateTime.Hour(), symbianDateTime.Minute(), symbianDateTime.Second());
+    aToDateTime.setDate(date);
+    aToDateTime.setTime(time);
+}
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateInfoSymbian::UntrustedCertificateInfoSymbian()
+// ----------------------------------------------------------------------------
+//
+UntrustedCertificateInfoSymbian::UntrustedCertificateInfoSymbian(
+    const QByteArray &aEncodedCert) : UntrustedCertificateInfoBase(),
+    mCert(0), mMd5Fingerprint()
+{
+    QT_TRAP_THROWING(ConstructL(aEncodedCert));
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateInfoSymbian::~UntrustedCertificateInfoSymbian()
+// ----------------------------------------------------------------------------
+//
+UntrustedCertificateInfoSymbian::~UntrustedCertificateInfoSymbian()
+{
+    delete mCert;
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateInfoSymbian::commonNameMatches()
+// ----------------------------------------------------------------------------
+//
+bool UntrustedCertificateInfoSymbian::commonNameMatches(const QString &siteName) const
+{
+    bool matches = false;
+    QT_TRAP_THROWING(matches = CommonNameMatchesL(siteName));
+    return matches;
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateInfoSymbian::certificateDetails()
+// ----------------------------------------------------------------------------
+//
+QString UntrustedCertificateInfoSymbian::certificateDetails(const QString &siteName) const
+{
+    // TODO: localized UI string needed
+    QString details = tr("Service:\n%1\n\nIssuer:\n%2\n\nSubject:\n%3\n\n"
+        "Valid from:\n%4\n\nValid until:\n%5\n\nCertificate format:\n%6\n\n"
+        "Algorithm:\n%7\n\nSerial number:\n%8\n\n"
+        "Fingerprint (SHA1):\n%9\n\nFingerprint (MD5):\n%10")
+        .arg(siteName)                                  // %1
+        .arg(issuerName())                              // %2
+        .arg(subjectName())                             // %3
+        .arg(validFrom().toString())                    // %4
+        .arg(validTo().toString())                      // %5
+        .arg(format())                                  // %6
+        .arg(combinedAlgorithmName())                   // %7
+        .arg(formattedSerialNumber(serialNumber()))     // %8
+        .arg(formattedFingerprint(fingerprint()))       // %9
+        .arg(formattedFingerprint(mMd5Fingerprint));    // %10
+    return details;
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateInfoSymbian::ConstructL()
+// ----------------------------------------------------------------------------
+//
+void UntrustedCertificateInfoSymbian::ConstructL(const QByteArray &aEncodedCert)
+{
+    TPtrC8 encodedCert( reinterpret_cast<const TText8*>( aEncodedCert.constData() ),
+        aEncodedCert.length() );
+
+    ASSERT( mCert == 0 );
+    mCert = CX509Certificate::NewL( encodedCert );
+
+    HBufC16* subjectBuf = NULL;
+    X509CertNameParser::SubjectFullNameL( *mCert, subjectBuf );
+    CleanupStack::PushL( subjectBuf );
+    QT_TRYCATCH_LEAVING( mSubjectName =
+        QString::fromUtf16(subjectBuf->Ptr(), subjectBuf->Length()) );
+    CleanupStack::PopAndDestroy( subjectBuf );
+
+    HBufC16* issuerBuf = NULL;
+    X509CertNameParser::IssuerFullNameL( *mCert, issuerBuf );
+    CleanupStack::PushL( issuerBuf );
+    QT_TRYCATCH_LEAVING( mIssuerName =
+        QString::fromUtf16(issuerBuf->Ptr(), issuerBuf->Length()));
+    CleanupStack::PopAndDestroy( issuerBuf );
+
+    TPtrC8 fingerprint = mCert->Fingerprint();
+    QT_TRYCATCH_LEAVING( mFingerprint = QByteArray::fromRawData(
+        reinterpret_cast<const char*>(fingerprint.Ptr()), fingerprint.Length()) );
+
+    mMd5Fingerprint = Md5FingerprintL( mCert->Encoding() );
+
+    TPtrC8 serialNumber = mCert->SerialNumber();
+    QT_TRYCATCH_LEAVING( mSerialNumber = QByteArray::fromRawData(
+        reinterpret_cast<const char*>(serialNumber.Ptr()), serialNumber.Length()) );
+
+    const CValidityPeriod& validityPeriod = mCert->ValidityPeriod();
+    convertDateTime(validityPeriod.Start(), mValidFrom);
+    convertDateTime(validityPeriod.Finish(), mValidTo);
+
+    mFormat = X509Certificate;
+
+    const CSigningAlgorithmIdentifier& alg = mCert->SigningAlgorithm();
+    mDigestAlgorithm = mapAlgorithm(alg.DigestAlgorithm().Algorithm());
+    mAsymmetricAlgorithm = mapAlgorithm(alg.AsymmetricAlgorithm().Algorithm());
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateInfoSymbian::CommonNameMatchesL()
+// ----------------------------------------------------------------------------
+//
+bool UntrustedCertificateInfoSymbian::CommonNameMatchesL(const QString &siteName) const
+{
+    bool matches = false;
+    const CX500DistinguishedName& distinguishedName = mCert->SubjectName();
+    HBufC* commonNameSymbian = distinguishedName.ExtractFieldL( KX520CommonName );
+    if (commonNameSymbian) {
+        CleanupStack::PushL(commonNameSymbian);
+        QString commonName = QString::fromRawData(
+            reinterpret_cast<const QChar*>(commonNameSymbian->Ptr()),
+            commonNameSymbian->Length());
+        matches = ( commonName == siteName );       // TODO: accept '*' chars in commonName?
+        CleanupStack::PopAndDestroy(commonNameSymbian);
+    }
+    return matches;
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateInfoSymbian::Md5FingerprintL()
+// ----------------------------------------------------------------------------
+//
+QByteArray UntrustedCertificateInfoSymbian::Md5FingerprintL( const TDesC8& aEncodedCert ) const
+{
+    CMD5* md5 = CMD5::NewL();
+    CleanupStack::PushL( md5 );
+
+    const TPtrC8 fingerprintSymbian = md5->Hash( aEncodedCert );
+    QByteArray fingerprint( reinterpret_cast<const char*>( fingerprintSymbian.Ptr() ),
+        fingerprintSymbian.Length() );
+
+    CleanupStack::PopAndDestroy( md5 );
+    return fingerprint;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/untrustedcertificatedialog/src/untrustedcertificateinfobase.cpp	Tue Aug 31 16:04:40 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: Certificate info class for TLS untrusted certificate dialog.
+*
+*/
+
+#include "UntrustedCertificateInfoBase.h"
+
+const char *KHexNumberFormatSimple = "%X";
+const char *KHexNumberFormatTwoDigitsWithLeadingZeroes = "%02X";
+const int KCharsPerBlock = 2;
+const char KBlockSeparator = ' ';
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateInfoBase::UntrustedCertificateInfoBase()
+// ----------------------------------------------------------------------------
+//
+UntrustedCertificateInfoBase::UntrustedCertificateInfoBase() : QObject(),
+    mSubjectName(), mIssuerName(), mFingerprint(), mSerialNumber(), mValidFrom(), mValidTo(),
+    mFormat(UnknownCertificate), mDigestAlgorithm(Unknown), mAsymmetricAlgorithm(Unknown)
+{
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateInfoBase::~UntrustedCertificateInfoBase()
+// ----------------------------------------------------------------------------
+//
+UntrustedCertificateInfoBase::~UntrustedCertificateInfoBase()
+{
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateInfoBase::subjectName()
+// ----------------------------------------------------------------------------
+//
+const QString UntrustedCertificateInfoBase::subjectName() const
+{
+    return mSubjectName;
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateInfoBase::issuerName()
+// ----------------------------------------------------------------------------
+//
+const QString UntrustedCertificateInfoBase::issuerName() const
+{
+    return mIssuerName;
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateInfoBase::fingerprint()
+// ----------------------------------------------------------------------------
+//
+const QByteArray UntrustedCertificateInfoBase::fingerprint() const
+{
+    return mFingerprint;
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateInfoBase::serialNumber()
+// ----------------------------------------------------------------------------
+//
+const QByteArray UntrustedCertificateInfoBase::serialNumber() const
+{
+    return mSerialNumber;
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateInfoBase::validFrom()
+// ----------------------------------------------------------------------------
+//
+const QDateTime UntrustedCertificateInfoBase::validFrom() const
+{
+    return mValidFrom;
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateInfoBase::validTo()
+// ----------------------------------------------------------------------------
+//
+const QDateTime UntrustedCertificateInfoBase::validTo() const
+{
+    return mValidTo;
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateInfoBase::format()
+// ----------------------------------------------------------------------------
+//
+const QString UntrustedCertificateInfoBase::format() const
+{
+    QString format;
+    switch (mFormat) {
+        case X509Certificate:
+            //: Type name for X509 certificates displayed in certificate details.
+            // TODO: localised UI string
+            format = tr("X.509");
+            break;
+        default:
+            //: Type name for unknown certificates displayed in certificate details.
+            // TODO: localised UI string
+            format = tr("Unknown");
+            break;
+    }
+    return format;
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateInfoBase::digestAlgorithm()
+// ----------------------------------------------------------------------------
+//
+const QString UntrustedCertificateInfoBase::digestAlgorithm() const
+{
+    return algorithmName(mDigestAlgorithm);
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateInfoBase::AsymmetricAlgorithm()
+// ----------------------------------------------------------------------------
+//
+const QString UntrustedCertificateInfoBase::asymmetricAlgorithm() const
+{
+    return algorithmName(mAsymmetricAlgorithm);
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateInfoBase::AsymmetricAlgorithm()
+// ----------------------------------------------------------------------------
+//
+const QString UntrustedCertificateInfoBase::combinedAlgorithmName() const
+{
+    if (mDigestAlgorithm != Unknown && mAsymmetricAlgorithm != Unknown) {
+        //: Format to combine digest and asymmetric algorithm names.
+        //: %1 is digest (signing) and %2 is asymmetric (public-key) algorithm.
+        // TODO: localised UI string needed
+        return tr("%1%2").arg(digestAlgorithm()).arg(asymmetricAlgorithm());
+    }
+    //: Algorithm name for unknown algorithm.
+    // TODO: localised UI string needed
+    return tr("Unknown");
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateInfoBase::formattedFingerprint()
+// ----------------------------------------------------------------------------
+//
+const QString UntrustedCertificateInfoBase::formattedFingerprint(
+    const QByteArray &byteArray) const
+{
+    QString formatted;
+
+    QString number;
+    int blockIndex = 0;
+    int count = byteArray.count();
+    for (int index = 0; index < count; ++index) {
+        if (blockIndex == KCharsPerBlock) {
+            formatted.append(KBlockSeparator);
+            blockIndex = 0;
+        }
+        number.sprintf(KHexNumberFormatTwoDigitsWithLeadingZeroes,
+            static_cast<unsigned char>(byteArray.at(index)));
+        formatted.append(number);
+        ++blockIndex;
+    }
+
+    return formatted;
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateInfoBase::formattedSerialNumber()
+// ----------------------------------------------------------------------------
+//
+const QString UntrustedCertificateInfoBase::formattedSerialNumber(
+    const QByteArray &serialNumber) const
+{
+    QString formatted;
+
+    QString number;
+    int count = serialNumber.count();
+    for (int index = 0; index < count; ++index) {
+        number.sprintf(KHexNumberFormatSimple,
+            static_cast<unsigned char>(serialNumber.at(index)));
+        formatted.append(number);
+    }
+
+    return formatted;
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateInfoBase::isDateValid()
+// ----------------------------------------------------------------------------
+//
+bool UntrustedCertificateInfoBase::isDateValid() const
+{
+    QDateTime current = QDateTime::currentDateTime();
+    return (mValidFrom <= current && mValidTo >= current);
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateInfoBase::algorithmName()
+// ----------------------------------------------------------------------------
+//
+const QString UntrustedCertificateInfoBase::algorithmName(Algorithm algorithm) const
+{
+    QString name;
+    switch (algorithm) {
+        case RSA:
+            //: Certificate details algorithm name
+            // TODO: localized UI string
+            name = tr("RSA");
+            break;
+        case DSA:
+            //: Certificate details algorithm name
+            // TODO: localized UI string
+            name = tr("DSA");
+            break;
+        case DH:
+            //: Certificate details algorithm name
+            // TODO: localized UI string
+            name = tr("DH");
+            break;
+        case MD2:
+            //: Certificate details algorithm name
+            // TODO: localized UI string
+            name = tr("MD2");
+            break;
+        case MD5:
+            //: Certificate details algorithm name
+            // TODO: localized UI string
+            name = tr("MD5");
+            break;
+        case SHA1:
+            //: Certificate details algorithm name
+            // TODO: localized UI string
+            name = tr("SHA1");
+            break;
+        case SHA224:
+        case SHA256:
+        case SHA384:
+        case SHA512:
+            //: Certificate details algorithm name
+            // TODO: localized UI string
+            name = tr("SHA2");
+            break;
+        case Unknown:
+        default:
+            //: Certificate details algorithm name
+            // TODO: localized UI string
+            name = tr("Unknown");
+            break;
+    }
+    return name;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/untrustedcertificatedialog/src/untrustedcertificateplugin.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,122 @@
+/*
+* 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:  Device dialog plugin that shows untrusted certificate
+*               dialog for TLS server authentication failure errors.
+*
+*/
+
+#include "untrustedcertificateplugin.h"
+#include "untrustedcertificatedialog.h"
+#include "untrustedcertificatedefinitions.h"
+
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificatePlugin::UntrustedCertificatePlugin()
+// ----------------------------------------------------------------------------
+//
+UntrustedCertificatePlugin::UntrustedCertificatePlugin() : mError(KErrNone)
+{
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificatePlugin::~UntrustedCertificatePlugin()
+// ----------------------------------------------------------------------------
+//
+UntrustedCertificatePlugin::~UntrustedCertificatePlugin()
+{
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificatePlugin::accessAllowed()
+// ----------------------------------------------------------------------------
+//
+bool UntrustedCertificatePlugin::accessAllowed(const QString &deviceDialogType,
+    const QVariantMap &parameters, const QVariantMap &securityInfo) const
+{
+    Q_UNUSED(deviceDialogType)
+    Q_UNUSED(parameters)
+    Q_UNUSED(securityInfo)
+
+    // All clients are allowed to use.
+    // TODO: should access be limited to certain clients?
+    return true;
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificatePlugin::createDeviceDialog()
+// ----------------------------------------------------------------------------
+//
+HbDeviceDialogInterface *UntrustedCertificatePlugin::createDeviceDialog(
+    const QString &deviceDialogType, const QVariantMap &parameters)
+{
+    Q_UNUSED(deviceDialogType)
+
+    UntrustedCertificateDialog *deviceDialog = new UntrustedCertificateDialog(parameters);
+    mError = deviceDialog->deviceDialogError();
+    if (mError != KErrNone) {
+        delete deviceDialog;
+        deviceDialog = 0;
+    }
+
+    return deviceDialog;
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificatePlugin::deviceDialogInfo()
+// ----------------------------------------------------------------------------
+//
+bool UntrustedCertificatePlugin::deviceDialogInfo( const QString &deviceDialogType,
+        const QVariantMap &parameters, DeviceDialogInfo *info) const
+{
+    Q_UNUSED(deviceDialogType);
+    Q_UNUSED(parameters);
+
+    info->group = GenericDeviceDialogGroup;
+    info->flags = NoDeviceDialogFlags;
+    info->priority = DefaultPriority;
+
+    return true;
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificatePlugin::deviceDialogTypes()
+// ----------------------------------------------------------------------------
+//
+QStringList UntrustedCertificatePlugin::deviceDialogTypes() const
+{
+    QStringList types;
+    types << KUntrustedCertificateDialog;
+    return types;
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificatePlugin::pluginFlags()
+// ----------------------------------------------------------------------------
+//
+HbDeviceDialogPlugin::PluginFlags UntrustedCertificatePlugin::pluginFlags() const
+{
+    return NoPluginFlags;
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificatePlugin::error()
+// ----------------------------------------------------------------------------
+//
+int UntrustedCertificatePlugin::error() const
+{
+    return mError;
+}
+
+Q_EXPORT_PLUGIN2(untrustedcertdialog,UntrustedCertificatePlugin)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/untrustedcertificatedialog/src/untrustedcertificatewidget.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,161 @@
+/*
+* 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:  Device dialog plugin that shows untrusted certificate
+*               dialog for TLS server authentication failure errors.
+*
+*/
+
+#include "untrustedcertificatewidget.h"
+#include "untrustedcertificatedefinitions.h"
+#include "untrustedcertificateinfobase.h"
+#include <hblabel.h>
+#include <hbcheckbox.h>
+#include <hbgroupbox.h>
+#include <hbtextedit.h>
+#include <QGraphicsLinearLayout>
+
+const int KUnknownError = -5;           // KErrNotSupported
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateWidget::UntrustedCertificateWidget()
+// ----------------------------------------------------------------------------
+//
+UntrustedCertificateWidget::UntrustedCertificateWidget(QGraphicsItem *parent,
+        Qt::WindowFlags flags) : HbWidget(parent, flags),
+        mMainLayout(0), mProblemDescription(0), mAcceptPermanently(0),
+        mCertificateDetailsGroupBox(0), mCertificateDetailsText(0),
+        mCertificateInfo(0), mServerName(), mValidationError(0),
+        mIsSavingServerNamePossible(true)
+{
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateWidget::~UntrustedCertificateWidget()
+// ----------------------------------------------------------------------------
+//
+UntrustedCertificateWidget::~UntrustedCertificateWidget()
+{
+    delete mCertificateInfo;
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateWidget::constructFromParameters()
+// ----------------------------------------------------------------------------
+//
+void UntrustedCertificateWidget::constructFromParameters(
+    const QVariantMap &parameters)
+{
+    processParameters(parameters);
+
+    Q_ASSERT(mMainLayout == 0);
+    mMainLayout = new QGraphicsLinearLayout(Qt::Vertical);
+
+    Q_ASSERT(mProblemDescription == 0);
+    QString text = descriptionText().arg(mServerName);
+    mProblemDescription = new HbLabel(text);
+    mProblemDescription->setTextWrapping(Hb::TextWordWrap);
+    mMainLayout->addItem(mProblemDescription);
+
+    if (isPermanentAcceptAllowed()) {
+        Q_ASSERT(mAcceptPermanently == 0);
+        // TODO: localised UI string needed
+        mAcceptPermanently = new HbCheckBox(tr("Accept permanently"));
+        mMainLayout->addItem(mAcceptPermanently);
+    }
+
+    Q_ASSERT(mCertificateDetailsGroupBox == 0);
+    mCertificateDetailsGroupBox = new HbGroupBox;
+    // TODO: localized UI string needed
+    mCertificateDetailsGroupBox->setHeading(tr("Details"));
+
+    Q_ASSERT(mCertificateDetailsText == 0);
+    mCertificateDetailsText = new HbTextEdit;
+    QString certificateDetails = mCertificateInfo->certificateDetails(mServerName);
+    mCertificateDetailsText->setPlainText(certificateDetails);
+    mCertificateDetailsText->setReadOnly(true);
+
+    mCertificateDetailsGroupBox->setContentWidget(mCertificateDetailsText);
+    mCertificateDetailsGroupBox->setCollapsed(true);
+    mMainLayout->addItem(mCertificateDetailsGroupBox);
+
+    setLayout(mMainLayout);
+    }
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateWidget::updateFromParameters()
+// ----------------------------------------------------------------------------
+//
+void UntrustedCertificateWidget::updateFromParameters(
+    const QVariantMap &parameters)
+{
+    processParameters(parameters);
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateWidget::isPermanentAcceptAllowed()
+// ----------------------------------------------------------------------------
+//
+bool UntrustedCertificateWidget::isPermanentAcceptAllowed() const
+{
+    return (mCertificateInfo->isDateValid() && (mServerName.length() > 0) &&
+        mIsSavingServerNamePossible);
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateWidget::isPermanentAcceptChecked()
+// ----------------------------------------------------------------------------
+//
+bool UntrustedCertificateWidget::isPermanentAcceptChecked() const
+{
+    if (mAcceptPermanently) {
+        return (mAcceptPermanently->checkState() == Qt::Checked);
+    }
+    return false;
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateWidget::serverName()
+// ----------------------------------------------------------------------------
+//
+QString UntrustedCertificateWidget::serverName() const
+{
+    return mServerName;
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateWidget::processParameters()
+// ----------------------------------------------------------------------------
+//
+void UntrustedCertificateWidget::processParameters(const QVariantMap &parameters)
+{
+    mServerName = parameters.value(KUntrustedCertServerName).toString();
+
+    bool ok = false;
+    mValidationError = KUnknownError;
+    int value = parameters.value(KUntrustedCertValidationError).toInt(&ok);
+    if (ok) {
+        mValidationError = value;
+    }
+
+    QByteArray encodedCert = parameters.value(KUntrustedCertEncodedCertificate).toByteArray();
+    processEncodedCertificate(encodedCert);
+
+    if (parameters.contains(KUntrustedCertTrustedSiteStoreFail)) {
+        mIsSavingServerNamePossible = false;
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/untrustedcertificatedialog/src/untrustedcertificatewidget_symbian.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,94 @@
+/*
+* 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:  Device dialog plugin that shows untrusted certificate
+*               dialog for TLS server authentication failure errors.
+*
+*/
+
+#include "untrustedcertificatewidget.h"
+#include "untrustedcertificatedefinitions.h"
+#include "untrustedcertificateinfobase.h"
+#include "untrustedcertificateinfo_symbian.h"
+#include <securitydefs.h>                           // TValidationError
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateWidget::isInvalidCertificate()
+// ----------------------------------------------------------------------------
+//
+bool UntrustedCertificateWidget::isCertificateValid()
+{
+    return (mValidationError != ESignatureInvalid && mValidationError != ECertificateRevoked);
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateWidget::processEncodedCertificate()
+// ----------------------------------------------------------------------------
+//
+void UntrustedCertificateWidget::processEncodedCertificate(const QByteArray &encodedCert)
+{
+    UntrustedCertificateInfoBase *info = new UntrustedCertificateInfoSymbian(encodedCert);
+    if (mCertificateInfo) {
+        delete mCertificateInfo;
+        mCertificateInfo = 0;
+    }
+    mCertificateInfo = info;
+}
+
+// ----------------------------------------------------------------------------
+// UntrustedCertificateWidget::descriptionText()
+// ----------------------------------------------------------------------------
+//
+QString UntrustedCertificateWidget::descriptionText()
+{
+    QString text;
+    if (!isCertificateValid()) {
+        //: Information note text shown if the server certificate has an invalid signature
+        // TODO: localised UI string
+        text = tr("'%1' has sent an invalid certificate. Connection cannot be created.");
+    } else if (mValidationError == EValidatedOK || mValidationError == EDateOutOfRange) {
+        bool isDateValid = mCertificateInfo->isDateValid();
+        bool isSiteValid = mCertificateInfo->commonNameMatches(mServerName);
+        if (!isDateValid && !isSiteValid) {
+            // TODO: hbTrId("txt_untrustedcert_dialog _accept_site_ood")
+            text = tr("'%1' has sent a certificate with different site name and which is out of date. Accept anyway?");
+        } else if (!isSiteValid) {
+            // TODO: hbTrId("txt_untrustedcert_dialog _accept_site"
+            text = tr("'%1' has sent a certificate with different site name. Accept anyway?");
+        } else {
+            // TODO: hbTrId("txt_untrustedcert_dialog_accept_ood")
+            text = tr("'%1' has sent a certificate which is out of date. Accept anyway?");
+        }
+    } else {
+        bool isDateValid = mCertificateInfo->isDateValid();
+        bool isSiteValid = mCertificateInfo->commonNameMatches(mServerName);
+        if (!isDateValid && !isSiteValid) {
+            // TODO: hbTrId("txt_untrustedcert_dialog _accept_untrusted_site_ood"
+            text = tr("'%1' has sent an untrusted certificate with different site name and which is out of date. Accept anyway?");
+        } else if (!isSiteValid) {
+            // TODO: hbTrId("txt_untrustedcert_dialog _accept_untrusted_site"
+            text = tr("'%1' has sent an untrusted certificate with different site name. Accept anyway?");
+        } else if (!isDateValid) {
+            // TODO: hbTrId("txt_untrustedcert_dialog _accept_untrusted_ood")
+            text = tr("'%1' has sent an untrusted certificate which is out of date. Accept anyway?");
+        } else {
+            // TODO: hbTrId("txt_untrustedcert_dialog _accept_untrusted"
+            text = tr("'%1' has sent an untrusted certificate. Accept anyway?");
+        }
+    }
+    return text;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/untrustedcertificatedialog/tsrc/dialoglauncher/ctc_instrument_code.bat	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,34 @@
+@echo off
+rem
+rem Copyright (c) 2010 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:  TLS untrusted certificate dialog test code.
+rem
+
+echo ----------------------------------------------------------------------
+echo.
+echo Instrumenting code (armv5 urel and winscw udeb, decision coverage)
+echo.
+echo ----------------------------------------------------------------------
+echo.
+pushd ..\..
+if exist MON.sym del MON.sym
+if exist MON.dat del MON.dat
+if exist profile.txt del profile.txt
+call qmake
+call make distclean
+call qmake
+call ctcwrap -i d -2comp -C "EXCLUDE+*.UID.CPP" -C "EXCLUDE+moc_*.cpp" sbs -c armv5_urel
+call ctcwrap -i d -2comp -C "EXCLUDE+*.UID.CPP" -C "EXCLUDE+moc_*.cpp" sbs -c winscw_udeb
+popd
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/untrustedcertificatedialog/tsrc/dialoglauncher/ctc_remove_instrumentation.bat	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,31 @@
+@echo off
+rem
+rem Copyright (c) 2010 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:  TLS untrusted certificate dialog test code.
+rem
+
+echo ----------------------------------------------------------------------
+echo.
+echo Removing instrumentation
+echo.
+echo ----------------------------------------------------------------------
+echo.
+pushd ..\..
+call qmake
+call make distclean
+call qmake
+call sbs -c armv5_urel
+call sbs -c winscw_udeb
+popd
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/untrustedcertificatedialog/tsrc/dialoglauncher/dialoglauncher.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,189 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Test application for untrusted certificate dialog.
+*
+*/
+
+#include "dialoglauncher.h"
+#include "../../inc/untrustedcertificatedefinitions.h"
+#include <hbmainwindow.h>
+#include <hbview.h>
+#include <hblabel.h>
+#include <hbcombobox.h>
+#include <hbtextedit.h>
+#include <hbpushbutton.h>
+#include <hbdevicedialog.h>
+#include <hbmessagebox.h>
+#include <QDir>
+#include <QBuffer>
+#include <QGraphicsLinearLayout>
+
+#ifdef Q_OS_SYMBIAN
+#include <securitydefs.h>       // EValidatedOK, ESignatureInvalid, EDateOutOfRange
+#endif
+
+const QString KTestCertDir = "c:/data/testCerts";
+
+
+UntrustedCertDialogLauncher::UntrustedCertDialogLauncher(int& argc, char* argv[])
+    : HbApplication(argc, argv), mMainWindow(0), mMainView(0)
+{
+    mMainWindow = new HbMainWindow();
+    mMainView = new HbView();
+    mMainView->setTitle(tr("UntrustedCertDlg"));
+
+    QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical);
+
+    HbLabel *certFile = new HbLabel(tr("Certificate file:"));
+    layout->addItem(certFile);
+
+    mFilesList = new HbComboBox;
+    mFilesList->setEditable(false);
+    QDir dir(KTestCertDir);
+    if (dir.exists()) {
+        QFileInfoList list = dir.entryInfoList(QDir::Files);
+        QListIterator<QFileInfo> iter(list);
+        while (iter.hasNext()) {
+            const QFileInfo &info(iter.next());
+            mFilesList->addItem(info.fileName());
+        }
+    }
+    layout->addItem(mFilesList);
+
+    mHostName = new HbTextEdit(tr("some.host.com"));
+    layout->addItem(mHostName);
+
+    HbPushButton *button = 0;
+    button = new HbPushButton("Open (valid)");
+    connect(button, SIGNAL(clicked()), this, SLOT(activateDialogDateValid()));
+    layout->addItem(button);
+
+    button = new HbPushButton("Open (out-of-date)");
+    connect(button, SIGNAL(clicked()), this, SLOT(activateDialogOutOfDate()));
+    layout->addItem(button);
+
+    button = new HbPushButton("Open (untrusted)");
+    connect(button, SIGNAL(clicked()), this, SLOT(activateDialogUntrusted()));
+    layout->addItem(button);
+
+    button = new HbPushButton("Open (invalid)");
+    connect(button, SIGNAL(clicked()), this, SLOT(activateDialogInvalid()));
+    layout->addItem(button);
+
+    button = new HbPushButton("Exit");
+    connect(button, SIGNAL(clicked()), qApp, SLOT(quit()));
+    layout->addItem(button);
+
+    mMainView->setLayout(layout);
+    mMainWindow->addView(mMainView);
+    mMainWindow->show();
+}
+
+UntrustedCertDialogLauncher::~UntrustedCertDialogLauncher()
+{
+    delete mMainView;
+    delete mMainWindow;
+}
+
+void UntrustedCertDialogLauncher::activateDialog(const QVariantMap &params)
+{
+    HbDeviceDialog *deviceDialog = new HbDeviceDialog(HbDeviceDialog::NoFlags, this);
+    connect(deviceDialog, SIGNAL(dataReceived(QVariantMap)),
+        this, SLOT(dataReceived(QVariantMap)));
+    connect(deviceDialog, SIGNAL(deviceDialogClosed()),
+        this, SLOT(deviceDialogClosed()));
+
+    if (!deviceDialog->show(KUntrustedCertificateDialog, params)) {
+        HbMessageBox::warning(tr("Cannot open dialog"));
+    }
+}
+
+QVariantMap UntrustedCertDialogLauncher::readParams()
+{
+    QVariantMap params;
+
+    QString fileName = mFilesList->currentText();
+    QFile file;
+    QDir::setCurrent(KTestCertDir);
+    file.setFileName(fileName);
+    file.open(QIODevice::ReadOnly);
+    QByteArray fileContent = file.readAll();
+    file.close();
+
+    params.insert(KUntrustedCertEncodedCertificate, fileContent);
+
+    QString serverName = mHostName->toPlainText();
+    params.insert(KUntrustedCertServerName, serverName);
+
+    return params;
+}
+
+void UntrustedCertDialogLauncher::activateDialogDateValid()
+{
+    QVariantMap params = readParams();
+
+    int validationError = EValidatedOK;
+    params.insert(KUntrustedCertValidationError, validationError);
+
+    activateDialog(params);
+}
+
+void UntrustedCertDialogLauncher::activateDialogOutOfDate()
+{
+    QVariantMap params = readParams();
+
+    int validationError = EDateOutOfRange;
+    params.insert(KUntrustedCertValidationError, validationError);
+
+    activateDialog(params);
+}
+
+void UntrustedCertDialogLauncher::activateDialogUntrusted()
+{
+    QVariantMap params = readParams();
+
+    int validationError = EChainHasNoRoot;
+    params.insert(KUntrustedCertValidationError, validationError);
+
+    activateDialog(params);
+}
+
+void UntrustedCertDialogLauncher::activateDialogInvalid()
+{
+    QVariantMap params = readParams();
+
+    int validationError = ECertificateRevoked;
+    params.insert(KUntrustedCertValidationError, validationError);
+
+    activateDialog(params);
+}
+
+void UntrustedCertDialogLauncher::dataReceived(QVariantMap data)
+{
+    QString values;
+    foreach(const QString key, data.keys()) {
+        values.append(key);
+        values.append(tr(" = "));
+        values.append(data.value(key).toString());
+        values.append(tr("\n"));
+    }
+
+    HbMessageBox::information(tr("dataReceived %1").arg(values));
+}
+
+void UntrustedCertDialogLauncher::deviceDialogClosed()
+{
+    HbMessageBox::information(tr("deviceDialogClosed"));
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/untrustedcertificatedialog/tsrc/dialoglauncher/dialoglauncher.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Test application for untrusted certificate dialog.
+*
+*/
+
+#ifndef UNTRUSTEDCERTDIALOGLAUNCHER_H
+#define UNTRUSTEDCERTDIALOGLAUNCHER_H
+
+#include <hbapplication.h>
+
+class HbMainWindow;
+class HbView;
+class HbComboBox;
+class HbTextEdit;
+
+
+class UntrustedCertDialogLauncher : public HbApplication
+{
+    Q_OBJECT
+
+public:     // constructor and destructor
+    UntrustedCertDialogLauncher(int& argc, char* argv[]);
+    ~UntrustedCertDialogLauncher();
+
+private:    // new functions
+    void activateDialog(const QVariantMap &params);
+    QVariantMap readParams();
+
+private slots:  // new functions
+    void activateDialogDateValid();
+    void activateDialogOutOfDate();
+    void activateDialogUntrusted();
+    void activateDialogInvalid();
+    void dataReceived(QVariantMap data);
+    void deviceDialogClosed();
+
+private:    // data
+    HbMainWindow *mMainWindow;
+    HbView       *mMainView;
+    HbComboBox   *mFilesList;
+    HbTextEdit   *mHostName;
+};
+
+#endif  // UNTRUSTEDCERTDIALOGLAUNCHER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/untrustedcertificatedialog/tsrc/dialoglauncher/dialoglauncher.iby	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Test application for untrusted certificate dialog.
+*
+*/
+
+
+#ifndef __DIALOGLAUNCHER_IBY__
+#define __DIALOGLAUNCHER_IBY__
+
+file=ABI_DIR/BUILD_DIR/dialoglauncher.exe SHARED_LIB_DIR/dialoglauncher.exe
+HB_UPGRADABLE_APP_REG_RSC( dialoglauncher )
+
+#endif  // __DIALOGLAUNCHER_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/untrustedcertificatedialog/tsrc/dialoglauncher/dialoglauncher.pkg	Tue Aug 31 16:04:40 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:  Test application for untrusted certificate dialog.
+;
+
+; Language
+&EN
+
+; SIS header: name, uid, version
+#{"dialoglauncher"},(0xE9bbd80d),1,0,0
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+; Manual PKG pre-rules from PRO files
+; Default dependency to Qt libraries
+(0x2001E61C), 4, 6, 3, {"Qt"}
+
+; Default HW/platform dependencies
+[0x101F7961],0,0,0,{"S60ProductID"}
+[0x102032BE],0,0,0,{"S60ProductID"}
+[0x102752AE],0,0,0,{"S60ProductID"}
+[0x1028315F],0,0,0,{"S60ProductID"}
+
+; Executable and default resource files
+"/epoc32/release/armv5/urel/dialoglauncher.exe" - "!:\sys\bin\dialoglauncher.exe"
+"/epoc32/data/z/resource/apps/dialoglauncher.rsc" - "!:\resource\apps\dialoglauncher.rsc"
+"/epoc32/data/z/private/10003a3f/import/apps/dialoglauncher_reg.rsc" - "!:\private\10003a3f\import\apps\dialoglauncher_reg.rsc"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/untrustedcertificatedialog/tsrc/dialoglauncher/dialoglauncher.pro	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,36 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+# 
+# Description:  Test application for untrusted certificate dialog.
+#
+
+TEMPLATE = app
+TARGET = dialoglauncher
+CONFIG += hb
+DEPENDPATH += .
+INCLUDEPATH += .
+
+HEADERS += dialoglauncher.h
+SOURCES += dialoglaunchermain.cpp dialoglauncher.cpp
+
+symbian {
+    TARGET.CAPABILITY = CAP_APPLICATION
+}
+
+BLD_INF_RULES.prj_exports += \
+  "$${LITERAL_HASH}include <platform_paths.hrh>" \
+  "dialoglauncher.iby CORE_APP_LAYER_IBY_EXPORT_PATH(dialoglauncher.iby)" \
+  "test_cert_expired.crt /epoc32/winscw/c/data/testCerts/test_cert_expired.crt" \
+  "test_cert_server.crt /epoc32/winscw/c/data/testCerts/test_cert_server.crt" \
+  "test_cert_sha2.crt /epoc32/winscw/c/data/testCerts/test_cert_sha2.crt"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/untrustedcertificatedialog/tsrc/dialoglauncher/dialoglaunchermain.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Test application for untrusted certificate dialog.
+*
+*/
+
+#include "dialoglauncher.h"
+
+int main(int argc, char *argv[])
+{
+    UntrustedCertDialogLauncher app(argc, argv);
+    return app.exec();
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/untrustedcertificatedialog/tsrc/dialoglauncher/test_cert_expired.crt	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,17 @@
+-----BEGIN CERTIFICATE-----
+MIICpTCCAg6gAwIBAgIBBDANBgkqhkiG9w0BAQUFADBwMQswCQYDVQQGEwJGSTEQ
+MA4GA1UECBMHVGFtcGVyZTEQMA4GA1UEBxMHVGFtcGVyZTEOMAwGA1UEChMFTm9r
+aWExFTATBgNVBAsTDFM2MCBTZWN1cml0eTEWMBQGA1UEAxMNc29tZS5ob3N0LmNv
+bTAeFw0xMDA2MDIxMTQwMDFaFw0wNjA2MDIxMzU0MTdaMHAxCzAJBgNVBAYTAkZJ
+MRAwDgYDVQQIEwdUYW1wZXJlMRAwDgYDVQQHEwdUYW1wZXJlMQ4wDAYDVQQKEwVO
+b2tpYTEVMBMGA1UECxMMUzYwIFNlY3VyaXR5MRYwFAYDVQQDEw1zb21lLmhvc3Qu
+Y29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC/31fdPI+OcFPpaUC0D2XO
+SmmDbRdouyUa0LCQ9sP9ChiGBqT6g2uv/irhcezA+gUdlERrEQsmmeXuMqktG0Jb
+dxHJNSEboERr+65q7F4g3nJlxeNOlVllCKd4cFO7/oGRtduAJALkQmeKkPwgHPW+
+AFtG7U3rAd5xRjxzK8q7SQIDAQABo08wTTAMBgNVHRMBAf8EAjAAMB0GA1UdDgQW
+BBSJJ8UI5B6SWTG05XFyD3N+/6/+CTALBgNVHQ8EBAMCBeAwEQYJYIZIAYb4QgEB
+BAQDAgZAMA0GCSqGSIb3DQEBBQUAA4GBAB+kN6paDHW46pLwCR5yJLp5m7DoEJ/L
+IMWCmxKB90FADiBz+jvNQue3hO8SJVpvuRsy1y/e915LXYD4JAlIhZektB2DmYqg
+6Tic9tlcQh101myX9sV5ORC2BKg4Tol2PUDaiVsaXSU2cgfWmxPmza2d4RvMvkGp
+4L/EpR5ol37y
+-----END CERTIFICATE-----
Binary file pkiutilities/untrustedcertificatedialog/tsrc/dialoglauncher/test_cert_server.crt has changed
Binary file pkiutilities/untrustedcertificatedialog/tsrc/dialoglauncher/test_cert_sha2.crt has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/untrustedcertificatedialog/tsrc/tlsconntest/tlsconnection.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,471 @@
+/*
+* 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:  Secure connections test application
+*
+*/
+
+#include "tlsconnection.h"
+#include <e32debug.h>
+#include <SecureSocket.h>
+#include <ssl_internal.h>       // KSolInetSSL, KSoSSLDomainName
+
+_LIT( KData, "GET index.html" );
+_LIT( KSecureProtocol, "TLS1.0" );
+_LIT( KCommDBIapId, "IAP\\Id" );
+_LIT8( KNewLine, "\n" );
+
+const TInt KRecvBufferLength = 0x4000;
+const TInt KOneSecondInMicroseconds = 1000000;
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------
+// CTlsConnection::NewL
+// ---------------------------------------------------------
+//
+CTlsConnection* CTlsConnection::NewL( MTlsConnectionObserver& aObs )
+    {
+    RDebug::Print( _L("CTlsConnection::NewL()") );
+    CTlsConnection* self = new ( ELeave ) CTlsConnection( aObs );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CTlsConnection::~CTlsConnection()
+// -----------------------------------------------------------------------------
+//
+CTlsConnection::~CTlsConnection()
+    {
+    RDebug::Print( _L("CTlsConnection::~CTlsConnection()") );
+    Cancel();
+    iDelayTimer.Close();
+    CloseSession();
+    delete iSendBuffer;
+    delete iSendBufPtr;
+    }
+
+// -----------------------------------------------------------------------------
+// CTlsConnection::ConnectL()
+// -----------------------------------------------------------------------------
+//
+void CTlsConnection::ConnectL( const TDesC& aHostName, TInt aPort, TInt aDelay )
+    {
+    RDebug::Print( _L("CTlsConnection::Connect() host '%S', port %d, delay %d"),
+        &aHostName, aPort, aDelay );
+    CloseConnection();
+
+    // Parameters
+    if( iHostName )
+        {
+        delete iHostName;
+        iHostName = NULL;
+        }
+    iHostName = aHostName.AllocL();
+    iPort = aPort;
+    iDelay = aDelay;
+
+    // Save host name in 8-bit form for server certificate checking
+    if( iHostNameForCertCheck )
+        {
+        delete iHostNameForCertCheck;
+        iHostNameForCertCheck = NULL;
+        }
+    iHostNameForCertCheck = HBufC8::NewL( aHostName.Length() );
+    TPtr8 ptr( iHostNameForCertCheck->Des() );
+    ptr.Copy( aHostName );
+
+    // Convert send data to 8-bit and add newline at the end
+    if( iSendBuffer || iSendBufPtr )
+        {
+        delete iSendBuffer;
+        iSendBuffer = NULL;
+        delete iSendBufPtr;
+        iSendBufPtr = NULL;
+        }
+    iSendBuffer = HBufC8::NewL( KData().Length() + 1 );
+    iSendBufPtr = new( ELeave ) TPtr8( iSendBuffer->Des() );
+    iSendBufPtr->Copy( KData );
+    iSendBufPtr->Append( KNewLine );
+
+    // Connect
+    RDebug::Printf( "CTlsConnection::ConnectL iConnection.Open" );
+    User::LeaveIfError( iConnection.Open( iSockServer ) );
+    RDebug::Printf( "CTlsConnection::ConnectL iConnPref.SetDirection" );
+    iConnPref.SetDirection( ECommDbConnectionDirectionOutgoing );
+    if( iCurrentIap )
+        {
+        // uses the same IAP as before
+        RDebug::Printf( "CTlsConnection::ConnectL SetIapId(%d)", iCurrentIap );
+        iConnPref.SetIapId( iCurrentIap );
+        iConnPref.SetDialogPreference( ECommDbDialogPrefDoNotPrompt );
+        }
+    else
+        {
+        // not defined, prompts the IAP from user
+        RDebug::Printf( "CTlsConnection::ConnectL ECommDbDialogPrefPrompt" );
+        iConnPref.SetDialogPreference( ECommDbDialogPrefPrompt );
+        }
+    StateChange( EConnectingNetwork );
+    RDebug::Printf( "CTlsConnection::ConnectL iConnection.Start" );
+    iConnection.Start( iConnPref, iStatus );
+    SetActive();
+    RDebug::Printf( "CTlsConnection::ConnectL end" );
+    }
+
+// -----------------------------------------------------------------------------
+// CTlsConnection::Disconnect()
+// -----------------------------------------------------------------------------
+//
+void CTlsConnection::Disconnect()
+    {
+    Cancel();
+    CloseConnection();
+    StateChange( EDisconnected );
+    }
+
+// -----------------------------------------------------------------------------
+// CTlsConnection::RunL
+// -----------------------------------------------------------------------------
+//
+void CTlsConnection::RunL()
+    {
+    if( iState == EReading && ( iStatus.Int() == KErrEof || iStatus.Int() == KErrSSLAlertCloseNotify ) )
+        {
+        RDebug::Printf( "CTlsConnection::RunL: EReading, EOF: iStatus = %d", iStatus.Int() );
+        StateChange( EAllDone );
+        }
+    else if( iStatus.Int() == KErrNone )
+        {
+        switch ( iState )
+            {
+            case EConnectingNetwork:
+                RDebug::Printf( "CTlsConnection::RunL: EConnectingNetwork" );
+                if( !iCurrentIap )
+                    {
+                    iConnection.GetIntSetting( KCommDBIapId, iCurrentIap );
+                    }
+                if( iDelay )
+                    {
+                    TTimeIntervalMicroSeconds32 delay( iDelay * KOneSecondInMicroseconds );
+                    iDelayTimer.After( iStatus, delay );
+                    StateChange( EOpeningDelay );
+                    }
+                else
+                    {
+                    iConnection.ProgressNotification( iProgress, iStatus );
+                    StateChange( EResolvingHostName );
+                    }
+                SetActive();
+                break;
+
+            case EOpeningDelay:
+                iConnection.ProgressNotification( iProgress, iStatus );
+                StateChange( EResolvingHostName );
+                SetActive();
+                break;
+
+            case EResolvingHostName:
+                {
+                RDebug::Printf( "CTlsConnection::RunL: EResolvingHostName" );
+                TInt err = iHostResolver.Open( iSockServer, KAfInet, KProtocolInetUdp, iConnection );
+                User::LeaveIfError( err );
+                iHostResolver.GetByName( *iHostName, iNameEntry, iStatus );
+                StateChange( EConnectingServer );
+                SetActive();
+                }
+                break;
+
+            case EConnectingServer:
+                {
+                iRemoteAddr.SetFamily( KAfInet );
+                iRemoteAddr = TInetAddr( iNameEntry().iAddr );
+                iRemoteAddr.SetPort( iPort );
+
+                RDebug::Printf( "CTlsConnection::RunL: EConnectingServer" );
+                TInt err = iSocket.Open( iSockServer, KAfInet, KSockStream, KProtocolInetTcp, iConnection );
+                RDebug::Printf( "CTlsConnection::RunL: iSocket.Open ret %d", err );
+                User::LeaveIfError( err );
+                iSocket.Connect( iRemoteAddr, iStatus );
+                StateChange( EHandshaking );
+                SetActive();
+                }
+                break;
+
+            case EHandshaking:
+                {
+                RDebug::Printf( "CTlsConnection::RunL: EHandshaking" );
+                if( iSecureSocket )
+                    {
+                    delete iSecureSocket;
+                    iSecureSocket = NULL;
+                    }
+                iSecureSocket = CSecureSocket::NewL( iSocket, KSecureProtocol );
+                iSecureSocket->SetDialogMode( EDialogModeAttended );
+                // Server name must be set, otherwise CCTSecurityDialogsAO fails with KErrArgument
+                iSecureSocket->SetOpt( KSoSSLDomainName, KSolInetSSL, *iHostNameForCertCheck );
+                iSecureSocket->StartClientHandshake( iStatus );
+                StateChange( EConnecting );
+                SetActive();
+                }
+                break;
+
+            case EConnecting:
+                {
+                RDebug::Printf( "CTlsConnection::RunL: EConnecting" );
+                // Check if connection is closed
+                const TInt stage( iProgress().iStage );
+                if( stage == KConnectionClosed || stage == KLinkLayerClosed )
+                    {
+                    StateChange( EDisconnected );
+                    }
+                else
+                    {
+                    iConnection.ProgressNotification( iProgress, iStatus );
+                    StateChange( ESending );
+                    SetActive();
+                    }
+                }
+                break;
+
+            case ESending:
+                RDebug::Printf( "CTlsConnection::RunL: ESending" );
+                iSecureSocket->Send( *iSendBufPtr, iStatus, iSendLength );
+                StateChange( EReading );
+                SetActive();
+                break;
+
+            case EReading:
+                iTotalRecvCount += iRecvLength();
+                RDebug::Printf( "CTlsConnection::RunL: EReading, read %d bytes", iTotalRecvCount );
+                iObserver.HandleTransferData( iRecvBuffer->Des(), iTotalRecvCount );
+
+                iRecvBufPtr->Zero();
+                iSecureSocket->RecvOneOrMore( *iRecvBufPtr, iStatus, iRecvLength );
+                SetActive();
+                break;
+
+            default:
+                break;
+            }
+        }
+    else
+        {
+        RDebug::Printf( "CTlsConnection::RunL: ERROR iStatus %d", iStatus.Int() );
+        CloseConnection();
+        StateChange( EDisconnected, iStatus.Int() );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CTlsConnection::DoCancel()
+// ---------------------------------------------------------------------------
+//
+void CTlsConnection::DoCancel()
+    {
+    RDebug::Printf( "CTlsConnection::DoCancel(), iState=%d", iState );
+
+    switch( iState )
+        {
+        case EConnectingNetwork:
+            iConnection.Stop();
+            break;
+
+        case EOpeningDelay:
+            iDelayTimer.Cancel();
+            iConnection.Stop();
+            break;
+
+        case EResolvingHostName:
+            iConnection.CancelProgressNotification();
+            iConnection.Stop();
+            break;
+
+        case EConnectingServer:
+            iHostResolver.Cancel();
+            iConnection.Stop();
+            break;
+
+        case EHandshaking:
+            iSocket.CancelConnect();
+            iConnection.Stop();
+            break;
+
+        case EConnecting:
+            if( iSecureSocket )
+                {
+                iSecureSocket->CancelHandshake();
+                delete iSecureSocket;
+                iSecureSocket = NULL;
+                }
+            iSocket.Close();
+            iConnection.Stop();
+            break;
+
+        case ESending:
+            if( iSecureSocket )
+                {
+                iSecureSocket->CancelSend();
+                delete iSecureSocket;
+                iSecureSocket = NULL;
+                }
+            iSocket.Close();
+            iConnection.Stop();
+            break;
+
+        case EReading:
+            if( iSecureSocket )
+                {
+                iSecureSocket->CancelRecv();
+                delete iSecureSocket;
+                iSecureSocket = NULL;
+                }
+            iSocket.Close();
+            iConnection.Stop();
+            break;
+
+        case EAllDone:
+        case EIdle:
+        case EDisconnected:
+        default:
+            break;
+        }
+
+    StateChange( EDisconnected );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CTlsConnection::RunError()
+// -----------------------------------------------------------------------------
+//
+TInt CTlsConnection::RunError( TInt aError )
+    {
+    RDebug::Printf( "CTlsConnection::RunError, aError: %d", aError );
+    CloseConnection();
+    StateChange( EDisconnected, aError );
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTlsConnection::CTlsConnection()
+// -----------------------------------------------------------------------------
+//
+CTlsConnection::CTlsConnection( MTlsConnectionObserver& aObs ) :
+        CActive( CActive::EPriorityStandard ), iObserver( aObs ), iState( ENotInitialized )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+// -----------------------------------------------------------------------------
+// CTlsConnection::ConstructL()
+// -----------------------------------------------------------------------------
+//
+void CTlsConnection::ConstructL()
+    {
+    RDebug::Printf( "CTlsConnection::ConstructL begin" );
+
+    User::LeaveIfError( iDelayTimer.CreateLocal() );
+    RDebug::Printf( "CTlsConnection::ConstructL iSockServer" );
+    User::LeaveIfError( iSockServer.Connect() );
+    RDebug::Printf( "CTlsConnection::ConstructL iConnection" );
+    User::LeaveIfError( iConnection.Open( iSockServer ) );
+    RDebug::Printf( "CTlsConnection::ConstructL buffers" );
+    iRecvBuffer = HBufC8::NewL( KRecvBufferLength );
+    iRecvBufPtr = new( ELeave ) TPtr8( iRecvBuffer->Des() );
+    StateChange( EIdle );
+
+    RDebug::Printf( "CTlsConnection::ConstructL end" );
+    }
+
+// ---------------------------------------------------------------------------
+// CTlsConnection::CloseConnection()
+// ---------------------------------------------------------------------------
+//
+void CTlsConnection::CloseConnection()
+    {
+    RDebug::Printf( "CTlsConnection::CloseConnection begin" );
+    if( iSecureSocket )
+        {
+        delete iSecureSocket;
+        iSecureSocket = NULL;
+        }
+    iSocket.Close();
+    iHostResolver.Close();
+    if( iConnection.SubSessionHandle() )
+        {
+        if( iState >= EConnectingNetwork )
+            {
+            TInt err = iConnection.Stop();
+            if( err != KErrNone )
+                {
+                RDebug::Printf( "iConnection.Stop() failed: %d", err );
+                }
+            }
+        iConnection.Close();
+        }
+    RDebug::Printf( "CTlsConnection::CloseConnection end" );
+    }
+
+// ---------------------------------------------------------------------------
+// CTlsConnection::CloseSession()
+// ---------------------------------------------------------------------------
+//
+void CTlsConnection::CloseSession()
+    {
+    RDebug::Printf( "CTlsConnection::CloseSession" );
+    CloseConnection();
+    iSockServer.Close();
+    delete iHostName;
+    iHostName = NULL;
+    delete iHostNameForCertCheck;
+    iHostNameForCertCheck = NULL;
+    delete iRecvBuffer;
+    iRecvBuffer = NULL;
+    delete iRecvBufPtr;
+    iRecvBufPtr = NULL;
+    StateChange( EDisconnected );
+    }
+
+// -----------------------------------------------------------------------------
+// CTlsConnection::StateChange()
+// -----------------------------------------------------------------------------
+//
+void CTlsConnection::StateChange( TTlsConnectionState aNewState, TInt aError )
+    {
+    RDebug::Printf( "CTlsConnection::StateChange, aNewState=%d, aError=%d", aNewState, aError );
+    if( aNewState != iState && iState != EAllDone )
+        {
+        iState = aNewState;
+        iObserver.HandleNetworkEvent( aNewState, aError );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CTlsConnection::ReadL()
+// ---------------------------------------------------------------------------
+//
+void CTlsConnection::ReadL()
+    {
+    RDebug::Printf( "CTlsConnection::ReadL(), iState=%d", iState );
+
+    TPtr8 recvBuffer = iRecvBuffer->Des();
+    recvBuffer.Zero();
+    iSecureSocket->RecvOneOrMore( recvBuffer, iStatus, iRecvLength );
+    SetActive();
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/untrustedcertificatedialog/tsrc/tlsconntest/tlsconnection.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Secure connections test application
+*
+*/
+
+#ifndef C_TESTTLSCONNECTION_H
+#define C_TESTTLSCONNECTION_H
+
+#include <es_sock.h>                    // RConnection
+#include <in_sock.h>                    // TInetAddr
+#include <commdbconnpref.h>             // TCommDbConnPref
+#include "tlsconnectionobserver.h"      // MTlsConnectionObserver, TTlsConnectionState
+
+class CSecureSocket;
+
+
+class CTlsConnection : public CActive
+    {
+    public:     // new functions
+        static CTlsConnection* NewL( MTlsConnectionObserver& aObs );
+        ~CTlsConnection();
+        void ConnectL( const TDesC& aHostName, TInt aPort, TInt aDelay );
+        void Disconnect();
+
+    protected:  // from CActive
+        void RunL();
+        void DoCancel();
+        TInt RunError( TInt aError );
+
+    private:    // constructors
+        CTlsConnection( MTlsConnectionObserver& aObs );
+        void ConstructL();
+
+    private:    // new functions
+        void CloseConnection();
+        void CloseSession();
+        void StateChange( TTlsConnectionState aNewState, TInt aError = KErrNone );
+        void ReadL();
+
+    private:    // data
+        MTlsConnectionObserver& iObserver;
+        RConnection iConnection;
+        RSocketServ iSockServer;
+        TCommDbConnPref iConnPref;
+        TUint32 iCurrentIap;
+        TNifProgressBuf iProgress;
+        HBufC* iHostName;
+        HBufC8* iHostNameForCertCheck;
+        TInt iPort;
+        TInt iDelay;
+        RHostResolver iHostResolver;
+        TNameEntry iNameEntry;
+        TInetAddr iRemoteAddr;
+        RSocket iSocket;
+        CSecureSocket* iSecureSocket;
+        HBufC8* iRecvBuffer;
+        TPtr8* iRecvBufPtr;
+        TSockXfrLength iRecvLength;
+        HBufC8* iSendBuffer;
+        TPtr8* iSendBufPtr;
+        TSockXfrLength iSendLength;
+        TInt iTotalRecvCount;
+        TTlsConnectionState iState;
+        RTimer iDelayTimer;
+    };
+
+
+#endif // C_TESTTLSCONNECTION_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/untrustedcertificatedialog/tsrc/tlsconntest/tlsconnectionapp.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,197 @@
+/*
+* 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:  Secure connections test application
+*
+*/
+
+#include "tlsconnectionapp.h"
+#include "tlsconnection.h"
+#include <hbmainwindow.h>
+#include <hbview.h>
+#include <QDebug>
+#include <QGraphicsLinearLayout>
+#include <hbcombobox.h>
+#include <hblineedit.h>
+#include <hblabel.h>
+#include <hbpushbutton.h>
+#include <hbmessagebox.h>
+
+
+TlsConnectionApplication::TlsConnectionApplication(int& aArgc, char* aArgv[])
+    : HbApplication(aArgc, aArgv), mMainWindow(0), mMainView(0), mHost(0),
+      mPort(0), mOpeningDelay(0), mStatusLabel(0), mConnection(0)
+{
+    qDebug() << "TLStest TlsConnectionApplication begin";
+
+    mMainWindow = new HbMainWindow();
+    mMainView = new HbView();
+    mMainView->setTitle(tr("TLS Test"));
+
+    QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical);
+
+    mHost = new HbComboBox;
+    QStringList defaultHosts;
+    defaultHosts << "www.nokia.com"
+        << "www.f-secure.com"
+        << "www.google.fi"
+        << "www.tut.fi";
+    mHost->addItems(defaultHosts);
+    connect(mHost, SIGNAL(editingFinished()), this, SLOT(addHostName()));
+    mHost->setEditable(true);
+    layout->addItem(mHost);
+
+    mPort = new HbLineEdit(tr("Port?"));
+    mPort->setText(tr("443"));
+    layout->addItem(mPort);
+
+    mOpeningDelay = new HbLineEdit(tr("Opening delay?"));
+    mOpeningDelay->setText(tr("0"));
+    layout->addItem(mOpeningDelay);
+
+    mStatusLabel = new HbLabel(tr("Inactive"));
+    layout->addItem(mStatusLabel);
+
+    HbPushButton *activateButton = new HbPushButton(tr("Run Test"));
+    connect(activateButton, SIGNAL(clicked()), this, SLOT(runTestPressed()));
+    layout->addItem(activateButton);
+
+    HbPushButton *closeButton = new HbPushButton("Close");
+    connect(closeButton, SIGNAL(clicked()), qApp, SLOT(quit()));
+    layout->addItem(closeButton);
+
+    mMainView->setLayout(layout);
+    mMainWindow->addView(mMainView);
+    mMainWindow->show();
+
+    qDebug() << "TLStest TlsConnectionApplication end";
+}
+
+TlsConnectionApplication::~TlsConnectionApplication()
+{
+    qDebug() << "TLStest ~TlsConnectionApplication begin";
+
+    delete mConnection;
+    delete mMainView;
+    delete mMainWindow;
+
+    qDebug() << "TLStest ~TlsConnectionApplication end";
+}
+
+void TlsConnectionApplication::HandleNetworkEvent( TTlsConnectionState aEvent, TInt aError )
+{
+    switch( aEvent ) {
+	case ENotInitialized:
+		showProgress( tr("NotInitialized"), aError );
+		break;
+	case EDisconnected:
+		showProgress( tr("Disconnected"), aError );
+		break;
+	case EIdle:
+		showProgress( tr("Idle"), aError );
+		break;
+	case EConnectingNetwork:
+		showProgress( tr("ConnectingNetwork"), aError );
+		break;
+	case EOpeningDelay:
+		showProgress( tr("OpeningDelay"), aError );
+		break;
+	case EResolvingHostName:
+		showProgress( tr("ResolvingHostName"), aError );
+		break;
+	case EConnectingServer:
+		showProgress( tr("ConnectingServer"), aError );
+		break;
+	case EHandshaking:
+		showProgress( tr("Handshaking"), aError );
+		break;
+	case EConnecting:
+		showProgress( tr("Connecting"), aError );
+		break;
+	case ESending:
+		showProgress( tr("Sending"), aError );
+		break;
+	case EReading:
+		showProgress( tr("Reading"), aError );
+		break;
+	case EAllDone:
+		showProgress( tr("AllDone"), aError );
+		break;
+	default:
+		showProgress( tr("unknown"), aError );
+		break;
+	}
+}
+
+void TlsConnectionApplication::HandleTransferData( const TDesC8& /*aData*/, TInt aLength )
+{
+    qDebug() << "TLStest HandleTransferData, length:" << aLength;
+}
+
+void TlsConnectionApplication::runTestPressed()
+{
+    qDebug() << "TLStest runTestPressed begin";
+
+    if (mConnection) {
+        delete mConnection;
+        mConnection = NULL;
+    }
+
+    TPtrC host( reinterpret_cast<const TText*>( mHost->currentText().constData() ));
+    TInt port = getInt(mPort->text(), 443);
+    TInt delay = getInt(mOpeningDelay->text(), 0);
+    qDebug() << "TLStest runTestPressed host:" << mHost->currentText() << "port" << port << "delay" << delay;
+    TRAPD( err, mConnection = CTlsConnection::NewL( *this ) );
+    qDebug() << "TLStest runTestPressed err:" << err;
+    if( !err ) {
+        qDebug() << "TLStest runTestPressed CTlsConnection created, connecting";
+        TRAP( err, mConnection->ConnectL( host, port, delay ) );
+        qDebug() << "TLStest runTestPressed err:" << err;
+    }
+
+    qDebug() << "TLStest runTestPressed end";
+}
+
+void TlsConnectionApplication::addHostName()
+{
+    QString newHostName = mHost->currentText();
+    mHost->addItem(newHostName);
+}
+
+void TlsConnectionApplication::showProgress(const QString& aStep, int aError)
+{
+    qDebug() << "TLStest showProgress step" << aStep << "error" << aError;
+    if (mStatusLabel) {
+        if (!aError) {
+            mStatusLabel->setPlainText(aStep);
+        } else {
+            QString msg(aStep);
+            msg.append(tr(" error %1").arg(aError));
+            mStatusLabel->setPlainText(msg);
+        }
+    }
+}
+
+TInt TlsConnectionApplication::getInt(const QString& aString, int defaultValue)
+{
+    qDebug() << "TLStest getInt" << aString << "defaultValue" << defaultValue;
+
+    bool ok = false;
+    TInt value = aString.toInt(&ok, 10);
+    if (!ok) {
+        value = defaultValue;
+    }
+
+    qDebug() << "TLStest getInt returns " << value;
+    return value;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/untrustedcertificatedialog/tsrc/tlsconntest/tlsconnectionapp.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,63 @@
+/*
+* 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:  Secure connections test application
+*
+*/
+
+#ifndef TLSCONNECTIONAPP_H
+#define TLSCONNECTIONAPP_H
+
+#include <hbapplication.h>
+#include "tlsconnectionobserver.h"
+
+class HbMainWindow;
+class HbView;
+class HbComboBox;
+class HbLineEdit;
+class HbLabel;
+class CTlsConnection;
+
+
+class TlsConnectionApplication : public HbApplication, public MTlsConnectionObserver
+{
+    Q_OBJECT
+
+public:     // constructor and destructor
+    TlsConnectionApplication(int& aArgc, char* aArgv[]);
+    virtual ~TlsConnectionApplication();
+
+public:		// from MTlsConnectionObserver
+    void HandleNetworkEvent(TTlsConnectionState aEvent, TInt aError);
+    void HandleTransferData(const TDesC8& aData, TInt aLength);
+
+private slots:
+    void runTestPressed();
+    void addHostName();
+
+private:    // new functions
+    void showProgress(const QString& aStep, int aError);
+    TInt getInt(const QString& aString, int defaultValue);
+
+private:    // data
+    HbMainWindow *mMainWindow;
+    HbView       *mMainView;
+    HbComboBox   *mHost;
+    HbLineEdit   *mPort;
+    HbLineEdit   *mOpeningDelay;
+    HbLabel      *mStatusLabel;
+    CTlsConnection *mConnection;
+};
+
+#endif  // TLSCONNECTIONAPP_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/untrustedcertificatedialog/tsrc/tlsconntest/tlsconnectionmain.cpp	Tue Aug 31 16:04:40 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:  Secure connections test application
+*
+*/
+
+#include "tlsconnectionapp.h"
+#include <QDebug>
+#include <e32base.h>                // CTrapCleanup
+
+
+int DoMainL(int argc, char *argv[])
+{
+    TlsConnectionApplication app(argc, argv);
+    return app.exec();
+}
+
+int main(int argc, char *argv[])
+{
+    qDebug() << "TLStest main begin";
+
+    int err = 0;
+    CTrapCleanup *cleanup = CTrapCleanup::New();
+    if (cleanup) {
+        TRAP(err, DoMainL(argc, argv));
+        delete cleanup;
+    }
+
+    qDebug() << "TLStest main returns" << err;
+    return err;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/untrustedcertificatedialog/tsrc/tlsconntest/tlsconnectionobserver.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Secure connections test application
+*
+*/
+
+#ifndef M_MTLSCONNECTIONOBSERVER_H
+#define M_MTLSCONNECTIONOBSERVER_H
+
+enum TTlsConnectionState
+    {
+    ENotInitialized = 0,
+    EDisconnected,
+    EIdle,
+    EConnectingNetwork,
+    EOpeningDelay,
+    EResolvingHostName,
+    EConnectingServer,
+    EHandshaking,
+    EConnecting,
+    ESending,
+    EReading,
+    EAllDone
+    };
+
+class MTlsConnectionObserver
+    {
+    public:
+        virtual void HandleNetworkEvent( TTlsConnectionState aEvent, TInt aError ) = 0;
+        virtual void HandleTransferData( const TDesC8& aData, TInt aLength ) = 0;
+    };
+
+#endif // M_MTLSCONNECTIONOBSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/untrustedcertificatedialog/tsrc/tlsconntest/tlsconntest.iby	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Secure connections test application
+*
+*/
+
+
+#ifndef __TLSCONNTEST_IBY__
+#define __TLSCONNTEST_IBY__
+
+file=ABI_DIR/BUILD_DIR/tlsconntest.exe SHARED_LIB_DIR/tlsconntest.exe
+HB_UPGRADABLE_APP_REG_RSC( tlsconntest )
+
+#endif  // __TLSCONNTEST_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/untrustedcertificatedialog/tsrc/tlsconntest/tlsconntest.loc	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,19 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Secure connections test application
+*
+*/
+
+#define STRING_r_short_caption "TlsConnTest"
+#define STRING_r_caption "TlsConnTest"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/untrustedcertificatedialog/tsrc/tlsconntest/tlsconntest.pkg	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,41 @@
+;
+; 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:  Secure connections test application
+;
+;
+
+; Language
+&EN
+
+; SIS header: name, uid, version
+#{"TlsConnTest"},(0xE8DC94B1),1,0,0
+
+; Vendor name, localised and unique
+%{"Nokia"}
+:"Nokia"
+
+; Default dependency to Qt libraries
+(0x2001E61C), *, *, *, {"Qt"}
+
+; Default platform dependencies
+[0x101F7961],0,0,0,{"S60ProductID"}
+[0x102032BE],0,0,0,{"S60ProductID"}
+[0x102752AE],0,0,0,{"S60ProductID"}
+[0x1028315F],0,0,0,{"S60ProductID"}
+
+; Executable and default resource files
+"/epoc32/release/armv5/urel/tlsconntest.exe" - "!:\sys\bin\tlsconntest.exe"
+"/epoc32/data/z/resource/apps/tlsconntest.rsc" - "!:\resource\apps\tlsconntest.rsc"
+"/epoc32/data/z/private/10003a3f/import/apps/tlsconntest_reg.rsc" - "!:\private\10003a3f\import\apps\tlsconntest_reg.rsc"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/untrustedcertificatedialog/tsrc/tlsconntest/tlsconntest.pro	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,39 @@
+#
+# 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:  Secure connections test application
+#
+
+TEMPLATE = app
+TARGET = tlsconntest
+CONFIG += hb
+DEPENDPATH += .
+INCLUDEPATH += .
+
+HEADERS += tlsconnection.h tlsconnectionobserver.h tlsconnectionapp.h tlsconntest.loc
+SOURCES += tlsconnectionmain.cpp tlsconnection.cpp tlsconnectionapp.cpp
+LIBS += -lesock -lcommdb -linsock -linetprotutil -lsecuresocket
+
+symbian {
+    BLD_INF_RULES.prj_exports += "tlsconntest.loc APP_LAYER_LOC_EXPORT_PATH(tlsconntest.loc)"
+    
+    TARGET.UID2 = 0x100039CE
+    TARGET.UID3 = 0xE8DC94B1        # random uid
+    TARGET.CAPABILITY = CAP_APPLICATION
+}
+
+BLD_INF_RULES.prj_exports += \
+  "$${LITERAL_HASH}include <platform_paths.hrh>" \
+  "tlsconntest.iby CORE_APP_LAYER_IBY_EXPORT_PATH(tlsconntest.iby)"
+
+ 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/untrustedcertificatedialog/untrustedcertificateplugin.pro	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,58 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:  Device dialog plugin that shows untrusted certificate
+#               dialog for TLS server authentication failure errors.
+#
+
+TEMPLATE = lib
+TARGET = untrustedcertdialog
+CONFIG += hb plugin
+
+INCLUDEPATH += .
+INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+DEPENDPATH += .
+
+HEADERS += inc/untrustedcertificateplugin.h \
+    inc/untrustedcertificatedefinitions.h \
+    inc/untrustedcertificatedialog.h \
+    inc/untrustedcertificatewidget.h \
+    inc/untrustedcertificateinfobase.h
+
+SOURCES += src/untrustedcertificateplugin.cpp \
+    src/untrustedcertificatedialog.cpp \
+    src/untrustedcertificatewidget.cpp \
+    src/untrustedcertificateinfobase.cpp
+
+symbian: {
+    TARGET.EPOCALLOWDLLDATA = 1
+    TARGET.CAPABILITY = CAP_GENERAL_DLL
+    TARGET.UID3 = 0x20030000
+
+    HEADERS += inc/untrustedcertificateinfo_symbian.h
+    SOURCES += src/untrustedcertificatewidget_symbian.cpp \
+        src/untrustedcertificateinfo_symbian.cpp
+    
+    LIBS += -lcrypto -lx509 -lx500 -lhash -lX509CertNameParser
+    
+    pluginstub.sources = untrustedcertdialog.dll
+    pluginstub.path = /resource/plugins/devicedialogs
+    DEPLOYMENT += pluginstub
+}
+
+BLD_INF_RULES.prj_exports += \
+    "$${LITERAL_HASH}include <platform_paths.hrh>" \
+    "qmakepluginstubs/untrustedcertdialog.qtplugin /epoc32/data/z/pluginstub/untrustedcertdialog.qtplugin" \
+    "rom/untrustedcertdialog.iby CORE_MW_LAYER_IBY_EXPORT_PATH(untrustedcertdialog.iby)" \
+    "rom/untrustedcertdialog_resources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(untrustedcertdialog_resources.iby)"
+
--- a/pkiutilities/x509certnameparser/group/X509CertNameParser.mmp	Thu Aug 19 10:45:23 2010 +0300
+++ b/pkiutilities/x509certnameparser/group/X509CertNameParser.mmp	Tue Aug 31 16:04:40 2010 +0300
@@ -39,7 +39,7 @@
 CAPABILITY		CAP_GENERAL_DLL
 VENDORID        VID_DEFAULT
 
-#if defined(ARMCC)
+#if defined( EABI )
 deffile ../EABI/ 
 #elif defined( WINSCW )
 deffile ../BWINSCW/ 
--- a/remotelock/RemoteLockEngine/Src/RemoteLock.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/remotelock/RemoteLockEngine/Src/RemoteLock.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -33,6 +33,7 @@
 #include <pathinfo.h> 
 #endif //RD_MULTIPLE_DRIVE 
 #include <coreapplicationuisdomainpskeys.h>
+#include <CoreApplicationUIsSDKCRKeys.h>
 #include <charconv.h>
 #include <ProfileEngineSDKCRKeys.h>
 #include <Profile.hrh>
@@ -625,7 +626,7 @@
        if ( !iProfileSession )
            {
            RL_TRACE_PRINT(" [ rl.exe ] CheckSettingsL() create session "); 
-           iProfileSession = CRepository::NewL( KCRUidProfileEngine ); 
+           iProfileSession = CRepository::NewL( KCRUidCoreApplicationUIs );	// previously it was	KCRUidProfileEngine
            }
        if ( !iObserver )
            {
@@ -655,7 +656,7 @@
             if ( !iProfileSession )
                 {
                 RL_TRACE_PRINT(" [ rl.exe ] CheckSettingsL() create session "); 
-                iProfileSession = CRepository::NewL( KCRUidProfileEngine ); 
+                iProfileSession = CRepository::NewL( KCRUidCoreApplicationUIs );	// previously it was	KCRUidProfileEngine
                 }
             ProfileNotifyL( EFalse );
             delete iProfileSession;
@@ -1458,7 +1459,10 @@
     if ( aNotifyEnable )
         {
         
-        TInt err = iProfileSession->Get( KProEngActiveProfile, iCurrentProfile );
+        TInt err = iProfileSession->Get( KCoreAppUIsNetworkConnectionAllowed , iCurrentProfile );	// previously was KProEngActiveProfile
+        RL_TRACE_PRINT_NUM("[rl.exe] HandleNotifyGeneric() err = %d", err );
+    		RL_TRACE_PRINT_NUM("[rl.exe] HandleNotifyGeneric() iCurrentProfile = %d", iCurrentProfile );
+
         User::LeaveIfError( err );
         RL_TRACE_PRINT(" [ rl.exe ] ProfileNotifyL() startlisten");
         iProfileNotifyHandler->StartListeningL();  
@@ -1486,7 +1490,9 @@
     {
     RL_TRACE_PRINT(" [ rl.exe ] GetProfile() ");
     TInt err;
-    err = iProfileSession->Get( KProEngActiveProfile, aProfile );
+    err = iProfileSession->Get( KCoreAppUIsNetworkConnectionAllowed , aProfile );	// previously was KProEngActiveProfile
+		RL_TRACE_PRINT_NUM("[rl.exe] HandleNotifyGeneric() err = %d", err );
+
     RL_TRACE_PRINT(" [ rl.exe ] exit GetProfile() ");
     return ( err == KErrNone );
     }    
@@ -1505,8 +1511,9 @@
     
     TInt profile = 0; 
     GetProfile( profile ); 
-    
-    if ( ( profile == EProfileOffLineId ) && ( iIsEnabled  ) && ( iCurrentProfile != EProfileOffLineId )) 
+    RL_TRACE_PRINT_NUM("[rl.exe] HandleNotifyGeneric() profile = %d", profile );
+    RL_TRACE_PRINT_NUM("[rl.exe] HandleNotifyGeneric() iCurrentProfile = %d", iCurrentProfile );
+    if ( ( profile == ECoreAppUIsNetworkConnectionNotAllowed ) && ( iIsEnabled  ) && ( iCurrentProfile != ECoreAppUIsNetworkConnectionNotAllowed )) 
         {
         ActivateDeviceLock();  
         }
--- a/secsrv_plat/devenccommonutils_api/inc/DevEncDiskUtils.h	Thu Aug 19 10:45:23 2010 +0300
+++ b/secsrv_plat/devenccommonutils_api/inc/DevEncDiskUtils.h	Tue Aug 31 16:04:40 2010 +0300
@@ -43,7 +43,7 @@
         static void DoVerifyTestFileL();
         static TInt64 FindCriticalLevelTresholdL();
         static TInt FindValueL( const TUid aRepositoryUid, const TUint aCRKey );
-        static TInt64 FindWarningLevelTresholdL( const TDriveNumber aNumber );
+        static TInt64 FindWarningLevelTresholdL();
     };
 
 #endif // DEVENCDISKUTILS_H
--- a/secsrv_plat/devicelock_access_api/group/ABLD.BAT	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-@ECHO OFF
-
-REM Bldmake-generated batch file - ABLD.BAT
-REM ** DO NOT EDIT **
-
-perl -S ABLD.PL "\s60\mw\devicemanagement\devmngt_dom\devicelock_access_api\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9
-if errorlevel==1 goto CheckPerl
-goto End
-
-:CheckPerl
-perl -v >NUL
-if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed?
-goto End
-
-:End
--- a/secsrv_plat/keyguard_access_api/group/ABLD.BAT	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-@ECHO OFF
-
-REM Bldmake-generated batch file - ABLD.BAT
-REM ** DO NOT EDIT **
-
-perl -S ABLD.PL "\s60\mw\devicemanagement\devmngt_dom\keyguard_access_api\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9
-if errorlevel==1 goto CheckPerl
-goto End
-
-:CheckPerl
-perl -v >NUL
-if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed?
-goto End
-
-:End
--- a/secsrv_plat/lockapp_server_api/group/ABLD.BAT	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-@ECHO OFF
-
-REM Bldmake-generated batch file - ABLD.BAT
-REM ** DO NOT EDIT **
-
-perl -S ABLD.PL "\s60\mw\devicemanagement\devmngt_dom\lockapp_server_api\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9
-if errorlevel==1 goto CheckPerl
-goto End
-
-:CheckPerl
-perl -v >NUL
-if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed?
-goto End
-
-:End
--- a/secsrv_plat/security_code_ui_api/inc/SecUi.h	Thu Aug 19 10:45:23 2010 +0300
+++ b/secsrv_plat/security_code_ui_api/inc/SecUi.h	Tue Aug 31 16:04:40 2010 +0300
@@ -21,6 +21,14 @@
 #ifndef     __SECUI_H
 #define     __SECUI_H
 
+#if defined(_DEBUG)
+#define RDEBUG( x, y ) RDebug::Printf( "%s %s (%u) %s=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, x, y );
+#define RDEBUGSTR( x ) RDebug::Print( x );
+#else
+#define RDEBUG( x, y )
+#define RDEBUGSTR( x )
+#endif
+
 class TSecUi
 	{
 	public:
@@ -36,12 +44,6 @@
 		* Should be called after finished using SecUi methods 
 		*/
 		IMPORT_C static void UnInitializeLib();
-		/**
-		* Returns the resource file name of SecurityUI dll.
-		*
-		* @return TFileName (resource file name) 
-		*/
-		static TFileName ResourceFileName();
         	/**
         * Check if SecUi can be uninitialized, i.e. if client count is zero (or less).
         *
@@ -75,6 +77,7 @@
 	private:
 		TInt iResourceFileOffset;
         TInt iClientCount;
+        TInt iDialogOpened;
 
 	};
 #endif
--- a/secsrv_plat/security_code_ui_api/inc/SecUiCodeQueryDialog.h	Thu Aug 19 10:45:23 2010 +0300
+++ b/secsrv_plat/security_code_ui_api/inc/SecUiCodeQueryDialog.h	Tue Aug 31 16:04:40 2010 +0300
@@ -17,15 +17,12 @@
 *
 */
 
-
 #ifndef __SECUICODEQUERYDIALOG__
 #define __SECUICODEQUERYDIALOG__
 
-#include <aknquerydialog.h>
-#include <aknnotedialog.h>
 #include <secui.hrh>
 
-class CCodeQueryDialog : public CAknTextQueryDialog
+class CCodeQueryDialog : public CBase
 	{
 	public://construction and destruction
 		/**
@@ -40,73 +37,7 @@
         * Destructor.
         */
 		~CCodeQueryDialog();
-	public:
-		/**
-		* Allows dismissing of code queries. Only mandatory requirement is that PIN
-		* queries are dismissed by the # 
-		*
-		* @param aKeyEvent TKeyEvent&
-		* @return ETrue query is dismissed
-		*		  EFalse not dismissed
-		*/
-		TBool NeedToDismissQueryL(const TKeyEvent& aKeyEvent);
-		/**
-		* Calls the dialog's TryExitL and passes the reason given as a parameter.
-		*
-		* @param TInt aReason (The reason for the cancel request)
-		*/
-		void TryCancelQueryL(TInt aReason);
 
-	protected://from CAknTextQueryDialog
-		/**
-		* From CAknTextQueryDialog This function is called by the UIKON dialog framework 
-		* just before the dialog is activated, after it has called
-		* PreLayoutDynInitL() and the dialog has been sized.
-		*/
-		void PreLayoutDynInitL();
-		/**
-		* From CAknTextQueryDialog This function is called by the UIKON framework 
-		* if the user activates a button in the button panel. 
-		* It is not called if the Cancel button is activated, 
-		* unless the EEikDialogFlagNotifyEsc flag is set.
-		* @param aButtonId  The ID of the button that was activated
-		* @return           Should return ETrue if the dialog should exit, and EFalse if it should not.
-		*/
-		TBool OkToExitL(TInt aButtonId);
-		/**
-		* From CAknTextQueryDialog This function is called by the UIKON dialog framework 
-        * just after a key is pressed
-		* @param aKeyEvent TKeyEvent& 
-		* @param aType TEventCode 
-        */
-		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
-			/**
-   		* From MAknQueryControlObeserver; overrides the default implementation in CAknQueryDialog. 
-   		* Gets called by framework when editor sends state event
-    	*/	
-		TBool HandleQueryEditorStateEventL(CAknQueryControl* aQueryControl, TQueryControlEvent aEventType, TQueryValidationStatus aStatus);
-		
-		TBool CheckIfEntryTextOk() const;
-		
-		void UpdateLeftSoftKeyL();
-	private:	
-		void ShowWarningNoteL();
-		
-	    /*
-	    * SetIncallBubbleAllowedInUsualL
-	    */
-	    void SetIncallBubbleAllowedInUsualL(TBool aAllowed);
-
-	private: // DATA	
-		TInt	iMinLength;
-		TInt	iMaxLength;
-		TInt	iMode;
-		TBool	iFront;
-		TInt	iAppKey;
-		TInt	iVoiceKey1;
-		TInt	iVoiceKey2;
-		TInt	iEndKey;
-		TBool   iIsRemoteLockQuery;
 	};
 #endif
 
--- a/secsrv_plat/security_code_ui_api/inc/SecUiSecurityHandler.h	Thu Aug 19 10:45:23 2010 +0300
+++ b/secsrv_plat/security_code_ui_api/inc/SecUiSecurityHandler.h	Tue Aug 31 16:04:40 2010 +0300
@@ -112,7 +112,15 @@
         */
         void RemoveSplashScreenL() const;
         
+        /**
+        *  ShowGenericErrorNoteL
+        */
         void ShowGenericErrorNoteL(TInt aStatus);
+        /**
+        *  CancelOpenQuery
+        */
+			TInt CancelOpenQuery(TInt aStatus);
+
 	private: // DATA
 		/*****************************************************
 		*	Series 60 Customer / ETel
--- a/secsrv_plat/security_code_ui_api/inc/SecUiSecuritySettings.h	Thu Aug 19 10:45:23 2010 +0300
+++ b/secsrv_plat/security_code_ui_api/inc/SecUiSecuritySettings.h	Tue Aug 31 16:04:40 2010 +0300
@@ -26,6 +26,9 @@
 #include <rmmcustomapi.h>
 #include <aknnotedialog.h>
 
+#define KSecUiAskNever 1
+#define KSecUiAskOnlyIfInvalid 2
+#define KSecUiAskAlways 3
 
 class CWait;
 class CSecurityHandler;
@@ -175,6 +178,27 @@
         
         TInt RemoteLockCodeQueryL( TDes& aRemoteLockCode );
         
+		/** 
+		* Same functions, taking parameters. This is used in QT because the Settings handles it.
+		*
+		* @param aOldPassword RMobilePhone::TMobilePassword  : current password, probably asked to the user by other means
+		* @param aNewPassword RMobilePhone::TMobilePassword  : current password, probably asked to the user by other means
+		* @param aFlags	 			TInt  : when to ask for the password
+		* @param aCaption			TDes& : caption to show in the dialog. If NULL, then the function will calculate it. If empty, it will be empty
+		* @param aShowError		TInt  : in case of error, it will show it. If this is not set, then no errors will be displayed.
+		* @return TInt: KErrNone (succesful) , KErrGsm0707IncorrectPassword, KErrAccessDenied, KErrGsmSSPasswordAttemptsViolation, KErrLocked, KErrGsm0707OperationNotAllowed, KErrAbort, KErrNotSupported, ...
+		*/
+		IMPORT_C TInt  ChangePinParamsL(RMobilePhone::TMobilePassword aOldPassword, RMobilePhone::TMobilePassword aNewPassword, TInt aFlags, TDes& aCaption, TInt aShowError);
+		IMPORT_C TInt  ChangeUPinParamsL(RMobilePhone::TMobilePassword aOldPassword, RMobilePhone::TMobilePassword aNewPassword, TInt aFlags, TDes& aCaption, TInt aShowError);
+		IMPORT_C TInt  ChangePin2ParamsL(RMobilePhone::TMobilePassword aOldPassword, RMobilePhone::TMobilePassword aNewPassword, TInt aFlags, TDes& aCaption, TInt aShowError);
+		IMPORT_C TInt  ChangeSecCodeParamsL(RMobilePhone::TMobilePassword aOldPassword, RMobilePhone::TMobilePassword aNewPassword, TInt aFlags, TDes& aCaption, TInt aShowError);
+		IMPORT_C TInt  ChangeAutoLockPeriodParamsL(TInt aPeriod, RMobilePhone::TMobilePassword aOldPassword, TInt aFlags, TDes& aCaption, TInt aShowError);
+		/* if aOldPassword is used, then try to verify.
+		KSecUiAskNever, KSecUiAskOnlyIfInvalid, KSecUiAskAlways
+		*/
+		IMPORT_C TInt  AskSecCodeParamsL(RMobilePhone::TMobilePassword &aOldPassword, TInt aFlags, TDes& aCaption, TInt aShowError);
+		IMPORT_C TInt  ChangePinRequestParamsL(TInt aEnable, RMobilePhone::TMobilePassword aOldPassword, TInt aFlags, TDes& aCaption, TInt aShowError);
+
     private:
     
         TInt RemoteLockSetLockSettingL( TBool aLockSetting );    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/Autolock.loc	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,13 @@
+// ============================================================================
+// * Generated by qmake (2.01a) (Qt 4.6.2) on: 2010-03-17T08:18:14
+// * This file is generated by qmake and should not be modified by the
+// * user.
+// ============================================================================
+
+#ifdef LANGUAGE_SC
+#define STRING_r_short_caption "Autolock"
+#define STRING_r_caption "Autolock"
+#else
+#define STRING_r_short_caption "Autolock"
+#define STRING_r_caption "Autolock"
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/Autolock.pro	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,70 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+# All rights reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, version 2.1 of the License.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program.  If not, 
+# see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
+#
+# Description:
+#
+
+TEMPLATE=app
+TARGET=Autolock
+
+CONFIG += service
+CONFIG += Hb
+
+CONFIG += mobility
+MOBILITY = publishsubscribe
+
+#TRANSLATIONS = autolock.ts
+
+XQSERVICE_ROOT=../..
+#include(../../xqservicebase.pri)
+include(src/Autolock.pri)
+
+LIBS+=-lxqservice -lxqserviceutil -lflogger
+LIBS += -L../../../../../bin/release -lautolockuseractivityservice
+LIBS += -lsecui -letelmm -letel -lcustomapi -lcentralrepository
+LIBS += -lcone -lws32 -lkeylockpolicyapi
+LIBS += -lpower_save_display_mode
+LIBS += -ltstaskmonitorclient		# for TsTaskSettings
+LIBS += -lavkon									# for KeySounds
+
+SERVICE.FILE = service_conf.xml
+SERVICE.OPTIONS = embeddable
+SERVICE.OPTIONS += hidden
+
+libFiles.sources = Autolock.exe 
+#libFiles.path = "!:\sys\bin"
+DEPLOYMENT += libFiles
+
+RESOURCES += Autolock.qrc
+
+symbian*: {
+				TARGET.CAPABILITY = CAP_APPLICATION
+				TARGET.UID3 = 0x100059B5
+				crmlFiles.sources = autolock.qcrml
+				crmlFiles.path = /resource/qt/crml
+				DEPLOYMENT += crmlFiles
+}
+
+BLD_INF_RULES.prj_exports += "./rom/Autolock.iby            CORE_APP_LAYER_IBY_EXPORT_PATH(Autolock.iby)"
+BLD_INF_RULES.prj_exports += "./conf/Autolock.confml        MW_LAYER_CONFML(Autolock.confml)"
+BLD_INF_RULES.prj_exports += "./conf/lock.confml        MW_LAYER_CONFML(lock.confml)"
+# remove CI_autolock.confml because CI already exports it
+# BLD_INF_RULES.prj_exports += "./conf/CI_Autolock.confml     MW_LAYER_CONFML(CI_Autolock.confml)"
+BLD_INF_RULES.prj_exports += "./rom/AutolockSrv.iby         CORE_APP_LAYER_IBY_EXPORT_PATH(AutolockSrv.iby)"
+BLD_INF_RULES.prj_exports += "./PubSub/SecurityUIsPrivatePSKeys.h |../../inc/securityuisprivatepskeys.h"
+
+BLD_INF_RULES.prj_exports += "./conf/lock_10283322.crml 	     MW_LAYER_CRML(lock_10283322.crml)"
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/Autolock.qrc	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,6 @@
+<RCC>
+    <qresource prefix="/Autolock_hbicon" >
+    <file alias="iconnotifier.svg">iconnotifier.svg</file>
+    <file alias="qtg_large_device_lock.svg">qtg_large_device_lock.svg</file>
+    </qresource>
+</RCC>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/Autolock.rss	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,21 @@
+// ============================================================================
+// * Generated by qmake (2.01a) (Qt 4.6.3) on: 2010-05-24T09:03:31
+// * This file is generated by qmake and should not be modified by the
+// * user.
+// ============================================================================
+
+#include <appinfo.rh>
+#include <Autolock.loc>
+
+RESOURCE LOCALISABLE_APP_INFO r_localisable_app_info
+	{
+	short_caption = STRING_r_short_caption;
+	caption_and_icon =
+	CAPTION_AND_ICON_INFO
+		{
+		caption = STRING_r_caption;
+		number_of_icons = 0;
+		icon_file = "";
+		};
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/Autolock_reg.rss	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,57 @@
+// ============================================================================
+// * Generated by qmake (2.01a) (Qt 4.6.3) on: 2010-05-19T16:00:27
+// * This file is generated by qmake and should not be modified by the
+// * user.
+// ============================================================================
+
+#include <Autolock.rsg>
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x100059B5
+
+
+
+/* xqsreg.exe fingerprint */
+#include <xqserviceipcconst.h>
+STRUCT SERVICE_CONFIGURATION {LTEXT xmldata;}
+STRUCT SERVICE_CONFIGURATION_ARRAY {STRUCT service_configuration_array[];}
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+
+	embeddability   = KAppEmbeddable;
+	hidden          = KAppIsHidden;
+	newfile         = KAppDoesNotSupportNewFile;
+	service_list =
+		{
+		SERVICE_INFO
+			{
+			uid = KXQServiceUid;
+			datatype_list = {};
+			opaque_data = r_service_configuration_reg;
+			}
+		};
+
+	app_file="Autolock";
+	localisable_resource_file="\\resource\\apps\\Autolock";
+
+	}
+
+
+RESOURCE SERVICE_CONFIGURATION_ARRAY r_service_configuration_reg
+	{
+		service_configuration_array=
+			{
+				SERVICE_CONFIGURATION
+				{
+				xmldata = "<?xml version=\"1.0\" encoding=\"utf-8\" ?> <service> <name>com.nokia.services.Autolock</name> <filepath>No path really</filepath> <description>Autolock</description> <interface> <name>Autolock</name> <version>2.0</version> <description>Interface";
+				}
+				,
+				SERVICE_CONFIGURATION
+				{
+				xmldata = " to Autolock</description> </interface> </service>";
+				}
+
+			};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/Autolock_reg.rss.back	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,57 @@
+// ============================================================================
+// * Generated by qmake (2.01a) (Qt 4.6.3) on: 2010-05-19T16:00:27
+// * This file is generated by qmake and should not be modified by the
+// * user.
+// ============================================================================
+
+#include <AutolockSrv.rsg>
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0xE0022E73
+
+
+
+/* xqsreg.exe fingerprint */
+#include <xqserviceipcconst.h>
+STRUCT SERVICE_CONFIGURATION {LTEXT xmldata;}
+STRUCT SERVICE_CONFIGURATION_ARRAY {STRUCT service_configuration_array[];}
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+
+	embeddability   = KAppEmbeddable;
+	hidden          = KAppIsHidden;
+	newfile         = KAppDoesNotSupportNewFile;
+	service_list =
+		{
+		SERVICE_INFO
+			{
+			uid = KXQServiceUid;
+			datatype_list = {};
+			opaque_data = r_service_configuration_reg;
+			}
+		};
+
+	app_file="AutolockSrv";
+	localisable_resource_file="\\resource\\apps\\AutolockSrv";
+
+	}
+
+
+RESOURCE SERVICE_CONFIGURATION_ARRAY r_service_configuration_reg
+	{
+		service_configuration_array=
+			{
+				SERVICE_CONFIGURATION
+				{
+				xmldata = "<?xml version=\"1.0\" encoding=\"utf-8\" ?> <service> <name>com.nokia.services.AutolockSrv</name> <filepath>No path really</filepath> <description>AutolockSrv</description> <interface> <name>AutolockSrv</name> <version>2.0</version> <description>Interface";
+				}
+				,
+				SERVICE_CONFIGURATION
+				{
+				xmldata = " to AutolockSrv</description> </interface> </service>";
+				}
+
+			};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/Autolock_template.pkg	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,39 @@
+; Autolock_template.pkg generated by qmake at 2010-05-24T09:03:30
+; This file is generated by qmake and should not be modified by the user
+;
+
+; Language
+&EN
+
+
+; SIS header: name, uid, version
+#{"Autolock"},(0x100059B5),1,0,0
+
+; Localised Vendor name
+%{"Vendor"}
+
+; Unique Vendor name
+:"Vendor"
+
+
+; Manual PKG pre-rules from PRO files
+; Default dependency to Qt libraries
+(0x2001E61C), 4, 6, 3, {"Qt"}
+; Default HW/platform dependencies
+[0x101F7961],0,0,0,{"S60ProductID"}
+[0x102032BE],0,0,0,{"S60ProductID"}
+[0x102752AE],0,0,0,{"S60ProductID"}
+[0x1028315F],0,0,0,{"S60ProductID"}
+ 
+; Default dependency to QtMobility libraries
+(0x2002AC89), 1, 0, 0, {"QtMobility"}
+
+; Executable and default resource files
+"/epoc32/release/$(PLATFORM)/$(TARGET)/Autolock.exe"    - "!:\sys\bin\Autolock.exe"
+"/epoc32/data/z/resource/apps/Autolock.rsc"    - "!:\resource\apps\Autolock.rsc"
+"/epoc32/data/z/private/10003a3f/import/apps/Autolock_reg.rsc"    - "!:\private\10003a3f\import\apps\Autolock_reg.rsc"
+; DEPLOYMENT
+"/epoc32/release/$(PLATFORM)/$(TARGET)/Autolock.exe"    - "!:\sys\bin\Autolock.exe"
+"/epoc32/data/z/resource/qt/crml/autolock.qcrml"    - "!:\resource\qt\crml\autolock.qcrml"
+
+; Manual PKG post-rules from PRO files
--- a/securitydialogs/Autolock/CenRep/AutolockPrivateCRKeys.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +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:  Autolock local variation Central Repository keys.
-*
-*/
-
-
-#ifndef AUTOLOCKPRIVATECRKEYS_H
-#define AUTOLOCKPRIVATECRKEYS_H
-
-// =============================================================================
-// Autolock Configuration API
-// =============================================================================
-const TUid KCRUidAutolockConf = { 0x102824AE };
-
-/**
-* Bitmask used in configuring automatic keylock.
-*/
-const TUint32 KAutoKeyLockConf = 0x00000001;
-
-// =============================================================================
-// Automatic Keylock Local Variation constants (KAutoKeyLockConf)
-// =============================================================================
-
-/** 
-* KAutolockFeatureIdFlipOpenDisabled is an on/off setting for 
-* disabling automatic keyguard locking when flip is open. By default off.
-* Possible values: 0 (locking enabled), 1 (locking diabled) <-- 
-*/
-const TInt KAutoKeylockFeatureIdFlipOpenDisabled= 0x01;  // 2^0
-
-#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/Keyguard_enabled.svg	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,1949 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://web.resource.org/cc/"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="128"
+   height="128"
+   id="svg2606"
+   sodipodi:version="0.32"
+   inkscape:version="0.45.1"
+   version="1.0"
+   sodipodi:docname="image-png.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   sodipodi:docbase="/home/pinheiro/pics/oxygen/scalable/mimetypes"
+   inkscape:export-filename="/home/pinheiro/artwork/Oxygen/David/imagesharperflaped.png"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  <defs
+     id="defs2608">
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4273"
+       id="linearGradient6204"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.811924,0,0,0.273245,55.77949,-173.6434)"
+       x1="105.41402"
+       y1="673.69873"
+       x2="274.53336"
+       y2="691.37091" />
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient31860">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop31862" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop31864" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4526"
+       id="linearGradient4670"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.616893,0,0,0.359632,55.77949,-173.6434)"
+       x1="322.5351"
+       y1="671.36499"
+       x2="305.54623"
+       y2="703.1059" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4526"
+       id="linearGradient4668"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.544849,0,0,0.407185,55.77949,-173.6434)"
+       x1="388.85477"
+       y1="581.20758"
+       x2="355.6568"
+       y2="561.59204" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4526"
+       id="linearGradient4666"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.544849,0,0,0.407185,55.77949,-173.6434)"
+       x1="391.99573"
+       y1="490.36765"
+       x2="343.76462"
+       y2="472.65836" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4526"
+       id="linearGradient4664"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.414913,0,0,0.534701,55.77949,-173.6434)"
+       x1="336.97562"
+       y1="514.06415"
+       x2="402.90091"
+       y2="491.13419" />
+    <linearGradient
+       id="linearGradient2797">
+      <stop
+         style="stop-color:#000000;stop-opacity:1.0000000;"
+         offset="0.0000000"
+         id="stop2799" />
+      <stop
+         style="stop-color:#484848;stop-opacity:1.0000000;"
+         offset="1.0000000"
+         id="stop2801" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2797"
+       id="linearGradient4662"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.470374,0,0,0.471655,55.77949,-173.6434)"
+       x1="313.85675"
+       y1="561.1123"
+       x2="355.78586"
+       y2="553.29712" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4526"
+       id="linearGradient4660"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.616893,0,0,0.359632,55.77949,-173.6434)"
+       x1="306.2883"
+       y1="672.46191"
+       x2="333.49854"
+       y2="707.75031" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4526"
+       id="linearGradient4658"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.544849,0,0,0.407185,55.77949,-173.6434)"
+       x1="391.99573"
+       y1="490.36765"
+       x2="343.76462"
+       y2="472.65836" />
+    <linearGradient
+       id="linearGradient4526">
+      <stop
+         id="stop4528"
+         offset="0.0000000"
+         style="stop-color:#ffffff;stop-opacity:0.69902915;" />
+      <stop
+         id="stop4530"
+         offset="1.0000000"
+         style="stop-color:#ffffff;stop-opacity:0.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4526"
+       id="linearGradient4656"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.544849,0,0,0.407185,55.77949,-173.6434)"
+       x1="388.85477"
+       y1="581.20758"
+       x2="355.6568"
+       y2="561.59204" />
+    <linearGradient
+       id="linearGradient4255"
+       inkscape:collect="always">
+      <stop
+         id="stop4257"
+         offset="0"
+         style="stop-color:#000000;stop-opacity:1;" />
+      <stop
+         id="stop4259"
+         offset="1"
+         style="stop-color:#000000;stop-opacity:0;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4255"
+       id="linearGradient4654"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.44753,0,0,0.49573,55.77949,-173.6434)"
+       x1="390.90793"
+       y1="442.95132"
+       x2="419.73016"
+       y2="470.11917" />
+    <linearGradient
+       id="linearGradient4516">
+      <stop
+         id="stop4518"
+         offset="0"
+         style="stop-color:#62004f;stop-opacity:1;" />
+      <stop
+         style="stop-color:#8d2778;stop-opacity:1;"
+         offset="0.14563107"
+         id="stop7294" />
+      <stop
+         id="stop4520"
+         offset="1"
+         style="stop-color:#ff00bf;stop-opacity:1;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4516"
+       id="linearGradient4652"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.480452,0,0,0.461761,55.77949,-173.6434)"
+       x1="299.42841"
+       y1="480.61096"
+       x2="419.73056"
+       y2="503.82071" />
+    <linearGradient
+       id="linearGradient2373">
+      <stop
+         id="stop2375"
+         offset="0.0000000"
+         style="stop-color:#083e20;stop-opacity:1.0000000;" />
+      <stop
+         id="stop2377"
+         offset="1.0000000"
+         style="stop-color:#245e3e;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2373"
+       id="linearGradient4650"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.852829,0,0,1.172568,-0.505078,0.252536)"
+       x1="249.71024"
+       y1="470.67639"
+       x2="268.70541"
+       y2="444.59937" />
+    <linearGradient
+       id="linearGradient2367">
+      <stop
+         id="stop2369"
+         offset="0.0000000"
+         style="stop-color:#957d16;stop-opacity:1.0000000;" />
+      <stop
+         id="stop2371"
+         offset="1.0000000"
+         style="stop-color:#927b16;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2367"
+       id="linearGradient4648"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(0.852829,1.172568)"
+       x1="249.71024"
+       y1="470.67639"
+       x2="268.70541"
+       y2="444.59937" />
+    <linearGradient
+       id="linearGradient2330">
+      <stop
+         id="stop2332"
+         offset="0.0000000"
+         style="stop-color:#54250d;stop-opacity:1.0000000;" />
+      <stop
+         id="stop2344"
+         offset="1.0000000"
+         style="stop-color:#9f4f19;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2330"
+       id="linearGradient4646"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.852829,0,0,1.172568,-4.61104,-5.494924)"
+       x1="249.71024"
+       y1="470.67639"
+       x2="268.70541"
+       y2="444.59937" />
+    <linearGradient
+       id="linearGradient2307">
+      <stop
+         id="stop2309"
+         offset="0"
+         style="stop-color:#8a1e51;stop-opacity:1;" />
+      <stop
+         id="stop2311"
+         offset="1.0000000"
+         style="stop-color:#7e1b4a;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2307"
+       id="linearGradient4644"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(0.852829,1.172568)"
+       x1="249.71024"
+       y1="470.67639"
+       x2="285.55072"
+       y2="455.34595" />
+    <linearGradient
+       id="linearGradient4498">
+      <stop
+         id="stop4500"
+         offset="0.0000000"
+         style="stop-color:#1a3b23;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4510"
+         offset="0.34000000"
+         style="stop-color:#255431;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4508"
+         offset="0.42000002"
+         style="stop-color:#306d40;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4506"
+         offset="0.62000000"
+         style="stop-color:#58c977;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4504"
+         offset="0.63999999"
+         style="stop-color:#2f6a3f;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4502"
+         offset="1.0000000"
+         style="stop-color:#86ffa7;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4498"
+       id="linearGradient4642"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.402062,0,0,0.551792,55.77949,-173.6434)"
+       x1="410.68747"
+       y1="351.94495"
+       x2="496.01123"
+       y2="446.42474" />
+    <linearGradient
+       id="linearGradient4472">
+      <stop
+         id="stop4474"
+         offset="0.0000000"
+         style="stop-color:#6a5000;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4486"
+         offset="0.36499998"
+         style="stop-color:#b49b1d;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4484"
+         offset="0.47000000"
+         style="stop-color:#ffe63b;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4480"
+         offset="0.62000000"
+         style="stop-color:#fde55f;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4482"
+         offset="0.65999997"
+         style="stop-color:#af8800;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4476"
+         offset="1.0000000"
+         style="stop-color:#fcff96;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4472"
+       id="linearGradient4640"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.410011,0,0,0.541094,55.77949,-173.6434)"
+       x1="407.20193"
+       y1="340.1315"
+       x2="509.36542"
+       y2="443.40552" />
+    <linearGradient
+       id="linearGradient4440">
+      <stop
+         id="stop4442"
+         offset="0.0000000"
+         style="stop-color:#7c2b00;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4458"
+         offset="0.35250002"
+         style="stop-color:#a56116;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4456"
+         offset="0.42500001"
+         style="stop-color:#cf982c;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4452"
+         offset="0.61000001"
+         style="stop-color:#ffdb59;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4448"
+         offset="0.63999999"
+         style="stop-color:#d07100;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4444"
+         offset="1.0000000"
+         style="stop-color:#fff77c;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4440"
+       id="linearGradient4638"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.395673,0,0,0.560701,55.96081,-173.4701)"
+       x1="426.25494"
+       y1="315.43689"
+       x2="542.82642"
+       y2="426.81122" />
+    <linearGradient
+       id="linearGradient4402">
+      <stop
+         id="stop4404"
+         offset="0.0000000"
+         style="stop-color:#540d0d;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4462"
+         offset="0.34999999"
+         style="stop-color:#7e2316;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4460"
+         offset="0.43000001"
+         style="stop-color:#a93a1f;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4410"
+         offset="0.62000000"
+         style="stop-color:#ff6731;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4412"
+         offset="0.66000003"
+         style="stop-color:#9f2819;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4436"
+         offset="0.77000004"
+         style="stop-color:#e1734d;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4406"
+         offset="1.0000000"
+         style="stop-color:#ffb47c;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4402"
+       id="linearGradient4636"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.400366,0,0,0.554129,55.74058,-173.7136)"
+       x1="438.62411"
+       y1="302.29001"
+       x2="560.68457"
+       y2="400.81851" />
+    <linearGradient
+       id="linearGradient4352">
+      <stop
+         id="stop4354"
+         offset="0.0000000"
+         style="stop-color:#833c0b;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4356"
+         offset="1.0000000"
+         style="stop-color:#723409;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4352"
+       id="linearGradient4633"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.476543,0,0,0.46555,55.77949,-173.6434)"
+       x1="178.40228"
+       y1="433.92719"
+       x2="274.36346"
+       y2="433.92719" />
+    <linearGradient
+       id="linearGradient4392">
+      <stop
+         id="stop4394"
+         offset="0.0000000"
+         style="stop-color:#214b2c;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4396"
+         offset="1.0000000"
+         style="stop-color:#1a3b23;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4392"
+       id="linearGradient4631"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.534168,0,0,0.415327,55.82726,-173.6161)"
+       x1="170.54399"
+       y1="569.89191"
+       x2="233.7466"
+       y2="533.10059" />
+    <linearGradient
+       id="linearGradient4360">
+      <stop
+         id="stop4362"
+         offset="0"
+         style="stop-color:#83190b;stop-opacity:1;" />
+      <stop
+         id="stop4364"
+         offset="1.0000000"
+         style="stop-color:#721509;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4360"
+       id="linearGradient4629"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.465924,0,0,0.47616,55.77949,-173.6434)"
+       x1="177.6402"
+       y1="411.45197"
+       x2="275.48526"
+       y2="411.45197" />
+    <linearGradient
+       id="linearGradient4382">
+      <stop
+         id="stop4384"
+         offset="0.0000000"
+         style="stop-color:#7e5c08;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4386"
+         offset="1.0000000"
+         style="stop-color:#6e4b11;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4382"
+       id="linearGradient4627"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.484895,0,0,0.457531,55.82726,-173.6161)"
+       x1="185.36516"
+       y1="498.74353"
+       x2="246.5347"
+       y2="442.2757" />
+    <linearGradient
+       id="linearGradient4321">
+      <stop
+         id="stop4323"
+         offset="0.0000000"
+         style="stop-color:#b20033;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4337"
+         offset="0.46000001"
+         style="stop-color:#ff7cba;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4339"
+         offset="0.55000001"
+         style="stop-color:#9c225b;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4325"
+         offset="1.0000000"
+         style="stop-color:#ff7ca1;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4321"
+       id="linearGradient4625"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.310584,0,0,0.714313,55.77949,-173.6434)"
+       x1="683.10022"
+       y1="231.87573"
+       x2="720.63422"
+       y2="271.91464" />
+    <linearGradient
+       id="linearGradient4368">
+      <stop
+         id="stop4370"
+         offset="0"
+         style="stop-color:#8a1e51;stop-opacity:1;" />
+      <stop
+         id="stop4372"
+         offset="1.0000000"
+         style="stop-color:#7e1b4a;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4368"
+       id="linearGradient4623"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.441119,0,0,0.502935,55.77949,-173.6434)"
+       x1="185.72665"
+       y1="378.45386"
+       x2="266.98257"
+       y2="378.45386" />
+    <linearGradient
+       id="linearGradient4273">
+      <stop
+         id="stop4275"
+         offset="0.0000000"
+         style="stop-color:#590012;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4466"
+         offset="0.93000001"
+         style="stop-color:#a3211f;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4468"
+         offset="0.94000000"
+         style="stop-color:#650014;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4277"
+         offset="1.0000000"
+         style="stop-color:#ee6c68;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4273"
+       id="linearGradient4621"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.811924,0,0,0.273245,55.77949,-173.6434)"
+       x1="105.41402"
+       y1="673.69873"
+       x2="274.53336"
+       y2="691.37091" />
+    <linearGradient
+       id="linearGradient2441">
+      <stop
+         id="stop2443"
+         offset="0.0000000"
+         style="stop-color:#b0e9c0;stop-opacity:1.0000000;" />
+      <stop
+         id="stop2445"
+         offset="1.0000000"
+         style="stop-color:#75df92;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2441"
+       id="linearGradient4619"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(0.852829,1.172568)"
+       x1="273.20914"
+       y1="455.33145"
+       x2="276.42776"
+       y2="474.10953" />
+    <linearGradient
+       id="linearGradient2447">
+      <stop
+         id="stop2449"
+         offset="0.0000000"
+         style="stop-color:#ffd625;stop-opacity:1.0000000;" />
+      <stop
+         id="stop2451"
+         offset="1.0000000"
+         style="stop-color:#fff0ab;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2447"
+       id="linearGradient4617"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(0.852829,1.172568)"
+       x1="269.87866"
+       y1="468.31586"
+       x2="274.6358"
+       y2="450.71976" />
+    <linearGradient
+       id="linearGradient2453">
+      <stop
+         id="stop2455"
+         offset="0.0000000"
+         style="stop-color:#f6b94e;stop-opacity:1.0000000;" />
+      <stop
+         id="stop2457"
+         offset="1.0000000"
+         style="stop-color:#ffc340;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2453"
+       id="linearGradient4615"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(0.852829,1.172568)"
+       x1="262.95721"
+       y1="463.82385"
+       x2="271.31601"
+       y2="446.71695" />
+    <linearGradient
+       id="linearGradient2463">
+      <stop
+         id="stop2465"
+         offset="0.0000000"
+         style="stop-color:#fda5cf;stop-opacity:1.0000000;" />
+      <stop
+         id="stop2467"
+         offset="1.0000000"
+         style="stop-color:#ce2c79;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2463"
+       id="linearGradient4613"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(0.852829,1.172568)"
+       x1="258.13016"
+       y1="442.66943"
+       x2="247.02499"
+       y2="456.03308" />
+    <linearGradient
+       id="linearGradient2469">
+      <stop
+         id="stop2471"
+         offset="0.0000000"
+         style="stop-color:#f6754e;stop-opacity:1.0000000;" />
+      <stop
+         id="stop2473"
+         offset="1.0000000"
+         style="stop-color:#ffa879;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2469"
+       id="linearGradient4611"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.852829,0,0,1.172568,-12.28101,22.44028)"
+       x1="257.99484"
+       y1="431.38104"
+       x2="274.71591"
+       y2="420.00296" />
+    <linearGradient
+       id="linearGradient2785">
+      <stop
+         style="stop-color:#000000;stop-opacity:0.0000000;"
+         offset="0.0000000"
+         id="stop2787" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0.49803922;"
+         offset="0.36000001"
+         id="stop2793" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop2789" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2785"
+       id="linearGradient4609"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.453732,0,0,0.488954,57.57699,-173.4241)"
+       x1="277.5726"
+       y1="521.61127"
+       x2="316.56882"
+       y2="527.43481" />
+    <linearGradient
+       id="linearGradient2713">
+      <stop
+         id="stop2715"
+         offset="0.0000000"
+         style="stop-color:#b20033;stop-opacity:1.0000000;" />
+      <stop
+         id="stop2721"
+         offset="1.0000000"
+         style="stop-color:#ffe77c;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2713"
+       id="linearGradient4607"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(0.625932,1.597617)"
+       x1="542.85187"
+       y1="330.59"
+       x2="554.73236"
+       y2="359.37115" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2823"
+       id="linearGradient4605"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(1.121629,0.891561)"
+       x1="229.5614"
+       y1="692.33807"
+       x2="276.19287"
+       y2="715.24652" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2823"
+       id="linearGradient4603"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(1.121629,0.891561)"
+       x1="229.5614"
+       y1="692.33807"
+       x2="276.19287"
+       y2="715.24652" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2823"
+       id="linearGradient4601"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(1.121629,0.891561)"
+       x1="229.5614"
+       y1="692.33807"
+       x2="276.19287"
+       y2="715.24652" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2823"
+       id="linearGradient4599"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(1.121629,0.891561)"
+       x1="229.5614"
+       y1="692.33807"
+       x2="276.19287"
+       y2="715.24652" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2823"
+       id="linearGradient4597"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(1.121629,0.891561)"
+       x1="229.5614"
+       y1="692.33807"
+       x2="276.19287"
+       y2="715.24652" />
+    <linearGradient
+       id="linearGradient2823">
+      <stop
+         style="stop-color:#4d3719;stop-opacity:1;"
+         offset="0"
+         id="stop2825" />
+      <stop
+         style="stop-color:#ddae66;stop-opacity:1;"
+         offset="0.69999999"
+         id="stop2866" />
+      <stop
+         style="stop-color:#b2731c;stop-opacity:1;"
+         offset="1"
+         id="stop2827" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2823"
+       id="linearGradient4595"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(1.121629,0.891561)"
+       x1="261.13171"
+       y1="710.77112"
+       x2="267.06235"
+       y2="710.77136" />
+    <linearGradient
+       id="linearGradient3185">
+      <stop
+         id="stop3187"
+         offset="0"
+         style="stop-color:#50a3f7;stop-opacity:1;" />
+      <stop
+         id="stop3189"
+         offset="1"
+         style="stop-color:#002ea8;stop-opacity:1;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3185"
+       id="linearGradient5341"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.3457951,0,0,2.1229785,538.33426,-11.05243)"
+       x1="-263.28992"
+       y1="56.713814"
+       x2="-263.14236"
+       y2="8.8705559" />
+    <linearGradient
+       id="linearGradient10207">
+      <stop
+         style="stop-color:#a2a2a2;stop-opacity:1;"
+         offset="0"
+         id="stop10209" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="1"
+         id="stop10211" />
+    </linearGradient>
+    <linearGradient
+       id="XMLID_12_"
+       gradientUnits="userSpaceOnUse"
+       x1="96"
+       y1="104"
+       x2="88.000198"
+       y2="96.000198">
+      <stop
+         offset="0"
+         style="stop-color:#888A85"
+         id="stop83" />
+      <stop
+         offset="0.0072"
+         style="stop-color:#8C8E89"
+         id="stop85" />
+      <stop
+         offset="0.0673"
+         style="stop-color:#ABACA9"
+         id="stop87" />
+      <stop
+         offset="0.1347"
+         style="stop-color:#C5C6C4"
+         id="stop89" />
+      <stop
+         offset="0.2652576"
+         style="stop-color:#DBDBDA"
+         id="stop91" />
+      <stop
+         offset="0.37646064"
+         style="stop-color:#EBEBEB"
+         id="stop93" />
+      <stop
+         offset="0.48740286"
+         style="stop-color:#F7F7F6"
+         id="stop95" />
+      <stop
+         offset="0.6324091"
+         style="stop-color:#FDFDFD"
+         id="stop97" />
+      <stop
+         offset="1"
+         style="stop-color:#FFFFFF"
+         id="stop99" />
+    </linearGradient>
+    <radialGradient
+       id="XMLID_8_"
+       cx="102"
+       cy="112.3047"
+       r="139.55859"
+       gradientUnits="userSpaceOnUse">
+      <stop
+         offset="0"
+         style="stop-color:#b7b8b9;stop-opacity:1;"
+         id="stop41" />
+      <stop
+         offset="0.18851049"
+         style="stop-color:#ECECEC"
+         id="stop47" />
+      <stop
+         offset="0.25718147"
+         style="stop-color:#FAFAFA"
+         id="stop49" />
+      <stop
+         offset="0.30111277"
+         style="stop-color:#FFFFFF"
+         id="stop51" />
+      <stop
+         offset="0.5313"
+         style="stop-color:#FAFAFA"
+         id="stop53" />
+      <stop
+         offset="0.8449"
+         style="stop-color:#EBECEC"
+         id="stop55" />
+      <stop
+         offset="1"
+         style="stop-color:#E1E2E3"
+         id="stop57" />
+    </radialGradient>
+    <filter
+       inkscape:collect="always"
+       x="-0.19200002"
+       width="1.3839999"
+       y="-0.19199999"
+       height="1.3839999"
+       id="filter6697">
+      <feGaussianBlur
+         inkscape:collect="always"
+         stdDeviation="1.9447689"
+         id="feGaussianBlur6699" />
+    </filter>
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath7084">
+      <path
+         style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+         d="M 72,88 L 40,120 L 32,120 L 32,80 L 72,80 L 72,88 z"
+         id="path7086" />
+    </clipPath>
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#XMLID_8_"
+       id="radialGradient9437"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1,0,0,0.9996653,-7.999998,16.003016)"
+       cx="114"
+       cy="95.028786"
+       r="139.55859"
+       fx="114"
+       fy="95.028786" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10207"
+       id="linearGradient10213"
+       x1="98.617439"
+       y1="106.41443"
+       x2="91.228737"
+       y2="99.254974"
+       gradientUnits="userSpaceOnUse" />
+    <filter
+       inkscape:collect="always"
+       id="filter2770">
+      <feGaussianBlur
+         inkscape:collect="always"
+         stdDeviation="2.0786429"
+         id="feGaussianBlur2772" />
+    </filter>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3185"
+       id="linearGradient4882"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.3457951,0,0,2.1229785,538.33426,-11.05243)"
+       x1="-263.14236"
+       y1="72.386543"
+       x2="-263.14236"
+       y2="-21.190172" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2823"
+       id="linearGradient4884"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(1.121629,0.891561)"
+       x1="261.13171"
+       y1="710.77112"
+       x2="267.06235"
+       y2="710.77136" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2823"
+       id="linearGradient4886"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(1.121629,0.891561)"
+       x1="229.5614"
+       y1="692.33807"
+       x2="276.19287"
+       y2="715.24652" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2823"
+       id="linearGradient4888"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(1.121629,0.891561)"
+       x1="229.5614"
+       y1="692.33807"
+       x2="276.19287"
+       y2="715.24652" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2823"
+       id="linearGradient4890"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(1.121629,0.891561)"
+       x1="229.5614"
+       y1="692.33807"
+       x2="276.19287"
+       y2="715.24652" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2823"
+       id="linearGradient4892"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(1.121629,0.891561)"
+       x1="229.5614"
+       y1="692.33807"
+       x2="276.19287"
+       y2="715.24652" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2823"
+       id="linearGradient4894"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(1.121629,0.891561)"
+       x1="229.5614"
+       y1="692.33807"
+       x2="276.19287"
+       y2="715.24652" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2713"
+       id="linearGradient4896"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(0.625932,1.597617)"
+       x1="542.85187"
+       y1="330.59"
+       x2="554.73236"
+       y2="359.37115" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2785"
+       id="linearGradient4898"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.453732,0,0,0.488954,57.57699,-173.4241)"
+       x1="277.5726"
+       y1="521.61127"
+       x2="316.56882"
+       y2="527.43481" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2469"
+       id="linearGradient4900"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.852829,0,0,1.172568,-12.28101,22.44028)"
+       x1="257.99484"
+       y1="431.38104"
+       x2="274.71591"
+       y2="420.00296" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2463"
+       id="linearGradient4902"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(0.852829,1.172568)"
+       x1="258.13016"
+       y1="442.66943"
+       x2="247.02499"
+       y2="456.03308" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2453"
+       id="linearGradient4904"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(0.852829,1.172568)"
+       x1="262.95721"
+       y1="463.82385"
+       x2="271.31601"
+       y2="446.71695" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2447"
+       id="linearGradient4906"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(0.852829,1.172568)"
+       x1="269.87866"
+       y1="468.31586"
+       x2="274.6358"
+       y2="450.71976" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2441"
+       id="linearGradient4908"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(0.852829,1.172568)"
+       x1="273.20914"
+       y1="455.33145"
+       x2="276.42776"
+       y2="474.10953" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4273"
+       id="linearGradient4910"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.811924,0,0,0.273245,55.77949,-173.6434)"
+       x1="105.41402"
+       y1="673.69873"
+       x2="274.53336"
+       y2="691.37091" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4368"
+       id="linearGradient4912"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.441119,0,0,0.502935,55.77949,-173.6434)"
+       x1="185.72665"
+       y1="378.45386"
+       x2="266.98257"
+       y2="378.45386" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4321"
+       id="linearGradient4914"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.310584,0,0,0.714313,55.77949,-173.6434)"
+       x1="683.10022"
+       y1="231.87573"
+       x2="720.63422"
+       y2="271.91464" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4382"
+       id="linearGradient4916"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.484895,0,0,0.457531,55.82726,-173.6161)"
+       x1="185.36516"
+       y1="498.74353"
+       x2="246.5347"
+       y2="442.2757" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4360"
+       id="linearGradient4918"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.465924,0,0,0.47616,55.77949,-173.6434)"
+       x1="177.6402"
+       y1="411.45197"
+       x2="275.48526"
+       y2="411.45197" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4392"
+       id="linearGradient4920"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.534168,0,0,0.415327,55.82726,-173.6161)"
+       x1="170.54399"
+       y1="569.89191"
+       x2="233.7466"
+       y2="533.10059" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4352"
+       id="linearGradient4922"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.476543,0,0,0.46555,55.77949,-173.6434)"
+       x1="178.40228"
+       y1="433.92719"
+       x2="274.36346"
+       y2="433.92719" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4402"
+       id="linearGradient4924"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.400366,0,0,0.554129,55.74058,-173.7136)"
+       x1="438.62411"
+       y1="302.29001"
+       x2="560.68457"
+       y2="400.81851" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4440"
+       id="linearGradient4926"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.395673,0,0,0.560701,55.96081,-173.4701)"
+       x1="426.25494"
+       y1="315.43689"
+       x2="542.82642"
+       y2="426.81122" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4472"
+       id="linearGradient4928"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.410011,0,0,0.541094,55.77949,-173.6434)"
+       x1="407.20193"
+       y1="340.1315"
+       x2="509.36542"
+       y2="443.40552" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4498"
+       id="linearGradient4930"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.402062,0,0,0.551792,55.77949,-173.6434)"
+       x1="410.68747"
+       y1="351.94495"
+       x2="496.01123"
+       y2="446.42474" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2307"
+       id="linearGradient4932"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(0.852829,1.172568)"
+       x1="249.71024"
+       y1="470.67639"
+       x2="285.55072"
+       y2="455.34595" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2330"
+       id="linearGradient4934"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.852829,0,0,1.172568,-4.61104,-5.494924)"
+       x1="249.71024"
+       y1="470.67639"
+       x2="268.70541"
+       y2="444.59937" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2367"
+       id="linearGradient4936"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(0.852829,1.172568)"
+       x1="249.71024"
+       y1="470.67639"
+       x2="268.70541"
+       y2="444.59937" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2373"
+       id="linearGradient4938"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.852829,0,0,1.172568,-0.505078,0.252536)"
+       x1="249.71024"
+       y1="470.67639"
+       x2="268.70541"
+       y2="444.59937" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4516"
+       id="linearGradient4940"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.480452,0,0,0.461761,55.77949,-173.6434)"
+       x1="299.42841"
+       y1="480.61096"
+       x2="419.73056"
+       y2="503.82071" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4255"
+       id="linearGradient4942"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.44753,0,0,0.49573,55.77949,-173.6434)"
+       x1="390.90793"
+       y1="442.95132"
+       x2="419.73016"
+       y2="470.11917" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4526"
+       id="linearGradient4944"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.544849,0,0,0.407185,55.77949,-173.6434)"
+       x1="388.85477"
+       y1="581.20758"
+       x2="355.6568"
+       y2="561.59204" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4526"
+       id="linearGradient4946"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.544849,0,0,0.407185,55.77949,-173.6434)"
+       x1="391.99573"
+       y1="490.36765"
+       x2="343.76462"
+       y2="472.65836" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4526"
+       id="linearGradient4948"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.616893,0,0,0.359632,55.77949,-173.6434)"
+       x1="306.2883"
+       y1="672.46191"
+       x2="333.49854"
+       y2="707.75031" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2797"
+       id="linearGradient4950"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.470374,0,0,0.471655,55.77949,-173.6434)"
+       x1="313.85675"
+       y1="561.1123"
+       x2="355.78586"
+       y2="553.29712" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4526"
+       id="linearGradient4952"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.414913,0,0,0.534701,55.77949,-173.6434)"
+       x1="336.97562"
+       y1="514.06415"
+       x2="402.90091"
+       y2="491.13419" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4526"
+       id="linearGradient4954"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.544849,0,0,0.407185,55.77949,-173.6434)"
+       x1="391.99573"
+       y1="490.36765"
+       x2="343.76462"
+       y2="472.65836" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4526"
+       id="linearGradient4956"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.544849,0,0,0.407185,55.77949,-173.6434)"
+       x1="388.85477"
+       y1="581.20758"
+       x2="355.6568"
+       y2="561.59204" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4526"
+       id="linearGradient4958"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.616893,0,0,0.359632,55.77949,-173.6434)"
+       x1="322.5351"
+       y1="671.36499"
+       x2="305.54623"
+       y2="703.1059" />
+    <linearGradient
+       y2="154.50412"
+       x2="210.98608"
+       y1="154.50412"
+       x1="155.21127"
+       gradientTransform="matrix(0.9295551,0,0,0.9288601,-84.40008,12.847771)"
+       gradientUnits="userSpaceOnUse"
+       id="linearGradient9061"
+       xlink:href="#linearGradient6001"
+       inkscape:collect="always" />
+    <linearGradient
+       y2="167.16171"
+       x2="83.742836"
+       y1="154.27817"
+       x1="82.802177"
+       gradientTransform="matrix(0.6260112,0,0,0.2001745,68.175377,138.95724)"
+       gradientUnits="userSpaceOnUse"
+       id="linearGradient8903"
+       xlink:href="#linearGradient3426"
+       inkscape:collect="always" />
+    <linearGradient
+       id="linearGradient3134">
+      <stop
+         id="stop3136"
+         offset="0"
+         style="stop-color:#ffd500;stop-opacity:1;" />
+      <stop
+         id="stop3138"
+         offset="1"
+         style="stop-color:#ff7e00;stop-opacity:1;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient3146">
+      <stop
+         id="stop3148"
+         offset="0"
+         style="stop-color:#ff7e00;stop-opacity:1;" />
+      <stop
+         id="stop3150"
+         offset="1"
+         style="stop-color:#ffd500;stop-opacity:1;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient3158">
+      <stop
+         id="stop3160"
+         offset="0"
+         style="stop-color:#fff8de;stop-opacity:1;" />
+      <stop
+         id="stop3162"
+         offset="1"
+         style="stop-color:#ffff00;stop-opacity:1;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient3426"
+       inkscape:collect="always">
+      <stop
+         id="stop3428"
+         offset="0"
+         style="stop-color:#555555;stop-opacity:1;" />
+      <stop
+         id="stop3430"
+         offset="1"
+         style="stop-color:#555555;stop-opacity:0;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient6001"
+       inkscape:collect="always">
+      <stop
+         id="stop6003"
+         offset="0"
+         style="stop-color:#000000;stop-opacity:1;" />
+      <stop
+         id="stop6005"
+         offset="1"
+         style="stop-color:#000000;stop-opacity:0;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient7545">
+      <stop
+         id="stop7547"
+         offset="0"
+         style="stop-color:#323232;stop-opacity:1;" />
+      <stop
+         id="stop7549"
+         offset="1"
+         style="stop-color:#101010;stop-opacity:1;" />
+    </linearGradient>
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath4318">
+      <path
+         style="opacity:0.48888891;fill:#f9f2ea;fill-opacity:1;stroke:none;stroke-width:0.1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+         d="M 1.954599,2.1834159 L 1.954599,187.15135 L 256.71404,187.15135 L 256.71404,2.1834159 L 1.954599,2.1834159 z "
+         id="path4320" />
+    </clipPath>
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath31854">
+      <path
+         style="opacity:0.48888891;fill:#f9f2ea;fill-opacity:1;stroke:none;stroke-width:0.1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+         d="M 12,28 L 12,108 L 92.5,108 L 116,82.75 L 116,28 L 12,28 z "
+         id="path31856"
+         sodipodi:nodetypes="cccccc" />
+    </clipPath>
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient31860"
+       id="radialGradient31866"
+       cx="101.5"
+       cy="92.997192"
+       fx="101.5"
+       fy="92.997192"
+       r="21.5"
+       gradientTransform="matrix(0.7247027,0.6890616,-0.6744186,0.7093023,90.661709,-42.65288)"
+       gradientUnits="userSpaceOnUse" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient6001"
+       id="linearGradient8360"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.4103611,0,0,0.4330773,-28.25306,27.952127)"
+       x1="121.40629"
+       y1="177.05572"
+       x2="177.1811"
+       y2="177.05572" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="1"
+     inkscape:cx="-126.82503"
+     inkscape:cy="44.445553"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     width="128px"
+     height="128px"
+     gridspacingx="4px"
+     gridspacingy="4px"
+     gridempspacing="2"
+     showgrid="true"
+     inkscape:grid-points="true"
+     showguides="true"
+     inkscape:guide-bbox="true"
+     inkscape:window-width="1016"
+     inkscape:window-height="692"
+     inkscape:window-x="351"
+     inkscape:window-y="46"
+     showborder="true">
+    <sodipodi:guide
+       orientation="horizontal"
+       position="40.875"
+       id="guide5004" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata2611">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Livello 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <path
+       style="opacity:0.5;fill:#000000;fill-opacity:1;filter:url(#filter2770)"
+       d="M 16,8 L 16,96.626087 C 16,96.626087 94.51625,96.626087 94.51625,96.626087 L 94.5475,96.626087 C 94.547503,96.626087 106.45375,86.719837 111.95375,81.219837 C 117.45375,75.719837 127.36,63.813587 127.36,63.813587 L 127.36,63.782337 L 127.36,8 L 16,8 z "
+       id="path7865"
+       sodipodi:nodetypes="csccscccc"
+       transform="matrix(1.0416667,0,0,1.0267857,-10.666667,14.785711)" />
+    <path
+       style="fill:#ffffff;fill-opacity:1"
+       d="M 8.000001,24 L 8,112 C 8,112 87.146418,112 87.146418,112 L 120,79.14642 L 120,24 L 8.000001,24 z "
+       id="path34"
+       sodipodi:nodetypes="cccccc" />
+    <path
+       style="fill:url(#radialGradient9437);fill-opacity:1"
+       d="M 10.000002,25.000003 C 9.449002,25.000003 9.000002,25.448853 9.000002,25.999668 L 9.000002,109.96352 C 9.000002,110.51533 9.449002,110.96318 10.000002,110.96318 L 85.171999,110.96318 C 85.434999,110.96318 87.934679,111.08131 88.12068,110.89438 L 118.707,80.094202 C 118.894,79.907264 119,77.40942 119,77.146508 L 119,25.999668 C 119,25.448853 118.552,25.000003 118,25.000003 L 10.000002,25.000003 z "
+       id="path59"
+       sodipodi:nodetypes="ccccccccccc" />
+    <g
+       id="g4805"
+       transform="matrix(0.9166667,0,0,0.9166667,-112.66667,13.33333)">
+      <path
+         sodipodi:nodetypes="cccccc"
+         id="rect3183"
+         d="M 136,16 L 249.45454,16 L 249.45454,78.40711 L 223.14295,103.27273 L 136,103.27273 L 136,16 z "
+         style="fill:url(#linearGradient4882);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.20000005;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dashoffset:4;stroke-opacity:1" />
+      <g
+         transform="matrix(0.5620693,0,0,0.6015749,58.600837,15.161068)"
+         id="g4460">
+        <path
+           style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.5138334px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+           d="M 187.22261,104.20627 C 187.22261,104.20627 187.22261,102.23277 187.22261,104.20627 z "
+           id="path4462" />
+        <path
+           style="fill:#422f17;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.5138334px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+           d="M 183.201,113.07522 C 193.37175,108.10319 193.63086,108.52844 200.46351,113.69314 L 200.29499,105.21496 C 200.35117,105.10532 201.41844,103.68002 201.41844,105.21496 C 201.41844,106.7499 201.64313,115.74027 201.64313,115.74027 C 201.64313,115.74027 201.13758,128.18425 199.34006,129.171 C 197.99193,129.60955 189.06054,134.37883 189.06054,134.37883 C 189.06054,134.37883 187.26303,135.25594 185.91489,134.37883 C 184.56675,133.50173 176.92733,128.0198 176.92733,128.0198 C 176.92733,128.0198 175.80388,126.92341 176.47795,125.60775 C 177.15201,124.29208 186.54379,99.322577 188.7681,101.64836"
+           id="path4464"
+           sodipodi:nodetypes="ccccccccccz" />
+        <g
+           id="g4466"
+           style="fill:url(#linearGradient8360);fill-opacity:1"
+           transform="matrix(0.476791,0,0,0.465307,56.04458,-173.9504)">
+          <path
+             style="fill:url(#linearGradient4886);fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+             d="M 263.1947,617.63145 L 282.04481,607.26389 C 282.04481,607.26389 286.52172,604.90763 291.23424,608.2064 C 295.94677,611.50517 305.37183,619.28084 305.37183,619.28084 L 306.19652,623.28649 L 290.0847,610.59125 C 289.08502,610.42464 286.38369,608.94186 283.45857,609.85578 C 280.86668,611.26954 261.20025,622.17737 261.20025,622.17737 L 263.1947,617.63145 z "
+             id="path4468"
+             sodipodi:nodetypes="ccccccccc" />
+          <path
+             style="fill:url(#linearGradient4888);fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+             d="M 260.84963,623.11423 L 282.16544,611.73514 C 282.16544,611.73514 286.1711,608.90763 290.88362,612.2064 C 295.59615,615.50517 306.90623,624.6946 305.96372,624.22335 L 305.6995,630.43604 L 287.34923,616.32704 C 287.34923,616.32704 283.81483,614.67765 281.22294,616.09141 C 278.63105,617.50517 258.13155,628.57961 258.13155,628.57961 L 260.84963,623.11423 z "
+             id="path4471"
+             sodipodi:nodetypes="ccccccccc" />
+          <path
+             style="fill:url(#linearGradient4890);fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+             d="M 257.89592,629.40713 L 280.0448,617.86143 C 280.0448,617.86143 284.05046,615.03392 288.76298,618.33269 C 293.47551,621.63146 306.35759,631.99903 305.41508,631.52778 L 304.9236,637.22041 L 285.22859,622.45333 C 285.22859,622.45333 281.69419,620.80394 279.1023,622.2177 C 276.51041,623.63146 256.01091,634.7059 256.01091,634.7059 L 257.89592,629.40713 z "
+             id="path4473"
+             sodipodi:nodetypes="ccccccccc" />
+          <path
+             style="fill:url(#linearGradient4892);fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+             d="M 255.53966,635.29779 L 277.68854,623.75209 C 277.68854,623.75209 281.6942,620.92458 286.40672,624.22335 C 291.11925,627.52212 305.67931,638.38115 304.7368,637.9099 L 303.84308,644.36659 L 282.87233,628.34399 C 282.87233,628.34399 279.33793,626.6946 276.74604,628.10836 C 274.15415,629.52212 253.65465,640.59656 253.65465,640.59656 L 255.53966,635.29779 z "
+             id="path4475"
+             sodipodi:nodetypes="ccccccccc" />
+          <path
+             style="fill:url(#linearGradient4894);fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+             d="M 253.29839,641.66534 L 275.44727,629.41277 C 275.44727,629.41277 279.92418,626.22344 284.6367,630.35528 C 289.34923,633.65405 303.72244,644.96412 303.72244,644.96412 C 303.80098,647.32038 302.70139,649.79446 301.13055,651.32603 C 301.44472,649.51956 304.11515,648.41997 300.42367,645.55318 L 282.32022,632.57352 C 281.32055,632.07368 278.78582,630.92413 276.19393,632.33789 C 273.60204,633.75165 253.76964,644.49286 253.76964,644.49286 L 253.29839,641.66534 z "
+             id="path4477"
+             sodipodi:nodetypes="cccccccccc" />
+        </g>
+        <path
+           style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.5138334px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.55940594"
+           d="M 202.05456,103.14424 C 202.05456,103.14424 216.03593,126.86726 225.09204,93.530989"
+           id="path4479"
+           sodipodi:nodetypes="cc" />
+        <g
+           id="g4481"
+           transform="matrix(0.476791,0,0,0.465307,55.77949,-173.6434)">
+          <path
+             style="fill:url(#linearGradient4896);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+             d="M 338.22446,521.19983 C 338.22446,521.19983 377.21191,565.18567 333.22607,578.18149 C 329.89381,579.18117 338.22446,521.19983 338.22446,521.19983 z "
+             id="path4483"
+             sodipodi:nodetypes="ccc" />
+          <path
+             style="fill:#0b6c46;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 275.0748,560.94594 L 275.21707,570.0003 C 283.27792,574.86011 293.10363,578.29621 303.96622,579.55254 C 314.81983,580.80783 325.18449,579.70093 334.1368,576.81477 L 333.99453,567.76041 C 325.93737,562.90699 284.03215,558.05439 275.0748,560.94594 z "
+             id="path4485"
+             sodipodi:nodetypes="cccccc" />
+          <path
+             style="fill:#bea613;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 275.68002,559.47428 L 275.57592,566.89757 C 283.50748,571.92005 293.36967,575.46859 304.29245,576.73188 C 315.20005,577.99342 325.63274,576.80211 334.49332,573.73219 L 334.60208,566.26861 C 326.67617,561.25722 284.54863,556.39486 275.68002,559.47428 z "
+             id="path4487"
+             sodipodi:nodetypes="cccccc" />
+          <path
+             style="fill:#b37711;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 276.88308,547.60287 L 276.00468,563.19042 C 283.77731,568.47998 293.58498,572.288 304.65829,573.56871 C 315.7236,574.84849 326.15339,573.37529 334.92441,570.00489 L 335.80281,554.41734 C 328.03268,549.13385 285.65791,544.22713 276.88308,547.60287 z "
+             id="path4489"
+             sodipodi:nodetypes="cccccc" />
+          <path
+             style="fill:#ac182a;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 277.50759,547.18114 L 276.67811,557.36777 C 284.00502,563.19427 293.8856,567.44309 305.21521,568.75344 C 316.54212,570.06348 327.13535,568.18047 335.59784,564.18225 L 336.42732,553.99561 C 329.10088,548.17129 285.97104,543.1809 277.50759,547.18114 z "
+             id="path4491"
+             sodipodi:nodetypes="cccccc" />
+          <path
+             style="fill:#be2873;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 278.81487,540.62031 L 277.33523,551.68616 C 284.05502,558.16146 294.04935,562.94986 305.73019,564.30083 C 317.38774,565.64911 328.23427,563.29207 336.2503,558.54093 L 337.73926,547.39449 C 331.01935,540.93903 286.83532,535.84983 278.81487,540.62031 z "
+             id="path4493"
+             sodipodi:nodetypes="cccccc" />
+          <path
+             style="fill:#ab0d2d;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 279.47201,530.46825 L 278.30926,543.26448 C 283.43866,551.13384 293.77039,557.26207 306.37566,558.71996 C 318.97018,560.1766 330.43404,556.57932 337.22666,550.0991 L 338.39407,537.26258 C 333.25996,529.40295 286.26227,523.97748 279.47201,530.46825 z "
+             id="path4495"
+             sodipodi:nodetypes="cccccc" />
+          <path
+             style="fill:#8d0b1e;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 280.98901,520.09478 L 279.05493,536.81726 C 283.24905,544.62442 293.92558,550.97115 307.09569,552.49436 C 320.24075,554.01468 332.09271,550.29201 337.97,543.67203 L 339.9134,526.86896 C 335.70236,519.08219 286.85447,513.45108 280.98901,520.09478 z "
+             id="path4497"
+             sodipodi:nodetypes="cccccc" />
+          <path
+             style="fill:#790a59;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 281.88381,512.35812 L 279.94973,529.0806 C 284.14385,536.88776 294.82038,543.23448 307.9905,544.7577 C 321.13555,546.27801 332.98752,542.55535 338.8648,535.93536 L 340.8082,519.1323 C 336.59716,511.34553 287.74927,505.71442 281.88381,512.35812 z "
+             id="path4499"
+             sodipodi:nodetypes="cccccc" />
+          <path
+             style="fill:#002c91;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 282.92775,503.33201 L 280.99367,520.05449 C 285.18778,527.86165 295.86432,534.20837 309.03443,535.73159 C 322.17949,537.25191 334.03145,533.52924 339.90874,526.90926 L 341.85214,510.10619 C 337.6411,502.31942 288.79321,496.68831 282.92775,503.33201 z "
+             id="path4501"
+             sodipodi:nodetypes="cccccc" />
+          <path
+             style="fill:#0b6c46;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 248.40625,547.75 L 253.90625,562.53125 L 267.34375,573.6875 C 270.1161,572.87512 272.81821,571.85611 275.375,570.46875 L 277.1875,555.125 C 273.53213,551.65247 260.03014,548.67004 248.40625,547.75 z "
+             id="path4503" />
+          <path
+             style="fill:#bea613;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 247.0625,544.125 L 253.90625,562.53125 L 264.21875,571.09375 C 268.30846,570.26259 272.21002,568.75831 275.84375,566.65625 L 277.4375,551.75 C 273.68372,547.98759 259.044,544.83986 247.0625,544.125 z "
+             id="path4505" />
+          <path
+             style="fill:#9f690f;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 247.5,545.3125 L 253.90625,562.53125 L 260.09375,567.65625 C 265.91841,567.12148 271.4714,565.18231 276.4375,562.03125 L 277.25,553.15625 C 273.64896,549.24433 259.39196,546.0513 247.5,545.3125 z "
+             id="path4507" />
+          <path
+             style="fill:#a01728;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 242.34375,533.09375 C 238.15485,533.3011 234.78501,534.0274 233.0625,535.34375 L 232.8125,537.59375 L 243.25,533.875 L 253.5625,561.59375 C 262.23387,562.6764 270.53733,560.01218 277.34375,554.8125 L 278.75,541.53125 C 274.73183,536.34031 254.91044,532.4717 242.34375,533.09375 z "
+             id="path4509" />
+          <path
+             style="fill:#ae055a;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 233.90026,527.51949 L 232.5274,541.56434 C 237.36729,549.31327 244.88205,554.85296 253.9423,556.07987 C 262.9845,557.30434 271.63361,553.97964 278.22229,547.80305 L 279.60771,533.65824 C 274.76644,525.93383 240.49366,521.31884 233.90026,527.51949 z "
+             id="path4511"
+             sodipodi:nodetypes="cccccc" />
+          <path
+             style="fill:#9e0c2a;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 235.3218,518.43899 L 233.84056,531.11784 C 237.34375,540.65021 245.03521,547.83318 254.81251,549.15719 C 264.58147,550.48008 273.79512,545.59896 279.53859,537.33156 L 281.02611,524.60272 C 277.51859,515.08257 241.06411,510.15862 235.3218,518.43899 z "
+             id="path4513"
+             sodipodi:nodetypes="cccccc" />
+          <path
+             style="fill:#720818;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 237.45332,502.37747 L 234.84585,523.12052 C 237.62058,532.61147 245.56782,540.05144 255.78324,541.43478 C 265.97922,542.81549 275.50503,537.76468 280.54074,529.35923 L 283.16077,508.51621 C 280.37145,499.05111 242.48132,493.94315 237.45332,502.37747 z "
+             id="path4515"
+             sodipodi:nodetypes="cccccc" />
+          <path
+             style="fill:#67094d;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 238.65967,492.78069 L 236.0522,513.52374 C 238.82693,523.01468 246.77417,530.45465 256.98959,531.838 C 267.18557,533.21871 276.71138,528.1679 281.74708,519.76244 L 284.36712,498.91943 C 281.5778,489.45433 243.68766,484.34636 238.65967,492.78069 z "
+             id="path4517"
+             sodipodi:nodetypes="cccccc" />
+          <path
+             style="fill:#0035a8;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 240.06707,481.58444 L 237.4596,502.32749 C 240.23433,511.81844 248.18158,519.25841 258.397,520.64175 C 268.59297,522.02246 278.11878,516.97165 283.15449,508.5662 L 285.77453,487.72318 C 282.98521,478.25808 245.09507,473.15011 240.06707,481.58444 z "
+             id="path4519"
+             sodipodi:nodetypes="cccccc" />
+          <path
+             style="fill:#00a867;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 240.87131,475.18658 L 238.26383,495.92963 C 241.03856,505.42058 248.31935,510.86119 258.53477,512.24454 C 268.73075,513.62525 278.92301,510.5738 283.95872,502.16834 L 286.57876,481.32533 C 283.78944,471.86023 245.8993,466.75226 240.87131,475.18658 z "
+             id="path4521"
+             sodipodi:nodetypes="cccccc" />
+          <path
+             style="fill:#006145;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 284.92775,491.33201 L 282.99367,508.05449 C 287.18778,515.86165 297.86432,522.20837 311.03443,523.73159 C 324.17949,525.25191 336.03145,521.52924 341.90874,514.90926 L 343.85214,498.10619 C 339.6411,490.31942 290.79321,484.68831 284.92775,491.33201 z "
+             id="path4523"
+             sodipodi:nodetypes="cccccc" />
+        </g>
+        <path
+           style="fill:url(#linearGradient4898);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+           d="M 190.03122,64.297807 C 190.03122,64.297807 182.72882,69.231546 180.36959,90.17252 C 184.97572,95.764091 211.15199,97.518308 211.15199,97.518308 C 211.15199,97.518308 205.42243,73.836368 208.90511,64.736364"
+           id="path4525"
+           sodipodi:nodetypes="cccc" />
+        <g
+           id="g4527"
+           transform="matrix(-0.774175,-0.401016,-0.348567,0.890665,597.6601,-302.2593)">
+          <path
+             style="fill:url(#linearGradient4900);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+             d="M 207.7583,506.50835 C 206.40141,508.14027 202.6659,520.80791 217.80808,536.11211 C 209.99845,521.01422 210.25164,515.35549 212.77702,513.84026 C 211.26179,512.57757 211.79891,504.74058 207.7583,506.50835 z "
+             id="path4529"
+             sodipodi:nodetypes="cccc" />
+          <path
+             style="fill:url(#linearGradient4902);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+             d="M 210.95084,511.50794 C 210.95084,511.50794 205.53158,526.18807 221.81423,540.68643 C 214.0046,525.58854 214.65742,520.7694 217.1828,519.25417 C 215.66757,517.99148 214.99145,509.74017 210.95084,511.50794 z "
+             id="path4531"
+             sodipodi:nodetypes="cccc" />
+          <path
+             style="fill:url(#linearGradient4904);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+             d="M 215.63896,514.69258 C 214.26567,516.28385 212.37855,522.69625 221.02957,539.78214 C 224.42558,543.33631 225.80981,544.21794 228.40596,546.12917 C 225.88057,540.57332 225.18702,531.44512 225.18702,531.44512 C 225.18702,531.44511 222.30922,521.66678 215.63896,514.69258 z "
+             id="path4533"
+             sodipodi:nodetypes="ccccc" />
+          <path
+             style="fill:url(#linearGradient4906);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+             d="M 220.25,520.1875 C 218.87671,521.77877 217.69273,527.32036 226.34375,544.40625 C 226.73044,544.6265 227.16007,545.21026 234.57596,551.27054 C 232.05057,545.71469 229.79806,536.94004 229.79806,536.94004 C 229.79806,536.94003 226.92026,527.1617 220.25,520.1875 z "
+             id="path4535"
+             sodipodi:nodetypes="ccccc" />
+          <path
+             style="fill:url(#linearGradient4908);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+             d="M 226.43242,527.87754 C 225.19989,531.53305 222.40285,535.39769 233.4082,550.0827 C 236.39784,552.68732 237.75066,552.31339 241.50027,554.94898 C 238.97488,549.39313 233.83867,536.94004 233.83867,536.94004 C 233.83867,536.94003 230.56317,532.74151 226.43242,527.87754 z "
+             id="path4537"
+             sodipodi:nodetypes="ccccc" />
+        </g>
+        <path
+           style="fill:url(#linearGradient6204);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+           d="M 147.23396,1.5882927 C 147.13465,2.646801 146.98467,5.018187 147.77035,8.3934076 C 146.71944,8.7518336 142.71094,10.274486 139.09871,21.320218 C 141.74768,16.6199 141.9984,15.68199 148.50043,10.981678 C 148.72205,9.0350846 149.12685,6.368708 151.61447,1.5882927 L 147.23396,1.5882927 z M 266.35721,1.5882927 C 267.93182,4.3792274 271.22943,10.952536 270.11194,15.67837 C 269.87112,16.383427 269.32225,18.148541 269.32225,18.324804 C 271.12838,19.441122 277.62699,22.665569 280.03515,37.824075 C 280.45658,31.654914 282.6271,21.609411 270.82712,13.0901 C 272.37122,8.9999353 272.85313,6.0215192 272.37669,1.5882927 L 266.35721,1.5882927 z "
+           id="path4539" />
+        <path
+           style="fill:url(#linearGradient4912);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+           d="M 151.33138,1.5882927 C 150.48086,3.2294259 148.16646,7.8677178 148.47063,10.923514 C 143.724,13.810912 141.42889,16.685518 139.20301,21.291136 L 139.21791,21.203891 C 139.21791,21.203896 136.26512,28.807398 138.60702,37.126115 C 138.99068,33.147428 137.3331,25.956979 148.85802,14.558725 C 148.80375,14.543877 150.01326,17.8718 151.25688,20.49139 C 151.54908,19.347051 149.72571,9.4677224 164.91992,1.5882927 L 151.33138,1.5882927 z "
+           id="path4541" />
+        <path
+           style="fill:url(#linearGradient4914);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+           d="M 257.78987,1.5882927 C 267.38505,10.987587 266.20821,24.155682 266.20821,24.155682 C 266.20821,24.155682 267.57261,21.334763 267.74288,21.334758 C 281.53576,34.296881 273.18127,52.408537 273.18128,52.408542 C 273.18128,52.408542 277.96196,48.41812 280.00535,38.114892 C 279.32422,24.654226 271.48484,19.4673 269.44145,18.179395 C 269.44145,18.179395 270.46314,16.357639 270.63343,13.366376 C 269.43017,7.1595205 267.60358,3.4581243 266.49131,1.5882927 L 257.78987,1.5882927 z "
+           id="path4543" />
+        <path
+           sodipodi:nodetypes="ccccccccc"
+           id="path4545"
+           d="M 153.27873,24.934713 C 153.27873,24.934713 140.44556,34.402142 145.39585,50.498089 C 147.26897,55.31734 151.52603,59.471866 151.52603,59.471866 C 151.52603,59.471866 143.35247,47.340646 155.95337,32.051988 C 155.95337,32.051988 158.67789,38.865409 164.12693,48.836277 C 166.68117,44.183203 172.98162,38.865414 185.58253,31.553445 C 198.18343,24.241475 184.56083,18.258958 184.56083,18.258958 C 184.56083,18.258958 159.01846,24.687886 159.5293,40.028681 C 158.50761,38.865414 154.07171,26.714033 153.27873,24.934713 z "
+           style="fill:url(#linearGradient4916);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+        <path
+           style="fill:url(#linearGradient4918);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+           d="M 164.57723,1.5882927 C 158.84878,4.5412985 150.6096,10.478388 151.22708,20.229654 C 151.14194,20.229659 148.91762,14.427858 148.91762,14.427858 C 148.91762,14.427858 137.51508,22.973719 138.62192,36.849839 C 139.47333,41.419819 142.00415,45.574345 142.00415,45.574345 C 142.00415,45.574345 137.00423,29.785064 150.54169,19.066387 C 151.91856,23.362762 154.14866,27.917015 155.7268,31.382482 C 155.64166,30.883942 151.04828,16.316092 183.82766,6.0959543 C 183.96763,4.234824 183.90823,2.8077135 183.76807,1.5882927 L 164.57723,1.5882927 z "
+           id="path4547" />
+        <path
+           sodipodi:nodetypes="ccccccccc"
+           id="path4549"
+           d="M 151.52603,59.638046 C 151.52603,59.638046 155.00221,63.86141 156.19419,64.692318 C 156.96046,65.523221 150.06402,54.085235 160.11069,40.624567 C 161.91681,46.147436 169.98707,60.322932 169.98707,60.322932 C 169.98707,60.322932 176.55756,50.498089 186.77451,46.509742 C 191.37213,33.54762 187.28535,34.877067 185.41224,31.553445 C 183.36885,31.885804 164.12693,45.014111 163.95665,48.503913 C 163.61608,48.420823 157.18062,34.137601 156.07378,32.060336 C 155.05208,31.063253 143.69303,46.675922 151.52603,59.638046 z "
+           style="fill:url(#linearGradient4920);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+        <path
+           sodipodi:nodetypes="ccccccccc"
+           id="path4551"
+           d="M 184.25763,6.2665591 C 183.30647,5.2576619 150.9578,16.177952 155.56502,30.778266 C 151.47825,22.30303 150.71197,19.145591 150.71197,19.145591 C 150.47116,18.205527 137.51508,28.202457 141.94243,45.48529 C 143.04926,47.811825 144.6755,50.165138 145.59923,50.960911 C 144.74781,47.969652 142.45327,34.018795 153.09593,25.128109 C 156.07587,32.606258 157.72277,35.774491 159.6372,39.737785 C 160.48861,38.906882 157.43814,27.537734 185.0239,18.065414 C 188.25927,9.8394515 184.25763,6.2665591 184.25763,6.2665591 z "
+           style="fill:url(#linearGradient4922);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+        <path
+           style="fill:url(#linearGradient4924);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+           d="M 241.40018,1.5882927 C 263.39065,16.032799 261.37514,29.427117 261.6191,32.284014 C 263.40706,30.123659 264.89064,27.475154 265.65692,26.394972 C 276.12929,39.440189 270.04808,56.04583 269.36695,56.959828 C 270.04808,56.959828 272.50441,53.646586 273.27068,52.234051 C 282.55107,30.713603 269.19028,20.896463 267.74288,21.145728 C 266.97661,22.059725 266.46151,23.563663 266.46151,23.646753 C 266.51992,10.990844 261.44708,4.4820603 258.22196,1.5882927 L 241.40018,1.5882927 z "
+           id="path4553" />
+        <path
+           style="fill:url(#linearGradient4926);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+           d="M 224.71249,1.5882927 C 222.34772,2.9998434 222.30409,5.0218024 229.22711,7.9717232 C 246.68625,17.137326 254.14503,30.950826 256.55319,39.176374 C 257.03482,38.588835 261.42603,32.608072 261.87239,32.109524 C 271.24429,49.356086 263.52626,62.589205 262.33428,63.503207 C 262.33428,63.503207 267.99535,60.040574 269.56065,57.337889 C 276.96574,38.125366 265.59733,26.191405 265.59732,26.1914 C 265.59732,26.1914 265.34932,27.249262 261.85749,31.949574 C 262.54736,16.549025 249.498,6.2501757 241.98127,1.5882927 L 224.71249,1.5882927 z "
+           id="path4555" />
+        <path
+           sodipodi:nodetypes="ccccccccc"
+           id="path4557"
+           d="M 229.8082,7.9283659 C 229.8082,7.9283659 253.00764,20.094222 256.49947,38.660451 C 261.5566,31.844997 260.59334,32.716861 261.67701,32.129318 C 262.76068,31.541779 271.79128,50.343025 262.51987,63.503896 C 255.29539,69.849315 254.57294,69.614298 252.76682,70.554362 C 253.24845,69.379281 264.32598,61.956136 256.13825,39.042119 C 254.09131,42.919871 249.90625,47.129992 249.90625,47.129992 C 249.90625,47.129992 246.74643,31.306767 224.9526,19.673496 C 210.14242,13.915615 229.79813,7.1606466 229.96841,7.4930107"
+           style="fill:url(#linearGradient4928);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+        <path
+           sodipodi:nodetypes="ccccccccc"
+           id="path4559"
+           d="M 225.073,19.604663 L 219.54392,33.539412 C 219.88449,33.871776 234.70564,40.589879 240.96685,56.570938 C 241.60874,56.598614 248.91377,48.697914 249.63622,47.287819 C 250.35867,45.87773 255.35559,66.73536 246.98725,74.432115 C 250.84825,72.119418 252.80814,71.640445 253.9709,69.966819 C 254.45254,68.791742 263.90456,60.037415 256.19845,39.12103 C 254.07389,42.133 251.22218,45.137552 249.99745,46.465268 C 248.56966,41.118961 242.5165,29.216678 225.073,19.604663 z "
+           style="fill:url(#linearGradient4930);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+        <path
+           style="fill:#1f4a2a;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+           d="M 183.54457,1.5882927 L 183.82766,6.9247824 C 183.82767,6.9247778 203.772,-4.7868273 230.16579,8.175295 C 231.62859,6.1193267 233.0947,3.6616496 234.32281,1.5882927 L 183.54457,1.5882927 z "
+           id="path4561" />
+        <g
+           id="g4563"
+           transform="matrix(0.476791,0,0,0.465307,55.77949,-173.6434)">
+          <path
+             style="fill:url(#linearGradient4932);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+             d="M 210.6168,512.94073 C 210.6168,512.94073 209.80617,527.05721 224.94835,542.36141 C 217.13872,527.26352 214.65742,520.7694 217.1828,519.25417 C 215.66757,517.99148 214.65741,511.17296 210.6168,512.94073 z "
+             id="path4565"
+             sodipodi:nodetypes="cccc" />
+          <path
+             style="fill:url(#linearGradient4934);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+             d="M 215.63896,514.69258 C 214.26567,516.28385 213.08169,521.82544 221.73271,538.91133 C 226.65449,544.60372 227.44153,545.08454 234.78918,551.64182 C 232.26379,546.08597 225.18702,531.44512 225.18702,531.44512 C 225.18702,531.44511 222.30922,521.66678 215.63896,514.69258 z "
+             id="path4567"
+             sodipodi:nodetypes="ccccc" />
+          <path
+             style="fill:url(#linearGradient4936);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+             d="M 220.25,520.1875 C 218.87671,521.77877 217.69273,527.32036 226.34375,544.40625 C 231.26553,550.09864 232.05257,550.57946 239.40022,557.13674 C 236.87483,551.58089 229.79806,536.94004 229.79806,536.94004 C 229.79806,536.94003 226.92026,527.1617 220.25,520.1875 z "
+             id="path4569"
+             sodipodi:nodetypes="ccccc" />
+          <path
+             style="fill:url(#linearGradient4938);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+             d="M 226.43242,527.87754 C 225.19989,531.53305 224.73957,539.88003 235.74492,554.56504 C 238.73456,557.16966 242.85692,559.62588 246.60653,562.26147 C 244.08114,556.70562 233.83867,536.94004 233.83867,536.94004 C 233.83867,536.94003 230.56317,532.74151 226.43242,527.87754 z "
+             id="path4571"
+             sodipodi:nodetypes="ccccc" />
+        </g>
+        <path
+           sodipodi:nodetypes="ccccccccccccccccccccc"
+           id="path4573"
+           d="M 176.85034,88.193825 C 176.85034,88.193825 174.12582,88.692369 173.27441,87.861466 C 172.423,87.030558 167.65509,81.214225 167.31452,76.893514 C 165.10084,74.068435 157.26785,66.590287 156.41644,64.928475 C 154.8839,62.768125 150.79711,52.365184 159.82209,40.067786 C 163.73859,47.712114 169.18763,58.846252 169.86875,59.677155 C 170.89046,59.012427 172.59328,53.528454 186.55644,45.884123 C 185.87531,36.910347 183.66164,7.9283659 184.17248,6.5989186 C 184.68333,5.2694714 204.94695,-5.366116 230.14876,8.26073 C 222.9969,25.377378 220.27238,31.858444 219.93181,33.686435 C 220.1021,34.018795 234.40583,38.339505 241.38741,55.954699 C 245.47419,51.633987 247.00673,49.473636 249.90153,46.316193 C 252.28549,52.631075 253.98832,67.753554 247.00673,74.566979 C 239.68458,80.050957 230.31905,84.205483 229.46763,85.368751 C 228.61622,86.532018 222.65633,93.843983 216.35588,95.17343 C 216.35588,95.00725 220.44266,91.683628 220.78323,90.35418 C 221.12379,89.024733 222.65633,77.724418 222.65633,77.724418 L 209.3743,65.09466 L 189.11068,64.097572 C 189.11068,64.097572 178.2126,70.744813 175.65836,73.736076 C 175.3178,76.561155 176.85034,88.193825 176.85034,88.193825 z "
+           style="fill:url(#linearGradient4940);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+        <path
+           sodipodi:nodetypes="ccccc"
+           id="path4575"
+           d="M 270.62287,13.502604 C 269.42734,27.183314 242.50914,55.097143 223.14083,76.429747 C 223.14083,76.429747 222.41838,77.134795 222.41838,77.134795 C 222.6592,77.134795 240.25709,62.968732 251.73862,59.871179 C 280.07812,68.073941 288.57012,22.015298 270.62287,13.502604 z "
+           style="fill:url(#linearGradient4942);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+        <path
+           id="path4577"
+           d="M 279.49738,40.589879 C 279.49738,40.589879 255.4158,61.741276 233.01993,71.611931 C 210.62406,81.482581 228.68524,83.597723 228.68524,83.597723 C 228.68524,83.597723 272.75454,64.561464 279.49738,40.589879 z "
+           style="opacity:0.39999994;fill:url(#linearGradient4944);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+        <path
+           sodipodi:nodetypes="cccc"
+           id="path4579"
+           d="M 272.27788,4.7043653 C 272.27788,1.048383 261.13777,30.50883 227.84381,49.685626 C 205.44794,59.556278 216.35727,70.977559 222.48744,74.633541 C 237.13174,59.01252 269.96238,31.002484 272.27788,4.7043653 z "
+           style="opacity:0.39999994;fill:url(#linearGradient4946);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+        <path
+           style="opacity:0.69999994;fill:url(#linearGradient4948);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+           d="M 260.28034,66.231116 C 260.28034,66.231116 238.12529,82.917216 227.52939,86.207434 C 247.10271,85.274289 257.39056,81.977156 260.28034,66.231116 z "
+           id="path4581"
+           sodipodi:nodetypes="ccc" />
+        <path
+           style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+           d="M 177.1116,88.199027 L 181.83007,92.365293 C 183.06586,92.474933 185.4251,92.146017 187.22261,91.378549 C 187.22261,91.378549 199.35581,100.58819 218.90377,93.461682 C 206.43353,102.23277 198.12003,97.956864 190.81764,98.505056 C 186.32385,94.777342 174.41533,88.199027 173.74126,88.199027 C 173.06719,88.199027 177.1116,88.199027 177.1116,88.199027 z "
+           id="path4583"
+           sodipodi:nodetypes="ccccccc" />
+        <path
+           style="fill:url(#linearGradient4950);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+           d="M 209.24214,66.052029 C 210.1409,77.381351 205.19774,100.11309 205.19774,100.04 L 190.36826,99.162889 L 180.48194,91.926741 L 194.41266,108.59181 L 219.80253,92.146017 C 219.80253,92.146017 220.02722,81.620712 222.04942,79.866491 C 224.07162,78.112274 221.82473,77.235166 221.82473,77.235166 C 221.82473,77.235166 212.38779,70.656846 209.24214,66.052029 z "
+           id="path4585"
+           sodipodi:nodetypes="ccccccccc" />
+        <path
+           style="fill:url(#linearGradient4952);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+           d="M 205.42243,100.25928 L 222.94818,77.673718 C 222.94818,77.673718 220.02722,82.059264 219.80253,91.926741 C 219.80253,91.926741 205.42243,100.25928 205.42243,100.25928 z "
+           id="path4587"
+           sodipodi:nodetypes="cccc" />
+        <path
+           sodipodi:nodetypes="cccc"
+           id="path4589"
+           d="M 272.27788,6.5655933 C 272.27788,2.9096111 261.13777,32.370058 227.84381,51.546854 C 205.44794,61.417506 216.35727,70.977559 222.48744,74.633541 C 237.13174,59.01252 269.96238,32.863712 272.27788,6.5655933 z "
+           style="opacity:0.39999994;fill:url(#linearGradient4954);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+        <path
+           id="path4591"
+           d="M 278.5438,42.451107 C 278.5438,42.451107 255.4158,63.602504 233.01993,73.473159 C 210.62406,83.343809 228.68524,83.597723 228.68524,83.597723 C 228.68524,83.597723 268.94113,65.492376 278.5438,42.451107 z "
+           style="opacity:0.59999988;fill:url(#linearGradient4956);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+           sodipodi:nodetypes="cccc" />
+        <path
+           style="opacity:0.69999994;fill:url(#linearGradient4958);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+           d="M 260.28034,66.231116 C 260.28034,66.231116 238.12529,82.917216 227.52939,86.207434 C 244.56065,83.723765 257.39056,81.977156 260.28034,66.231116 z "
+           id="path4593"
+           sodipodi:nodetypes="ccc" />
+      </g>
+      <rect
+         y="77"
+         x="236"
+         height="0"
+         width="1"
+         id="rect1327"
+         style="opacity:0.57786889;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.63199997;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1" />
+      <path
+         style="fill:#ffffff;fill-opacity:0.75688076;fill-rule:nonzero;stroke:none;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1"
+         d="M 77.062579,3.7839329 L 77.062579,0.98922447 L 77.062579,3.7839329 z "
+         id="path2276"
+         sodipodi:nodetypes="ccc" />
+      <g
+         id="g4640"
+         transform="matrix(-0.782995,0,0,0.650879,-2245.796,690.3016)"
+         style="opacity:0.40163933" />
+      <g
+         style="opacity:0.40163933"
+         transform="matrix(-0.782995,0,0,0.650879,-2245.796,690.3016)"
+         id="g4646" />
+      <g
+         style="opacity:0.40163933"
+         transform="matrix(1,0,0,0.650879,955.167,697.6294)"
+         id="g4730" />
+      <g
+         id="g4748"
+         transform="matrix(1,0,0,0.650879,955.167,697.6294)"
+         style="opacity:0.40163933" />
+      <path
+         style="fill:#ffffff;fill-opacity:0.75688076;fill-rule:nonzero;stroke:none;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1"
+         d="M 181.23105,2.6244365 L 181.23105,0.41896716 L 181.23105,2.6244365 z "
+         id="path2408"
+         sodipodi:nodetypes="ccc" />
+    </g>
+    <path
+       style="opacity:0.24344569;fill:url(#radialGradient31866);fill-opacity:1;stroke:none;stroke-width:10;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dashoffset:1.08779998;stroke-opacity:1"
+       d="M 73,63.5 L 116,63.5 L 116,85.5 L 93.5,108 L 73,108 L 73,63.5 z "
+       id="rect31858"
+       sodipodi:nodetypes="cccccc" />
+    <g
+       id="g4960"
+       transform="translate(10,-6)">
+      <path
+         transform="translate(40,0)"
+         clip-path="url(#clipPath7084)"
+         sodipodi:nodetypes="cccc"
+         style="opacity:0.4;fill:#000000;fill-opacity:1;filter:url(#filter6697)"
+         id="path5540"
+         d="M 41.879531,115.98249 C 41.879531,115.98249 66.18914,91.672876 66.18914,91.672876 C 66.18914,91.672876 56.836,94.586 46.586,94.586 C 46.586,104.836 41.879531,115.98249 41.879531,115.98249 z " />
+      <path
+         sodipodi:nodetypes="csccc"
+         d="M 79.172,120 C 79.172,120 91.086,110.086 96.586,104.586 C 102.086,99.086 112,87.172 112,87.172 C 112,87.172 98.25,96 88,96 C 88,106.25 79.172,120 79.172,120 z "
+         id="path14523"
+         style="fill:url(#linearGradient10213);fill-opacity:1" />
+    </g>
+  </g>
+  <g
+     inkscape:groupmode="layer"
+     id="layer2"
+     style="display:inline" />
+  <g
+     inkscape:groupmode="layer"
+     id="layer3" />
+</svg>
--- a/securitydialogs/Autolock/PubSub/SecurityUIsPrivatePSKeys.h	Thu Aug 19 10:45:23 2010 +0300
+++ b/securitydialogs/Autolock/PubSub/SecurityUIsPrivatePSKeys.h	Tue Aug 31 16:04:40 2010 +0300
@@ -12,8 +12,8 @@
 * Contributors:
 *
 * Description:  Private Publish&Subscribe definitions of the
-*               Security UIs subsystem
-*
+ *                Security UIs subsystem
+ *
 */
 
 
@@ -32,24 +32,25 @@
 // Use TUid KPSUidSecurityUIs = { 0x100059b5 } 
 
 /**
-* Used by SecUI to differentiate between ETel API originated and SecUI originated
-* security queries.
-* Old Shared Data constant name: KSecUIOriginatedQuery
-*/
+ * Used by SecUI to differentiate between ETel API originated and SecUI originated
+ * security queries.
+ * Old Shared Data constant name: KSecUIOriginatedQuery
+ */
 const TUint32 KSecurityUIsSecUIOriginatedQuery = 0x00000301;
 enum TSecurityUIsSecUIOriginatedQuery
     {
     ESecurityUIsSecUIOriginatedUninitialized = 0,
     ESecurityUIsETelAPIOriginated,
     ESecurityUIsSecUIOriginated,
-    ESecurityUIsSystemLockOriginated
+    ESecurityUIsSystemLockOriginated,
+    ESecurityUIsFpsOriginated
     };
 
 /**
-* Used by SecUI to tell if a query request set by some ETELMM API lock setting function (i.e. SetXXXXSetting)
-* has been canceled sinnce canceling the setting request does not prompt a query cancel event from ETEL.
-* Old Shared Data constant name: KSecUIOriginatedQuery
-*/    
+ * Used by SecUI to tell if a query request set by some ETELMM API lock setting function (i.e. SetXXXXSetting)
+ * has been canceled since canceling the setting request does not prompt a query cancel event from ETEL.
+ * Old Shared Data constant name: KSecUIOriginatedQuery
+ */    
 const TUint32 KSecurityUIsQueryRequestCancel = 0x00000302;
 enum TSecurityUIsQueryRequestCancel
     {
@@ -58,7 +59,58 @@
     ESecurityUIsQueryRequestCanceled
     };
 
-#endif      // SECURITYUISPRIVATEPSKEYS_H
+/**
+ * Used by Autolock to tell which application has enabled/disabled the keyguard/devicelock , and at which moment.
+ */    
+const TUint32 KSecurityUIsLockInitiatorUID  = 0x00000303;
+const TUint32 KSecurityUIsLockInitiatorTimeHigh = 0x00000304;
+const TUint32 KSecurityUIsLockInitiatorTimeLow  = 0x00000305;
+
+/**
+ * Used by Autolock to tell the status of screensaver 
+ */    
+const TUint32 KSecurityUIsScreenSaverStatus  = 0x00000306;
+enum TSecurityUIsScreenSaverValues
+    {
+    ESecurityUIsScreenSaverUninitialized = 0,
+    ESecurityUIsScreenSaverOn,
+    ESecurityUIsScreenSaverOff,
+    ESecurityUIsScreenSaverOffWhileUnguardQuery,
+    ESecurityUIsScreenSaverOffWhileUnlockQuery,
+    ESecurityUIsScreenSaverLastValue
+    };
+
+/**
+ * Used by any applicattion, to send a Code for Secui
+ */    
+const TUint32 KSecurityUIsTestCode  = 0x00000307;
+
+/**
+ * Used to tell SysAp to switch-on the lights.
+ */    
+const TUint32 KSecurityUIsLights  = 0x00000308;
+enum TSecurityUIsLights
+    {
+    ESecurityUIsLightsUninitialized = 0,
+    ESecurityUIsLightsLockOnRequest,
+    ESecurityUIsLightsQueryOnRequest,
+    ESecurityUIsLightsLockOffRequest,
+    ESecurityUIsLightsLastValue
+    };
+
+/**
+ * Used by Autolock to tell the dialog to dismiss. In fact, any app can do this.
+ */    
+const TUint32 KSecurityUIsDismissDialog  = 0x00000309;
+enum TSecurityUIsDismissDialogValues
+    {
+    ESecurityUIsDismissDialogUninitialized = 0,
+    ESecurityUIsDismissDialogOn,
+    ESecurityUIsDismissDialogProcessing,
+    ESecurityUIsDismissDialogDone,
+    ESecurityUIsDismissDialogLastValue
+    };
+
+#endif // SECURITYUISPRIVATEPSKEYS_H
 
 // End of File
-
--- a/securitydialogs/Autolock/aif/Autolockaif.rss	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +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 Autolock.
-*     
-*
-*/
-
-
-#include <aiftool.rh>
-
-RESOURCE AIF_DATA
-{
-    app_uid=0x100059B5;
-    hidden = KAppIsHidden;
-    num_icons = 0;
-    embeddability = KAppNotEmbeddable;
-    newfile = KAppDoesNotSupportNewFile;
-}
-
-// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/autolock.qcrml	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<repository target="CRepository" uidValue="0x101F877A">
+    <key int="0x00000001" ref="/KCRUidSecuritySettings/KSettingsAutoLockTime"></key>
+    <key int="0x00000002" ref="/KCRUidSecuritySettings/KSettingsAutolockStatus"></key>
+    <key int="0x00000003" ref="/KCRUidSecuritySettings/KSettingsLockOnPowerUp"></key>
+    <key int="0x00000005" ref="/KCRUidSecuritySettings/KSettingsAutomaticKeyguardTime"></key>
+    <key int="0x00000006" ref="/KCRUidSecuritySettings/KSettingsMaxAutomaticKeyguardTime"></key>
+</repository>
+<repository target="CRepository" uidValue="0x101F877C">
+    <key int="0x7e000001" ref="/KCRUidPersonalizationSettings/KSettingsScreenSaverPeriod"></key>
+</repository>
+<repository target="CRepository" uidValue="0x101f8798">
+    <key int="0x7e000001"  ref="/KCRUidProfileEngine/KProEngActiveProfile"></key>
+</repository>
+<repository target="CRepository" uidValue="0x10200C8C">
+    <key int="0x00000006" ref="/KCRUidLightSettings/KDisplayLightsTimeout"></key>
+</repository>
+<repository target="RProperty" uidValue="0x101F8767">
+    <key int="0x00000501"  ref="/KPSUidCoreApplicationUIs/KCoreAppUIsAutolockStatus"></key>
+</repository>
+<repository target="RProperty" uidValue="0x100059b5">
+    <key int="0x00000309"  ref="/KPSUidSecurityUIs/KSecurityUIsDismissDialog"></key>
+</repository>
+<repository target="RProperty" uidValue="0x20022F35">
+    <key int="0x1"  ref="/KPSUidHWRM/KHWRMGripStatus"></key>
+</repository>
+<repository target="RProperty" uidValue="0x10207218">
+    <key int="0x00000001"  ref="/KPSUidAvkonDomain/KAknKeyguardStatus"></key>
+</repository>
+<repository target="RProperty" uidValue="0x102029AC">
+    <key int="0x00000001"  ref="/KPSUidCtsyCallInformation/KCTsyCallState"></key>
+</repository>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/autolockuseractivityservice.pro	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,19 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+# 
+# Description: autolockuseractivityservice.pro
+#
+
+TEMPLATE = subdirs
+
+SUBDIRS += autolockuseractivityservice/autolockuseractivityservice.pro
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/autolockuseractivityservice/autolockuseractivityservice.pri	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,26 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+# 
+# Description: autolockuseractivityservice.pri
+#
+
+HEADERS += ./inc/*.h
+
+SOURCES += ./src/*.cpp
+
+INCLUDEPATH += . \
+               inc 
+               
+DEPENDPATH += . \
+              inc \
+              src
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/autolockuseractivityservice/autolockuseractivityservice.pro	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,32 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+# 
+# Description: autolockuseractivityservice.pro
+#
+
+TEMPLATE = lib
+
+include(common.pri)
+
+DEFINES += AUTOLOCKUSERACTIVITYSERVICE_LIB
+
+symbian: {
+TARGET.UID3 = 0x2002704D
+LIBS += -lactivitymanager
+
+include(autolockuseractivityservice_s60.pri)
+} else {
+include(autolockuseractivityservice_stub.pri)
+}
+
+include(autolockuseractivityservice.pri)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/autolockuseractivityservice/autolockuseractivityservice_s60.pri	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,24 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+# 
+# Description: autolockuseractivityservice_s60.pri
+#
+
+HEADERS += ./s60/inc/*.h
+
+SOURCES += ./s60/src/*.cpp
+
+INCLUDEPATH += ./s60/inc
+
+DEPENDPATH += ./s60/inc \
+              ./s60/src
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/autolockuseractivityservice/autolockuseractivityservice_stub.pri	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,24 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+# 
+# Description: autolockuseractivityservice_stub.pri
+#
+
+HEADERS += ./stub/inc/*.h
+
+SOURCES += ./stub/src/*.cpp
+
+INCLUDEPATH += ./stub/inc
+
+DEPENDPATH += ./stub/inc \
+              ./stub/src
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/autolockuseractivityservice/bld.inf	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,41 @@
+// ============================================================================
+// * Makefile for building: autolockuseractivityservice
+// * Generated by qmake (2.01a) (Qt 4.6.3) on: 2010-05-20T15:50:24
+// * This file is generated by qmake and should not be modified by the
+// * user.
+// * Project:  autolockuseractivityservice.pro
+// * Template: lib
+// ============================================================================
+
+#define BLD_INF_AUTOLOCKUSERACTIVITYSERVICE_FB812CD7
+
+
+prj_platforms
+
+WINSCW GCCE ARMV5 ARMV6
+
+
+prj_mmpfiles
+
+autolockuseractivityservice_0x2002704D.mmp
+
+prj_extensions
+
+START EXTENSION qt/qmake_extra_pre_targetdep.export
+OPTION PREDEP_TARGET E:/sf/mw/securitysrv/securitydialogs/Autolock/autolockuseractivityservice/moc_autolockuseractivityservice.cpp
+OPTION DEPS E:/sf/mw/securitysrv/securitydialogs/Autolock/autolockuseractivityservice/inc/autolockuseractivityserviceinterface.h E:/sf/mw/securitysrv/securitydialogs/Autolock/autolockuseractivityservice/inc/autolockuseractivityservice_global.h E:/sf/mw/securitysrv/securitydialogs/Autolock/autolockuseractivityservice/inc/autolockuseractivityservice.h 
+OPTION COMMAND /epoc32/tools/moc  -DSYMBIAN  -DUNICODE -DQT_KEYPAD_NAVIGATION -DQT_SOFTKEYS_ENABLED -DQT_USE_MATH_H_FLOATS -DAUTOLOCKUSERACTIVITYSERVICE_LIB -DQT_GUI_LIB -DQT_CORE_LIB  -I"E:/epoc32/include/mw/QtCore"  -I"E:/epoc32/include/mw/QtGui"  -I"E:/epoc32/include/mw"  -I"E:/sf/mw/qt/mkspecs/common/symbian"  -I"E:/epoc32/include"  -I"E:/epoc32/include/stdapis"  -I"E:/epoc32/include/stdapis/sys"  -I"E:/sf/mw/securitysrv/securitydialogs/Autolock/autolockuseractivityservice"  -I"E:/sf/mw/securitysrv/securitydialogs/Autolock/autolockuseractivityservice/inc"  -I"E:/epoc32/include/platform/mw"  -I"E:/epoc32/include/platform"  -I"E:/epoc32/include/app"  -I"E:/epoc32/include/platform/app"  -I"E:/epoc32/include/platform/loc"  -I"E:/epoc32/include/platform/mw/loc"  -I"E:/epoc32/include/platform/app/loc"  -I"E:/epoc32/include/platform/loc/sc"  -I"E:/epoc32/include/platform/mw/loc/sc"  -I"E:/epoc32/include/platform/app/loc/sc"  -I"E:/sf/mw/securitysrv/securitydialogs/Autolock/autolockuseractivityservice/s60/inc"  -I"E:/epoc32/include/stdapis/stlportv5"  -I"E:/sf/mw/securitysrv/securitydialogs/Autolock/autolockuseractivityservice/s60/src"  -I"E:/sf/mw/securitysrv/securitydialogs/Autolock/autolockuseractivityservice/src" -DSYMBIAN e:/sf/mw/securitysrv/securitydialogs/Autolock/autolockuseractivityservice/inc/autolockuseractivityservice.h -o e:/sf/mw/securitysrv/securitydialogs/Autolock/autolockuseractivityservice/moc_autolockuseractivityservice.cpp
+END
+START EXTENSION qt/qmake_extra_pre_targetdep.export
+OPTION PREDEP_TARGET E:/sf/mw/securitysrv/securitydialogs/Autolock/autolockuseractivityservice/moc_autolockuseractivityserviceinterface.cpp
+OPTION DEPS E:/sf/mw/securitysrv/securitydialogs/Autolock/autolockuseractivityservice/inc/autolockuseractivityserviceinterface.h 
+OPTION COMMAND /epoc32/tools/moc  -DSYMBIAN  -DUNICODE -DQT_KEYPAD_NAVIGATION -DQT_SOFTKEYS_ENABLED -DQT_USE_MATH_H_FLOATS -DAUTOLOCKUSERACTIVITYSERVICE_LIB -DQT_GUI_LIB -DQT_CORE_LIB  -I"E:/epoc32/include/mw/QtCore"  -I"E:/epoc32/include/mw/QtGui"  -I"E:/epoc32/include/mw"  -I"E:/sf/mw/qt/mkspecs/common/symbian"  -I"E:/epoc32/include"  -I"E:/epoc32/include/stdapis"  -I"E:/epoc32/include/stdapis/sys"  -I"E:/sf/mw/securitysrv/securitydialogs/Autolock/autolockuseractivityservice"  -I"E:/sf/mw/securitysrv/securitydialogs/Autolock/autolockuseractivityservice/inc"  -I"E:/epoc32/include/platform/mw"  -I"E:/epoc32/include/platform"  -I"E:/epoc32/include/app"  -I"E:/epoc32/include/platform/app"  -I"E:/epoc32/include/platform/loc"  -I"E:/epoc32/include/platform/mw/loc"  -I"E:/epoc32/include/platform/app/loc"  -I"E:/epoc32/include/platform/loc/sc"  -I"E:/epoc32/include/platform/mw/loc/sc"  -I"E:/epoc32/include/platform/app/loc/sc"  -I"E:/sf/mw/securitysrv/securitydialogs/Autolock/autolockuseractivityservice/s60/inc"  -I"E:/epoc32/include/stdapis/stlportv5"  -I"E:/sf/mw/securitysrv/securitydialogs/Autolock/autolockuseractivityservice/s60/src"  -I"E:/sf/mw/securitysrv/securitydialogs/Autolock/autolockuseractivityservice/src" -DSYMBIAN e:/sf/mw/securitysrv/securitydialogs/Autolock/autolockuseractivityservice/inc/autolockuseractivityserviceinterface.h -o e:/sf/mw/securitysrv/securitydialogs/Autolock/autolockuseractivityservice/moc_autolockuseractivityserviceinterface.cpp
+END
+
+#if defined(WINSCW)
+#endif
+
+START EXTENSION qt/qmake_store_build
+END
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/autolockuseractivityservice/bwins/autolockuseractivityserviceu.def	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,16 @@
+EXPORTS
+	?trUtf8@AutolockUserActivityService@@SA?AVQString@@PBD0H@Z @ 1 NONAME ; class QString AutolockUserActivityService::trUtf8(char const *, char const *, int)
+	?tr@AutolockUserActivityService@@SA?AVQString@@PBD0@Z @ 2 NONAME ; class QString AutolockUserActivityService::tr(char const *, char const *)
+	?trUtf8@AutolockUserActivityService@@SA?AVQString@@PBD0@Z @ 3 NONAME ; class QString AutolockUserActivityService::trUtf8(char const *, char const *)
+	?getStaticMetaObject@AutolockUserActivityService@@SAABUQMetaObject@@XZ @ 4 NONAME ; struct QMetaObject const & AutolockUserActivityService::getStaticMetaObject(void)
+	?setInactivityPeriod@AutolockUserActivityService@@UAEXH@Z @ 5 NONAME ; void AutolockUserActivityService::setInactivityPeriod(int)
+	?tr@AutolockUserActivityService@@SA?AVQString@@PBD0H@Z @ 6 NONAME ; class QString AutolockUserActivityService::tr(char const *, char const *, int)
+	?qt_metacast@AutolockUserActivityService@@UAEPAXPBD@Z @ 7 NONAME ; void * AutolockUserActivityService::qt_metacast(char const *)
+	??1AutolockUserActivityService@@UAE@XZ @ 8 NONAME ; AutolockUserActivityService::~AutolockUserActivityService(void)
+	?qt_metacall@AutolockUserActivityService@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 9 NONAME ; int AutolockUserActivityService::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?inactivityPeriod@AutolockUserActivityService@@UBEHXZ @ 10 NONAME ; int AutolockUserActivityService::inactivityPeriod(void) const
+	??0AutolockUserActivityService@@QAE@XZ @ 11 NONAME ; AutolockUserActivityService::AutolockUserActivityService(void)
+	??_EAutolockUserActivityService@@UAE@I@Z @ 12 NONAME ; AutolockUserActivityService::~AutolockUserActivityService(unsigned int)
+	?staticMetaObject@AutolockUserActivityService@@2UQMetaObject@@B @ 13 NONAME ; struct QMetaObject const AutolockUserActivityService::staticMetaObject
+	?metaObject@AutolockUserActivityService@@UBEPBUQMetaObject@@XZ @ 14 NONAME ; struct QMetaObject const * AutolockUserActivityService::metaObject(void) const
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/autolockuseractivityservice/common.pri	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,66 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: screensaverapp project - common QMake settings
+#
+
+CONFIG += debug_and_release
+
+# On win32 and mac, debug and release libraries are named differently.
+# We must follow the debug and release settings Qt was compiled with:
+# build debug iff Qt built debug, build release iff Qt built release.
+win32|mac {
+    !contains(QT_CONFIG,debug)|!contains(QT_CONFIG,release) {
+        CONFIG -= debug_and_release debug release
+        contains(QT_CONFIG,debug):  CONFIG+=debug
+        contains(QT_CONFIG,release):CONFIG+=release
+    }
+}
+
+CONFIG(debug, debug|release) {
+    SUBDIRPART = debug
+} else {
+    SUBDIRPART = release
+}
+
+SOURCE_DIR = $$PWD/inc
+
+DESTDIR = $$OUTPUT_DIR
+
+# Add the output dirs to the link path too
+LIBS += -L$$DESTDIR
+
+DEPENDPATH += . $$SOURCE_DIR
+INCLUDEPATH += . $$SOURCE_DIR
+#For some reason the default include path doesn't include MOC_DIR on symbian
+symbian {
+    INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+    TARGET.CAPABILITY = ALL -TCB
+    TARGET.EPOCALLOWDLLDATA=1
+}
+
+
+plugin: !isEmpty(PLUGIN_SUBDIR): DESTDIR = $$OUTPUT_DIR/$$PLUGIN_SUBDIR
+
+symbian: plugin { # copy qtstub and manifest
+    pluginstub.sources = $${TARGET}.dll
+    pluginstub.path = $$PLUGIN_SUBDIR
+
+    DEPLOYMENT += pluginstub
+
+    qtplugins.path = $$PLUGIN_SUBDIR
+    qtplugins.sources += qmakepluginstubs/$${TARGET}.qtplugin
+    qtplugins.sources += resource/$${TARGET}.manifest
+
+    for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin z:$$qtplugins.path/$$basename(qtplugin)"
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/autolockuseractivityservice/eabi/autolockuseractivityserviceu.def	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,16 @@
+EXPORTS
+	_ZN27AutolockUserActivityService11qt_metacallEN11QMetaObject4CallEiPPv @ 1 NONAME
+	_ZN27AutolockUserActivityService11qt_metacastEPKc @ 2 NONAME
+	_ZN27AutolockUserActivityService16staticMetaObjectE @ 3 NONAME DATA 16
+	_ZN27AutolockUserActivityService19getStaticMetaObjectEv @ 4 NONAME
+	_ZN27AutolockUserActivityService19setInactivityPeriodEi @ 5 NONAME
+	_ZN27AutolockUserActivityServiceC1Ev @ 6 NONAME
+	_ZN27AutolockUserActivityServiceC2Ev @ 7 NONAME
+	_ZN27AutolockUserActivityServiceD0Ev @ 8 NONAME
+	_ZN27AutolockUserActivityServiceD1Ev @ 9 NONAME
+	_ZN27AutolockUserActivityServiceD2Ev @ 10 NONAME
+	_ZNK27AutolockUserActivityService10metaObjectEv @ 11 NONAME
+	_ZNK27AutolockUserActivityService16inactivityPeriodEv @ 12 NONAME
+	_ZTI27AutolockUserActivityService @ 13 NONAME
+	_ZTV27AutolockUserActivityService @ 14 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/autolockuseractivityservice/inc/autolockuseractivityservice.h	Tue Aug 31 16:04:40 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: autolockuseractivityservice.h
+*
+*/
+
+#ifndef AUTOLOCKAUTOLOCKUSERACTIVITYSERVICE_H
+#define AUTOLOCKAUTOLOCKUSERACTIVITYSERVICE_H
+
+#include "autolockuseractivityserviceinterface.h"
+#include "autolockuseractivityservice_global.h"
+
+class AutolockUserActivityServicePrivate;
+
+class AUTOLOCKUSERACTIVITYSERVICE_EXPORT AutolockUserActivityService : public AutolockUserActivityServiceInterface
+{
+    Q_OBJECT
+
+public:
+
+    explicit AutolockUserActivityService(/*QObject *parent = 0*/);
+    ~AutolockUserActivityService();
+
+    virtual void setInactivityPeriod(int seconds);
+    virtual int inactivityPeriod() const;
+
+private:
+
+    //virtual void connectNotify(const char *signal);
+    //virtual void disconnectNotify(const char *signal);
+
+    //bool receiversConnected();
+
+    Q_DISABLE_COPY(AutolockUserActivityService)
+
+private:
+
+    AutolockUserActivityServicePrivate *m_d;
+    friend class AutolockUserActivityServicePrivate;
+
+};
+
+#endif // AUTOLOCKAUTOLOCKUSERACTIVITYSERVICE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/autolockuseractivityservice/inc/autolockuseractivityservice_global.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: autolockuseractivityservice_global.h
+*
+*/
+
+
+#ifndef AUTOLOCKAUTOLOCKUSERACTIVITYSERVICE_GLOBAL_H
+#define AUTOLOCKAUTOLOCKUSERACTIVITYSERVICE_GLOBAL_H
+
+#include <qglobal.h>
+
+#ifdef AUTOLOCKUSERACTIVITYSERVICE_LIB
+    #define AUTOLOCKUSERACTIVITYSERVICE_EXPORT Q_DECL_EXPORT
+#else
+    #ifdef AUTOLOCKUSERACTIVITYSERVICE_TEST
+        #define AUTOLOCKUSERACTIVITYSERVICE_EXPORT
+    #else
+        #define AUTOLOCKUSERACTIVITYSERVICE_EXPORT Q_DECL_IMPORT
+    #endif
+#endif
+
+#endif // AUTOLOCKAUTOLOCKUSERACTIVITYSERVICE_GLOBAL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/autolockuseractivityservice/inc/autolockuseractivityserviceinterface.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: autolockuseractivityserviceinterface.h
+*
+*/
+
+#ifndef AUTOLOCKUSERACTIVITYSERVICEINTERFACE_H
+#define AUTOLOCKUSERACTIVITYSERVICEINTERFACE_H
+
+#include <QObject>
+
+class AutolockUserActivityServiceInterface : public QObject
+{
+    Q_OBJECT
+
+public:
+
+    virtual void setInactivityPeriod(int seconds) = 0;
+    virtual int inactivityPeriod() const = 0;
+
+signals:
+
+    void notActive();
+    void active();
+
+};
+
+#endif // AUTOLOCKUSERACTIVITYSERVICEINTERFACE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/autolockuseractivityservice/s60/inc/autolockuseractivityservice_p.h	Tue Aug 31 16:04:40 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: autolockuseractivityservice_p.h
+*
+*/
+
+#ifndef AUTOLOCKUSERACTIVITYSERVICEPRIVATE_H
+#define AUTOLOCKUSERACTIVITYSERVICEPRIVATE_H
+
+class CUserActivityManager;
+
+class AutolockUserActivityService;
+
+class AutolockUserActivityServicePrivate
+{
+
+public:
+
+    explicit AutolockUserActivityServicePrivate(AutolockUserActivityService *servicePublic);
+    ~AutolockUserActivityServicePrivate();
+
+    void setInactivityPeriod(int seconds);
+    int inactivityPeriod() const;
+
+    void watch(bool shouldWatch);
+    
+    void emitActive() const;
+    void emitNotActive() const;
+
+private:
+
+    bool isWatching() const;
+
+private:
+
+    AutolockUserActivityService *m_q;
+
+    CUserActivityManager *mActivityManager;
+    int mInactivityPeriod;
+
+};
+
+#endif // AUTOLOCKUSERACTIVITYSERVICEPRIVATE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/autolockuseractivityservice/s60/src/autolockuseractivityservice_p.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,143 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: autolockuseractivityservice_p.cpp
+*
+*/
+
+#include "autolockuseractivityservice.h"
+#include "autolockuseractivityservice_p.h"
+#include <e32debug.h>
+
+#include <activitymanager.h>
+
+const int lDefaultInactivityPeriod(5);
+
+// ======== LOCAL FUNCTIONS ========
+
+/*!
+    Called as callback to activity event.
+    \param pointer to activity callback object.
+    \retval error code.    
+*/
+TInt activityCallback(TAny *ptr)
+{
+	RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
+
+    static_cast<AutolockUserActivityServicePrivate *>(ptr)->emitActive();
+    // activity manager doesn't care about the return value,
+    // we return a value indicating 'true' to be elegant (see CIdle)
+    return 1;
+}
+
+/*!
+    Called as callback to inactivity event.
+    \param pointer to inactivity callback object.
+    \retval error code.    
+*/
+TInt inactivityCallback(TAny *ptr)
+{
+	RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
+
+    static_cast<AutolockUserActivityServicePrivate *>(ptr)->emitNotActive();
+    // activity manager doesn't care about the return value,
+    // we return a value indicating 'true' to be elegant (see CIdle)
+    return 1;
+}
+
+// ======== MEMBER FUNCTIONS ========
+
+/*!
+    Constructor.
+    \param servicePublic public implementation.
+*/
+AutolockUserActivityServicePrivate::AutolockUserActivityServicePrivate(AutolockUserActivityService *servicePublic) :
+    m_q(servicePublic), mActivityManager(0), mInactivityPeriod(lDefaultInactivityPeriod)
+{
+    mActivityManager = CUserActivityManager::NewL(CActive::EPriorityStandard);
+}
+
+/*!
+    Destructor.
+*/
+AutolockUserActivityServicePrivate::~AutolockUserActivityServicePrivate()
+{
+    delete mActivityManager;
+}
+
+/*!
+    Sets the inactivity period after which to emit signal of inactivity.
+    \param seconds after which inactivity is detected.
+*/
+void AutolockUserActivityServicePrivate::setInactivityPeriod(int seconds)
+{
+	RDebug::Printf( "%s %s (%u) seconds=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, seconds );
+
+    mInactivityPeriod = seconds;
+    // activity manager panics if timeout set before start
+    if (isWatching())
+    {
+        mActivityManager->SetInactivityTimeout(TTimeIntervalSeconds(mInactivityPeriod));   
+    }
+}
+
+/*!
+    Retrives the current inactivity period setting.
+    \retval inactivity period set.
+*/
+int AutolockUserActivityServicePrivate::inactivityPeriod() const
+{
+    return mInactivityPeriod;
+}
+
+/*!
+    Starts or stops activity manager user activity watching.
+    \param shouldWatch determines if we shoul start watching or stop watching.
+*/
+void AutolockUserActivityServicePrivate::watch(bool shouldWatch)
+{
+	RDebug::Printf( "%s %s (%u) shouldWatch=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, shouldWatch );
+    if (shouldWatch && !isWatching()) {
+        mActivityManager->Start(
+                TTimeIntervalSeconds(mInactivityPeriod),
+                TCallBack(inactivityCallback, this),
+                TCallBack(activityCallback, this));
+    } else if (!shouldWatch && isWatching()) {
+        mActivityManager->Cancel();
+    }
+}
+
+/*!
+    Checks if activity service is currently watching for user activity.
+    \retval true if user acitivity service is active.
+*/
+bool AutolockUserActivityServicePrivate::isWatching() const
+{
+    return mActivityManager && mActivityManager->IsActive();
+}
+
+/*!
+    Emits signal that user is active.
+*/
+void AutolockUserActivityServicePrivate::emitActive() const
+{
+    emit m_q->active();
+}
+
+/*!
+    Emits signal that user is not active.
+*/
+void AutolockUserActivityServicePrivate::emitNotActive() const
+{
+    emit m_q->notActive();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/autolockuseractivityservice/src/autolockuseractivityservice.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: autolockuseractivityservice.cpp
+*
+*/
+
+#include "autolockuseractivityservice.h"
+#include "autolockuseractivityservice_p.h"
+
+/*!
+    \class AutolockUserActivityService
+    \brief ?brier_description
+
+    ?Qt_style_documentation 
+*/
+
+// ======== MEMBER FUNCTIONS ========
+
+/*!
+    Constructor.
+*/
+AutolockUserActivityService::AutolockUserActivityService() :
+    m_d(new AutolockUserActivityServicePrivate(this))
+{
+    m_d->watch(true);
+}
+
+/*!
+    Destructor.
+*/
+AutolockUserActivityService::~AutolockUserActivityService()
+{
+    delete m_d;
+}
+
+/*!
+    Sets the inactivity period after which to emit signal of inactivity.
+    \param seconds after which inactivity is detected.
+*/
+void AutolockUserActivityService::setInactivityPeriod(int seconds)
+{
+    m_d->setInactivityPeriod(seconds);
+}
+
+/*!
+    Retrives the current inactivity period setting.
+    \retval inactivity period set.
+*/
+int AutolockUserActivityService::inactivityPeriod() const
+{
+    return m_d->inactivityPeriod();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/autolockuseractivityservice/stub/inc/autolockuseractivityservice_p.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: autolockuseractivityservice_p.h
+*
+*/
+
+#ifndef AUTOLOCKUSERACTIVITYSERVICEPRIVATE_H
+#define AUTOLOCKUSERACTIVITYSERVICEPRIVATE_H
+
+#include "autolocktest_global.h"
+
+class QTimer;
+
+class AutolockUserActivityService;
+
+class AutolockUserActivityServicePrivate
+{
+
+public:
+
+    explicit AutolockUserActivityServicePrivate(AutolockUserActivityService *servicePublic);
+    ~AutolockUserActivityServicePrivate();
+
+    void setInactivityPeriod(int seconds);
+    int inactivityPeriod() const;
+
+    void watch(bool shouldWatch);
+
+private:
+
+    bool isWatching() const;
+
+private:
+
+    AutolockUserActivityService *m_q;
+
+    QTimer *mActivityTimer;
+    QTimer *mInactivityTimer;
+
+    int mInactivityPeriod;
+    SCREENSAVER_TEST_FRIEND_CLASS(T_AutolockUserActivityService)
+};
+
+#endif // AUTOLOCKUSERACTIVITYSERVICEPRIVATE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/autolockuseractivityservice/stub/src/autolockuseractivityservice_p.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: autolockuseractivityservice_p.cpp
+*
+*/
+
+#include "autolockuseractivityservice.h"
+#include "autolockuseractivityservice_p.h"
+
+#include <QTimer>
+#include <QObject>
+
+// ======== MEMBER FUNCTIONS ========
+
+/*!
+    Constructor.
+    \param servicePublic public implementation.
+*/
+AutolockUserActivityServicePrivate::AutolockUserActivityServicePrivate(AutolockUserActivityService *servicePublic) :
+    m_q(servicePublic), mInactivityPeriod(9)
+{
+    mActivityTimer = new QTimer();
+    QObject::connect(mActivityTimer, SIGNAL(timeout()), m_q, SIGNAL(active()));
+
+    mInactivityTimer = new QTimer();
+    QObject::connect(mInactivityTimer, SIGNAL(timeout()), m_q, SIGNAL(notActive()));
+}
+
+/*!
+    Destructor.
+*/
+AutolockUserActivityServicePrivate::~AutolockUserActivityServicePrivate()
+{
+    delete mActivityTimer;
+    delete mInactivityTimer;
+}
+
+/*!
+    Sets the inactivity period after which to emit signal of inactivity.
+    \param seconds after which inactivity is detected.
+*/
+void AutolockUserActivityServicePrivate::setInactivityPeriod(int seconds)
+{
+    mInactivityPeriod = seconds;
+    if (isWatching()) {
+        mInactivityTimer->start(seconds * 1000);
+    }
+}
+
+/*!
+    Retrives the current inactivity period setting.
+    \retval inactivity period set.
+*/
+int AutolockUserActivityServicePrivate::inactivityPeriod() const
+{
+    return mInactivityPeriod;
+}
+
+/*!
+    Starts or stops activity manager user activity watching.
+    \param shouldWatch determines if we shoul start watching or stop watching.
+*/
+void AutolockUserActivityServicePrivate::watch(bool shouldWatch)
+{
+    if (shouldWatch && !isWatching()) {
+        mActivityTimer->start(5000);
+        mInactivityTimer->start(mInactivityPeriod * 1000);
+    } else if (!shouldWatch && isWatching()) {
+        mActivityTimer->stop();
+        mInactivityTimer->stop();
+    }
+}
+
+/*!
+    Checks if activity service is currently watching for user activity.
+    \retval true if user acitivity service is active.
+*/
+bool AutolockUserActivityServicePrivate::isWatching() const
+{
+    return (mActivityTimer->isActive() || mInactivityTimer->isActive());
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/bld.inf	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,794 @@
+// ============================================================================
+// * Makefile for building: Autolock
+// * Generated by qmake (2.01a) (Qt 4.7.0) on: 2010-08-07T17:22:57
+// * This file is generated by qmake and should not be modified by the
+// * user.
+// * Project:  Autolock.pro
+// * Template: app
+// ============================================================================
+
+#define BLD_INF_AUTOLOCK_04D793A7
+
+
+prj_platforms
+
+WINSCW GCCE ARMV5 ARMV6
+
+
+prj_mmpfiles
+
+Autolock_0x100059B5.mmp
+
+prj_extensions
+
+START EXTENSION qt/qmake_extra_pre_targetdep.export
+OPTION PREDEP_TARGET A:/sf/mw/securitysrv/securitydialogs/Autolock/moc_Autolock.cpp
+OPTION DEPS A:/sf/mw/securitysrv/securitydialogs/SecUi/Inc/SecQueryUi.h A:/sf/mw/securitysrv/securitydialogs/Autolock/src/Autolock.h 
+OPTION COMMAND /epoc32/tools/moc.exe  -DSYMBIAN  -DUNICODE -DQT_KEYPAD_NAVIGATION -DQT_SOFTKEYS_ENABLED -DQT_USE_MATH_H_FLOATS -DHB_HAVE_QT_MOBILITY -DHB_HAVE_PROTECTED_CHUNK -DHB_TOUCHFEEDBACK_TYPE_IS_LONGPRESS -DHB_GESTURE_FW -DHB_EFFECTS -DHB_TEXT_MEASUREMENT_UTILITY -DHB_HAVE_QT_MOBILITY -DHB_HAVE_PROTECTED_CHUNK -DHB_TOUCHFEEDBACK_TYPE_IS_LONGPRESS -DHB_GESTURE_FW -DHB_EFFECTS -DHB_TEXT_MEASUREMENT_UTILITY -DQT_SVG_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB  -I"A:/epoc32/include/mw/QtCore"  -I"A:/epoc32/include/mw/QtNetwork"  -I"A:/epoc32/include/mw/QtGui"  -I"A:/epoc32/include/mw/QtSvg"  -I"A:/epoc32/include/mw"  -I"A:/epoc32/include/mw/QtPublishSubscribe"  -I"A:/sf/mw/qt/mkspecs/common/symbian"  -I"A:/epoc32/include"  -I"A:/epoc32/include/stdapis"  -I"A:/epoc32/include/stdapis/sys"  -I"A:/epoc32/include/platform/mw"  -I"A:/epoc32/include/platform"  -I"A:/epoc32/include/platform/loc"  -I"A:/epoc32/include/platform/mw/loc"  -I"A:/epoc32/include/platform/loc/sc"  -I"A:/epoc32/include/platform/mw/loc/sc"  -I"A:/sf/mw/securitysrv/securitydialogs/Autolock"  -I"A:/sf/mw/securitysrv/securitydialogs/Autolock/inc"  -I"A:/sf/mw/securitysrv/securitydialogs/Autolock/autolockuseractivityservice"  -I"A:/sf/mw/securitysrv/securitydialogs/Autolock/autolockuseractivityservice/inc"  -I"A:/QtPublishSubscribe"  -I"A:/epoc32/include/mw/hb/hbcore"  -I"A:/epoc32/include/mw/hb/hbwidgets"  -I"A:/epoc32/include/mw/hb/hbutils"  -I"A:/epoc32/include/stdapis/stlportv5"  -I"A:/sf/mw/securitysrv/securitydialogs/Autolock/src" -DSYMBIAN a:/sf/mw/securitysrv/securitydialogs/Autolock/src/Autolock.h -o a:/sf/mw/securitysrv/securitydialogs/Autolock/moc_Autolock.cpp
+END
+START EXTENSION qt/qmake_extra_pre_targetdep.export
+OPTION PREDEP_TARGET A:/sf/mw/securitysrv/securitydialogs/Autolock/qrc_Autolock.cpp
+OPTION DEPS A:/sf/mw/securitysrv/securitydialogs/Autolock/Autolock.qrc A:/sf/mw/securitysrv/securitydialogs/Autolock/iconnotifier.svg A:/sf/mw/securitysrv/securitydialogs/Autolock/qtg_large_device_lock.svg 
+OPTION COMMAND /epoc32/tools/rcc.exe -name Autolock a:/sf/mw/securitysrv/securitydialogs/Autolock/Autolock.qrc -o a:/sf/mw/securitysrv/securitydialogs/Autolock/qrc_Autolock.cpp
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_ar.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_ar.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_ar.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_ar.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_ar.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_ar.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_eu.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_eu.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_eu.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_eu.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_eu.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_eu.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_bg.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_bg.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_bg.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_bg.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_bg.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_bg.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_ca.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_ca.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_ca.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_ca.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_ca.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_ca.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_hr.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_hr.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_hr.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_hr.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_hr.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_hr.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_cs.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_cs.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_cs.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_cs.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_cs.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_cs.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_da.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_da.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_da.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_da.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_da.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_da.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_nl.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_nl.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_nl.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_nl.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_nl.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_nl.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_en.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_en.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_en.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_en.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_en.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_en.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_en_US.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_en_US.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_en_US.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_en_US.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_en_US.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_en_US.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_et.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_et.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_et.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_et.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_et.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_et.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_fi.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_fi.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_fi.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_fi.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_fi.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_fi.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_fr.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_fr.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_fr.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_fr.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_fr.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_fr.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_fr_CA.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_fr_CA.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_fr_CA.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_fr_CA.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_fr_CA.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_fr_CA.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_gl.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_gl.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_gl.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_gl.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_gl.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_gl.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_de.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_de.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_de.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_de.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_de.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_de.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_el.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_el.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_el.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_el.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_el.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_el.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_he.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_he.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_he.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_he.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_he.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_he.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_hi.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_hi.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_hi.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_hi.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_hi.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_hi.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_zh_HK.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_zh_HK.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_zh_HK.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_zh_HK.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_zh_HK.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_zh_HK.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_hu.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_hu.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_hu.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_hu.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_hu.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_hu.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_is.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_is.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_is.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_is.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_is.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_is.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_id.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_id.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_id.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_id.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_id.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_id.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_it.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_it.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_it.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_it.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_it.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_it.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_ja.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_ja.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_ja.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_ja.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_ja.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_ja.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_ko.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_ko.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_ko.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_ko.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_ko.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_ko.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_lv.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_lv.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_lv.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_lv.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_lv.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_lv.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_lt.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_lt.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_lt.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_lt.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_lt.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_lt.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_ms.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_ms.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_ms.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_ms.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_ms.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_ms.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_no.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_no.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_no.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_no.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_no.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_no.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_pl.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_pl.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_pl.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_pl.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_pl.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_pl.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_pt.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_pt.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_pt.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_pt.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_pt.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_pt.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_pt_BR.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_pt_BR.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_pt_BR.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_pt_BR.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_pt_BR.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_pt_BR.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_zh.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_zh.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_zh.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_zh.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_zh.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_zh.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_ro.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_ro.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_ro.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_ro.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_ro.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_ro.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_ru.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_ru.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_ru.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_ru.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_ru.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_ru.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_sr.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_sr.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_sr.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_sr.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_sr.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_sr.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_sk.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_sk.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_sk.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_sk.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_sk.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_sk.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_sl.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_sl.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_sl.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_sl.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_sl.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_sl.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_es.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_es.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_es.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_es.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_es.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_es.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_es_419.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_es_419.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_es_419.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_es_419.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_es_419.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_es_419.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_sv.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_sv.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_sv.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_sv.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_sv.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_sv.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_tl.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_tl.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_tl.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_tl.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_tl.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_tl.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_zh_TW.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_zh_TW.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_zh_TW.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_zh_TW.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_zh_TW.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_zh_TW.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_th.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_th.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_th.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_th.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_th.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_th.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_tr.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_tr.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_tr.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_tr.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_tr.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_tr.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_uk.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_uk.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_uk.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_uk.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_uk.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_uk.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_ur.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_ur.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_ur.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_ur.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_ur.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_ur.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_vi.ts
+OPTION QMFILE /epoc32/data/z/resource/qt/translations/calwidget_vi.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_vi.ts
+OPTION QMFILE /epoc32/release/winscw/udeb/z/resource/qt/translations/calwidget_vi.qm
+END
+
+START EXTENSION qt/ts2qm
+OPTION TSFILE /epoc32/include/platform/qt/translations/calwidget_vi.ts
+OPTION QMFILE /epoc32/release/winscw/urel/z/resource/qt/translations/calwidget_vi.qm
+END
+
+#if defined(WINSCW)
+START EXTENSION qt/qmake_emulator_deployment
+OPTION DEPLOY_SOURCE a:/sf/mw/securitysrv/securitydialogs/Autolock/autolock.qcrml
+OPTION DEPLOY_TARGET A:/epoc32/winscw/c/resource/qt/crml/autolock.qcrml
+END
+#endif
+START EXTENSION qt/qmake_emulator_deployment
+OPTION DEPLOY_SOURCE a:/sf/mw/securitysrv/securitydialogs/Autolock/autolock.qcrml
+OPTION DEPLOY_TARGET A:/epoc32/data/z/resource/qt/crml/autolock.qcrml
+END
+
+START EXTENSION qt/qmake_store_build
+END
+
+
+
+
+prj_exports
+
+./rom/Autolock.iby CORE_APP_LAYER_IBY_EXPORT_PATH(Autolock.iby)
+./conf/Autolock.confml MW_LAYER_CONFML(Autolock.confml)
+./conf/lock.confml MW_LAYER_CONFML(lock.confml)
+./rom/AutolockSrv.iby CORE_APP_LAYER_IBY_EXPORT_PATH(AutolockSrv.iby)
+./PubSub/SecurityUIsPrivatePSKeys.h |../../inc/securityuisprivatepskeys.h
+./conf/lock_10283322.crml MW_LAYER_CRML(lock_10283322.crml)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/bwins/autolockuseractivityserviceu.def	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,16 @@
+EXPORTS
+	?trUtf8@AutolockUserActivityService@@SA?AVQString@@PBD0H@Z @ 1 NONAME ; class QString AutolockUserActivityService::trUtf8(char const *, char const *, int)
+	?tr@AutolockUserActivityService@@SA?AVQString@@PBD0@Z @ 2 NONAME ; class QString AutolockUserActivityService::tr(char const *, char const *)
+	?trUtf8@AutolockUserActivityService@@SA?AVQString@@PBD0@Z @ 3 NONAME ; class QString AutolockUserActivityService::trUtf8(char const *, char const *)
+	?getStaticMetaObject@AutolockUserActivityService@@SAABUQMetaObject@@XZ @ 4 NONAME ; struct QMetaObject const & AutolockUserActivityService::getStaticMetaObject(void)
+	?setInactivityPeriod@AutolockUserActivityService@@UAEXH@Z @ 5 NONAME ; void AutolockUserActivityService::setInactivityPeriod(int)
+	?tr@AutolockUserActivityService@@SA?AVQString@@PBD0H@Z @ 6 NONAME ; class QString AutolockUserActivityService::tr(char const *, char const *, int)
+	?qt_metacast@AutolockUserActivityService@@UAEPAXPBD@Z @ 7 NONAME ; void * AutolockUserActivityService::qt_metacast(char const *)
+	??1AutolockUserActivityService@@UAE@XZ @ 8 NONAME ; AutolockUserActivityService::~AutolockUserActivityService(void)
+	?qt_metacall@AutolockUserActivityService@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 9 NONAME ; int AutolockUserActivityService::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?inactivityPeriod@AutolockUserActivityService@@UBEHXZ @ 10 NONAME ; int AutolockUserActivityService::inactivityPeriod(void) const
+	??0AutolockUserActivityService@@QAE@XZ @ 11 NONAME ; AutolockUserActivityService::AutolockUserActivityService(void)
+	??_EAutolockUserActivityService@@UAE@I@Z @ 12 NONAME ; AutolockUserActivityService::~AutolockUserActivityService(unsigned int)
+	?staticMetaObject@AutolockUserActivityService@@2UQMetaObject@@B @ 13 NONAME ; struct QMetaObject const AutolockUserActivityService::staticMetaObject
+	?metaObject@AutolockUserActivityService@@UBEPBUQMetaObject@@XZ @ 14 NONAME ; struct QMetaObject const * AutolockUserActivityService::metaObject(void) const
+
Binary file securitydialogs/Autolock/conf/autolock.confml has changed
Binary file securitydialogs/Autolock/conf/autolock_102824AE.crml has changed
--- a/securitydialogs/Autolock/data/Autolock.rss	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +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 Autolock.
-*     
-*
-*/
-
-
-//  RESOURCE IDENTIFIER
-NAME    ALCK // 4 letter ID
-
-//  INCLUDES
-
-#include <eikon.rh>
-#include "autolock.hrh"
-#include <autolock.loc>
-#include "eikon.rsg"
-#include <avkon.rsg>
-#include <avkon.rh>
-#include <avkon.loc>
-#include <avkon.mbg>
-#include <autolock.mbg>
-
-
-//  RESOURCE DEFINITIONS 
-
-RESOURCE RSS_SIGNATURE { }
-
-RESOURCE TBUF { buf=""; }
-
-RESOURCE EIK_APP_INFO
-	{
-	status_pane = r_autolock_status_pane;
-	}
-
-RESOURCE STATUS_PANE_APP_MODEL r_autolock_status_pane
-    {
-    layout = R_AVKON_STATUS_PANE_LAYOUT_IDLE;
-    panes =
-        {
-        SPANE_PANE
-            {
-            id = EEikStatusPaneUidTitle;
-            type = EAknCtTitlePane;
-            resource = r_title_pane_locked;
-            }
-        };
-    }
-
-
-RESOURCE AVKON_VIEW r_locked_view
-	{
-	}
-
-
-
-RESOURCE CBA r_autolock_softkeys_unlock_empty
-    {
-    buttons = 
-        {
-        CBA_BUTTON{id=ESecUiCmdUnlock; txt= qtn_set_sec_unlock_system; },
-        CBA_BUTTON{id=EAknSoftkeyEmpty; txt=text_softkey_empty; },
-        CBA_BUTTON{id=EAknSoftkeyEmpty; txt=text_softkey_empty; }
-        };    
-    }
-
-
-RESOURCE TITLE_PANE r_title_pane_locked
-	{
-	txt = qtn_set_sec_title_locked;
-	}
-
-
-
-RESOURCE DIALOG r_emergency
-	{
-	flags = EEikDialogFlagNoDrag | EEikDialogFlagNoTitleBar |
-            EEikDialogFlagCbaButtons;
-	buttons=R_AVKON_SOFTKEYS_CANCEL;
-    items=
-		{
-		DLG_LINE
-			{
-	    	type=EAknCtNote;
-			id=EGeneralNote;
-			control= AVKON_NOTE 
-				{ 
-	                layout = EGeneralLayout;
-				};
-			}
-		};
-	}
-
-// end of file
--- a/securitydialogs/Autolock/data/Autolock_reg.rss	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +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:  RSS for creating the registration file for Autolock.
-*
-*/
-
-
-#include <appinfo.rh>
-#include <Autolock.rsg>
-
-
-UID2 KUidAppRegistrationResourceFile
-UID3 0x100059B5 // application UID
-RESOURCE APP_REGISTRATION_INFO
-	{
-	app_file="Autolock"; // filename of application binary (minus extension)
-    hidden = KAppIsHidden;
-	embeddability = KAppNotEmbeddable;
-	newfile = KAppDoesNotSupportNewFile;
-	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/eabi/autolockuseractivityserviceu.def	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,16 @@
+EXPORTS
+	_ZN27AutolockUserActivityService11qt_metacallEN11QMetaObject4CallEiPPv @ 1 NONAME
+	_ZN27AutolockUserActivityService11qt_metacastEPKc @ 2 NONAME
+	_ZN27AutolockUserActivityService16staticMetaObjectE @ 3 NONAME DATA 16
+	_ZN27AutolockUserActivityService19getStaticMetaObjectEv @ 4 NONAME
+	_ZN27AutolockUserActivityService19setInactivityPeriodEi @ 5 NONAME
+	_ZN27AutolockUserActivityServiceC1Ev @ 6 NONAME
+	_ZN27AutolockUserActivityServiceC2Ev @ 7 NONAME
+	_ZN27AutolockUserActivityServiceD0Ev @ 8 NONAME
+	_ZN27AutolockUserActivityServiceD1Ev @ 9 NONAME
+	_ZN27AutolockUserActivityServiceD2Ev @ 10 NONAME
+	_ZNK27AutolockUserActivityService10metaObjectEv @ 11 NONAME
+	_ZNK27AutolockUserActivityService16inactivityPeriodEv @ 12 NONAME
+	_ZTI27AutolockUserActivityService @ 13 NONAME
+	_ZTV27AutolockUserActivityService @ 14 NONAME
+
--- a/securitydialogs/Autolock/group/Autolock.mmp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +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:  Makefile
-*     
-*
-*/
-
-#include <platform_paths.hrh>
-
-#include <data_caging_paths.hrh>
-
-TARGET      autolock.exe
-TARGETTYPE  exe
-epocstacksize 0x5000
-
-UID  0x100039CE 0x100059B5
-
-VENDORID        VID_DEFAULT
-CAPABILITY      CAP_APPLICATION NetworkControl
-
-MACRO __NO_DOS__
-
-SOURCEPATH ../src
-SOURCE  AutolockApp.cpp 
-SOURCE  AutolockAppUi.cpp
-SOURCE  AutolockDocument.cpp
-SOURCE	AutolockContainer.cpp
-SOURCE  AutoLockModel.cpp
-SOURCE  AutoLockCenRepI.cpp
-SOURCE	AutoLockLockObserver.cpp
-SOURCE	AutoLockValueObserver.cpp
-SOURCE	AutoLockView.cpp
-SOURCE	AutolockWait.cpp
-SOURCE	AutoKeyGuardCenRepI.cpp
-SOURCE	AutoKeyguardObserver.cpp
-SOURCE  AutolockGripStatusObserver.cpp
-SOURCE  AutolockFpsStatusObserver.cpp
-
-
-START RESOURCE ../data/Autolock.rss
-HEADER
-
-TARGETPATH APP_RESOURCE_DIR
-
-LANGUAGE_IDS
-END //RESOURCE
-
-
-//s60 Integration
-START RESOURCE ../data/Autolock_reg.rss
-DEPENDS autolock.rsg
-TARGETPATH /private/10003a3f/apps
-END
-
-//S60 Integration
-
-USERINCLUDE . ../inc ../CenRep
-
-APP_LAYER_SYSTEMINCLUDE
-SYSTEMINCLUDE ../../../inc
-
-LIBRARY euser.lib apparc.lib cone.lib eikcore.lib 
-LIBRARY eikcoctl.lib avkon.lib
-LIBRARY	activitymanager.lib
-LIBRARY	apgrfx.lib
-LIBRARY ws32.lib secui.lib commonengine.lib
-LIBRARY etel.lib etelmm.lib eikdlg.lib 
-LIBRARY	sysutil.lib
-LIBRARY aknlayout.lib
-LIBRARY aknskins.lib
-LIBRARY centralrepository.lib
-LIBRARY cenrepnotifhandler.lib
-LIBRARY aknlayout2scalable.lib
-LIBRARY aknlayout2.lib 
-LIBRARY featmgr.lib
-LIBRARY aknicon.lib
-LIBRARY fbscli.lib
-LIBRARY scpclient.lib
-LIBRARY gdi.lib
-LIBRARY aknnotify.lib
-LIBRARY     customapi.lib
-LIBRARY		   keylockpolicyapi.lib
-
-
-SMPSAFE
--- a/securitydialogs/Autolock/group/Autolock_Icons_dc.mk	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +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
-
-# ----------------------------------------------------------------------------
-# TARGET FILES: Configure these
-# ----------------------------------------------------------------------------
-
-TARGETDIR=$(ZDIR)\resource\apps
-ICONTARGETFILENAME=$(TARGETDIR)\autolock.mif
-
-HEADERDIR=\epoc32\include
-HEADERFILENAME=$(HEADERDIR)\autolock.mbg
-
-do_nothing :
-	@rem do_nothing
-
-MAKMAKE : do_nothing
-
-BLD : do_nothing
-
-CLEAN : do_nothing
-
-LIB : do_nothing
-
-CLEANLIB : do_nothing
-
-# ----------------------------------------------------------------------------
-# RESOURCE COMMAND: 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_graf_phone_locked /c8,8 qgn_indi_button_end_call \
-		
-
-FREEZE : do_nothing
-
-SAVESPACE : do_nothing
-
-RELEASABLES :
-	@echo $(HEADERFILENAME)&& \
-	@echo $(ICONTARGETFILENAME)
-
-FINAL : do_nothing
--- a/securitydialogs/Autolock/group/bld.inf	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +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 the information required for building
-*               the whole autolock.
-*
-*/
-
-
-#include <platform_paths.hrh>
-PRJ_PLATFORMS
-
-DEFAULT
-
-PRJ_EXPORTS
-//Configuration tool migration
-../conf/autolock.confml          MW_LAYER_CONFML(autolock.confml)
-../conf/autolock_102824AE.crml 	 MW_LAYER_CRML(autolock_102824ae.crml)
-../conf/lock.confml              MW_LAYER_CONFML(lock.confml)
-../conf/lock_10283322.crml 	     MW_LAYER_CRML(lock_10283322.crml)
-
-../rom/Autolock.iby CORE_MW_LAYER_IBY_EXPORT_PATH(autolock.iby)
-../rom/AutolockResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(autolockresources.iby)
-../loc/autolock.loc MW_LAYER_LOC_EXPORT_PATH(autolock.loc)
-// taken from lockapp
-// ../PubSub/SecurityUIsPrivatePSKeys.h |../../../inc/SecurityUIsPrivatePSKeys.h
-
-PRJ_MMPFILES
-../group/Autolock.mmp
-
-PRJ_EXTENSIONS
-START EXTENSION s60/mifconv
-OPTION TARGETFILE autolock.mif
-OPTION HEADERFILE autolock.mbg
-OPTION SOURCES -c8,8 qgn_graf_phone_locked -c8,8 qgn_indi_button_end_call
-END
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/iconnotifier.svg	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,260 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://web.resource.org/cc/"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="128"
+   height="128"
+   id="svg2606"
+   sodipodi:version="0.32"
+   inkscape:version="0.45+devel"
+   version="1.0"
+   sodipodi:docname="unknown.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   sodipodi:docbase="/home/david/Progetti/sandbox/svg/mimetypes">
+  <defs
+     id="defs2608">
+    <linearGradient
+       y2="0"
+       x2="28"
+       y1="57.5"
+       x1="28"
+       gradientUnits="userSpaceOnUse"
+       id="linearGradient2973">
+			<stop
+   id="stop2975"
+   style="stop-color:#2c72c7;stop-opacity:1;"
+   offset="0" />
+
+			<stop
+   id="stop2977"
+   style="stop-color:#0057ae;stop-opacity:1;"
+   offset="1" />
+
+		</linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2973"
+       id="linearGradient2086"
+       x1="86.43512"
+       y1="76.830994"
+       x2="22.813417"
+       y2="8.9537134"
+       gradientUnits="userSpaceOnUse" />
+    <linearGradient
+       id="linearGradient10207">
+      <stop
+         style="stop-color:#a2a2a2;stop-opacity:1;"
+         offset="0"
+         id="stop10209" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="1"
+         id="stop10211" />
+    </linearGradient>
+    <linearGradient
+       id="XMLID_12_"
+       gradientUnits="userSpaceOnUse"
+       x1="96"
+       y1="104"
+       x2="88.000198"
+       y2="96.000198">
+      <stop
+         offset="0"
+         style="stop-color:#888A85"
+         id="stop83" />
+      <stop
+         offset="0.0072"
+         style="stop-color:#8C8E89"
+         id="stop85" />
+      <stop
+         offset="0.0673"
+         style="stop-color:#ABACA9"
+         id="stop87" />
+      <stop
+         offset="0.1347"
+         style="stop-color:#C5C6C4"
+         id="stop89" />
+      <stop
+         offset="0.2652576"
+         style="stop-color:#DBDBDA"
+         id="stop91" />
+      <stop
+         offset="0.37646064"
+         style="stop-color:#EBEBEB"
+         id="stop93" />
+      <stop
+         offset="0.48740286"
+         style="stop-color:#F7F7F6"
+         id="stop95" />
+      <stop
+         offset="0.6324091"
+         style="stop-color:#FDFDFD"
+         id="stop97" />
+      <stop
+         offset="1"
+         style="stop-color:#FFFFFF"
+         id="stop99" />
+    </linearGradient>
+    <radialGradient
+       id="XMLID_8_"
+       cx="102"
+       cy="112.3047"
+       r="139.55859"
+       gradientUnits="userSpaceOnUse">
+      <stop
+         offset="0"
+         style="stop-color:#b7b8b9;stop-opacity:1;"
+         id="stop41" />
+      <stop
+         offset="0.18851049"
+         style="stop-color:#ECECEC"
+         id="stop47" />
+      <stop
+         offset="0.25718147"
+         style="stop-color:#FAFAFA"
+         id="stop49" />
+      <stop
+         offset="0.30111277"
+         style="stop-color:#FFFFFF"
+         id="stop51" />
+      <stop
+         offset="0.5313"
+         style="stop-color:#FAFAFA"
+         id="stop53" />
+      <stop
+         offset="0.8449"
+         style="stop-color:#EBECEC"
+         id="stop55" />
+      <stop
+         offset="1"
+         style="stop-color:#E1E2E3"
+         id="stop57" />
+    </radialGradient>
+    <filter
+       inkscape:collect="always"
+       x="-0.19200002"
+       width="1.3839999"
+       y="-0.19199999"
+       height="1.3839999"
+       id="filter6697">
+      <feGaussianBlur
+         inkscape:collect="always"
+         stdDeviation="1.9447689"
+         id="feGaussianBlur6699" />
+    </filter>
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath7084">
+      <path
+         style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+         d="M 72,88 L 40,120 L 32,120 L 32,80 L 72,80 L 72,88 z"
+         id="path7086" />
+    </clipPath>
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#XMLID_8_"
+       id="radialGradient9437"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1,0,0,0.9996653,2e-6,3.0160848e-3)"
+       cx="102"
+       cy="112.3047"
+       r="139.55859" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10207"
+       id="linearGradient10213"
+       x1="98.617439"
+       y1="106.41443"
+       x2="91.228737"
+       y2="99.254974"
+       gradientUnits="userSpaceOnUse" />
+    <filter
+       inkscape:collect="always"
+       id="filter2770">
+      <feGaussianBlur
+         inkscape:collect="always"
+         stdDeviation="2.0786429"
+         id="feGaussianBlur2772" />
+    </filter>
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="2.8284271"
+     inkscape:cx="64"
+     inkscape:cy="85.975621"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     width="128px"
+     height="128px"
+     gridspacingx="4px"
+     gridspacingy="4px"
+     gridempspacing="2"
+     showgrid="true"
+     inkscape:grid-points="true"
+     showguides="true"
+     inkscape:guide-bbox="true"
+     inkscape:window-width="1016"
+     inkscape:window-height="692"
+     inkscape:window-x="0"
+     inkscape:window-y="0" />
+  <metadata
+     id="metadata2611">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Livello 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <path
+       style="opacity:0.5;fill:#000000;fill-opacity:1;filter:url(#filter2770)"
+       d="M 16,8 L 16,120 C 16,120 79.15625,120 79.15625,120 L 79.1875,120 C 79.187503,120 91.09375,110.09375 96.59375,104.59375 C 102.09375,99.09375 112,87.1875 112,87.1875 L 112,87.15625 L 112,8 L 16,8 z"
+       id="path7865"
+       sodipodi:nodetypes="csccscccc"
+       transform="matrix(1.0416667,0,0,1.0267857,-2.6666667,-1.2142891)" />
+    <path
+       style="fill:#ffffff;fill-opacity:1"
+       d="M 16.000001,8 L 16,120 C 16,120 79.146418,120 79.146418,120 L 112,87.14642 L 112,8 L 16.000001,8 z"
+       id="path34"
+       sodipodi:nodetypes="cccccc" />
+    <path
+       style="fill:url(#radialGradient9437);fill-opacity:1"
+       d="M 18.000002,9.0000034 C 17.449002,9.0000034 17.000002,9.4488534 17.000002,9.9996684 L 17.000002,117.96352 C 17.000002,118.51533 17.449002,118.96318 18.000002,118.96318 L 77.171999,118.96318 C 77.434999,118.96318 79.934679,119.08131 80.12068,118.89438 L 110.707,88.094202 C 110.894,87.907264 111,85.40942 111,85.146508 L 111,9.9996684 C 111,9.4488534 110.552,9.0000034 110,9.0000034 L 18.000002,9.0000034 z"
+       id="path59"
+       sodipodi:nodetypes="ccccccccccc" />
+    <path
+       d="M 41.879531,115.98249 C 41.879531,115.98249 66.18914,91.672876 66.18914,91.672876 C 66.18914,91.672876 56.836,94.586 46.586,94.586 C 46.586,104.836 41.879531,115.98249 41.879531,115.98249 z"
+       id="path5540"
+       style="opacity:0.4;fill:#000000;fill-opacity:1;filter:url(#filter6697)"
+       sodipodi:nodetypes="cccc"
+       clip-path="url(#clipPath7084)"
+       transform="translate(40,0)" />
+    <path
+       style="fill:url(#linearGradient10213);fill-opacity:1"
+       id="path14523"
+       d="M 79.172,120 C 79.172,120 91.086,110.086 96.586,104.586 C 102.086,99.086 112,87.172 112,87.172 C 112,87.172 98.25,96 88,96 C 88,106.25 79.172,120 79.172,120 z"
+       sodipodi:nodetypes="csccc" />
+    <path
+       id="text2076"
+       d="M 62.842105,28 C 69.438566,28.00007 74.631544,30.070244 78.421053,34.210526 C 80.947326,37.017606 82.210485,40.386024 82.210528,44.315789 C 82.210485,49.157946 79.894696,54.596537 75.263159,60.631581 C 74.421018,61.684251 73.052597,63.368459 71.157895,65.684214 C 67.789444,69.89477 65.57892,74.807045 64.526316,80.421056 C 64.456114,80.912302 64.38594,81.40353 64.315789,81.89474 L 62.526315,81.89474 C 62.666642,76.491254 63.719273,71.508803 65.68421,66.947371 L 68.631579,60.210528 C 71.228037,54.245661 72.526282,48.771981 72.526316,43.789473 C 72.526282,39.228131 70.806986,35.684274 67.36842,33.157894 C 65.543832,31.824628 63.473658,31.157962 61.157895,31.157894 C 57.508752,31.157962 54.631562,32.280768 52.526315,34.526317 C 51.614021,35.579011 51.15788,36.631642 51.157894,37.684211 C 51.15788,38.315851 51.894722,39.543919 53.36842,41.368421 C 54.561386,42.982513 55.157877,44.350934 55.157894,45.473685 C 55.157877,47.649175 54.175422,49.017596 52.210526,49.578948 C 51.789459,49.719349 51.33332,49.789525 50.842103,49.789475 C 47.473673,49.789525 45.789465,47.614088 45.789472,43.26316 C 45.789465,37.929885 48.070165,33.789539 52.631576,30.842104 C 55.578928,28.947438 58.982435,28.00007 62.842105,28 M 63.578947,88.736839 C 65.894709,88.736854 67.578918,89.82458 68.631579,92.00001 C 69.052602,92.77194 69.263127,93.61404 69.263159,94.52631 C 69.263127,97.05264 68.070146,98.73684 65.68421,99.57894 C 64.98243,99.85965 64.245588,100 63.473684,100 C 60.87717,100 59.157873,98.8772 58.315788,96.63158 C 58.105243,96.00001 57.99998,95.33335 57.999998,94.63158 C 57.99998,91.96492 59.122785,90.14037 61.36842,89.157906 C 62.070151,88.877214 62.806993,88.736854 63.578947,88.736839"
+       style="font-size:74.98017883px;font-style:normal;font-weight:normal;fill:url(#linearGradient2086);fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" />
+  </g>
+</svg>
--- a/securitydialogs/Autolock/inc/AutoKeyguardCenRepI.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +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:
-*
-*/
-
-
-#ifndef _AUTOKEYGUARDCENREPI_H__
-#define _AUTOKEYGUARDCENREPI_H__
-
-#include <e32std.h>
-#include <cenrepnotifyhandler.h> // link against CenRepNotifHandler.lib
-
-class CAutoKeyguardObserver;
-
-class CAutoKeyguardCenRepI : public CBase, public MCenRepNotifyHandlerCallback
-	{
-	public:
-		/**
-        * Creates instance of the CAutoKeyguardCenRepI class.
-        *
-		* @param aObserver (pointer to keyguard timeout observer)
-		* @return Returns the instance just created.
-        */
-		static CAutoKeyguardCenRepI* NewLC(CAutoKeyguardObserver* aObserver);
-		/**
-        * Creates instance of the CAutoKeyguardCenRepI class.
-        *
-		* @param aObserver (pointer to keyguard timeout observer)
-		* @return Returns the instance just created.
-        */
-		static CAutoKeyguardCenRepI* NewL(CAutoKeyguardObserver* aObserver);
-		/**
-        * Destructor.
-        */      
-		~CAutoKeyguardCenRepI();
-	public:
-		/**
-        * Current autokeyguard period
-        *
-		* @return TInt (curenst autokeyguard period in minutes) 
-		*/      
-		TInt Timeout();	
-        /**
-        * From MCenRepNotifyHandlerCallback. Handles period changed event. Called by CenRep.
-		*
-		* @param aId (The id of the changed setting)
-        * @param aNewValue (The new value of the changed setting)
-        * @return KErNone
-		*/
-        void HandleNotifyInt(TUint32 aId, TInt aNewValue);
-
-        void HandleNotifyError(TUint32 aId, TInt error, CCenRepNotifyHandler* aHandler);
-
-        void HandleNotifyGeneric(TUint32 aId);
-
-	private:
-		/**
-        * C++ default constructor.
-		*
-		* @param aObserver (pointer to keyguard timeout observer)
-        */
-		CAutoKeyguardCenRepI(CAutoKeyguardObserver* aObserver);
-		/**
-        * Symbian OS constructor.
-        */
-		void ConstructL();
-	private:
-		/**
-        * Tells observer that keyguard period has been changed
-		*/
-		void ResetInactivityTimeout();	
-	private: // data
-		CAutoKeyguardObserver* iObserver; //not owned!
-        CCenRepNotifyHandler* iNotifyHandler;
-        CRepository* iSession;
-
-	};
-
-#endif
-// END OF FILE
--- a/securitydialogs/Autolock/inc/AutoKeyguardObserver.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,104 +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:
-*
-*/
-
-
-#ifndef _AUTOKEYGUARDOBSERVER_H__
-#define _AUTOKEYGUARDOBSERVER_H__
-
-#include <e32base.h>
-#include <aknappui.h>
-#include <e32property.h>
-
-class CUserActivityManager;
-class CAutoKeyguardCenRepI;
-class MAutolockAppUiInterface;
-
-class CAutoKeyguardObserver : public CBase
-	{
-	public:
-		/**
-        * Creates instance of the CAutoKeyguardObserver class.
-        *
-		* @return Returns the instance just created.
-        */
-		static CAutoKeyguardObserver* NewL( MAutolockAppUiInterface* aAppUiI );
-		/**
-        * Symbian OS constructor.
-        */
-		void ConstructL( CAutoKeyguardObserver* aObserver );
-		/**
-        * Destructor.
-        */
-		~CAutoKeyguardObserver();
-	public:
-		/**
-        * Gets new autokeyguard period and starts monitoring user activity 
-        */
-		void ResetInactivityTimeout();
-		/**
-        * Activates keyguard 
-		*/
-		void LockKeysL();
-	private:
-		/**
-        * C++ default constructor.
-        */
-		CAutoKeyguardObserver( MAutolockAppUiInterface* aAppUiI ); 
-	private:
-		/**
-        * Return current autokeyguard period
-		*
-		* @return TInt (autokeyguard period in minutes)
-        */	
-		TInt AutoKeyguardTimeout();
-		/**
-        * Handles Active event. Called by ActivityManager
-		*
-		* @param aPtr 
-        * @return KErNone
-		*/
-		static TInt HandleActiveEventL(TAny* aPtr);
-		/**
-        * Handles Inactive event. Called by ActivityManager
-		*
-		* @param aPtr (pointer to CAutoKeyguardObserver)
-        * @return KErNone
-		*/
-		static TInt HandleInactiveEventL(TAny* aPtr);
-		/**
-        * Starts monitoring user activity
-        */		
-		void StartActivityMonitoringL();
-		/**
-        * Stop monitoring user activity.
-        */
-		void StopActivityMonitoring();
-		/**
-        * Initializes activymanager 
-        */
-		void SetActivityManagerL();
-		/**
-        * UnInitializes activymanager 
-        */
-		void CancelActivityManager();
-	private: //data
-		CUserActivityManager*    iActivityManager;
-        CAutoKeyguardCenRepI*    iCenRepI;
-        MAutolockAppUiInterface* iAppUiI;
-	};
-#endif
-// END OF FILE
--- a/securitydialogs/Autolock/inc/AutoLockCenRepI.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +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:
-*
-*/
-
-
-#ifndef _AUTOLOCKCENREPI_H__
-#define _AUTOLOCKCENREPI_H__
-
-#include <e32std.h>
-#include <cenrepnotifyhandler.h> // link against CenRepNotifHandler.lib
-#include "AutolockAppUiPS.h"
-
-
-class CAutolockCenRepI : public CBase, public MCenRepNotifyHandlerCallback
-	{
-	public:
-		/**
-        * Creates instance of the CAutolockShareDataI class.
-        *
-		* @param aAppUi (pointer to autolock appui)
-		* @return Returns the instance just created.
-        */
-		static CAutolockCenRepI* NewLC(CAutolockAppUi* aAppUi);
-		/**
-        * Creates instance of the CAutolockShareDataI class.
-        *
-		* @param aAppUi (pointer to autolock appui)
-		* @return Returns the instance just created.
-        */
-		static CAutolockCenRepI* NewL(CAutolockAppUi* aAppUi);
-		/**
-        * Destructor.
-        */      
-		~CAutolockCenRepI();
-	public:
-		/**
-        * Currenst autolock period
-        *
-		* @return TInt (curenst autolock period in minutes) 
-		*/      
-		TInt Timeout();	
-		/**
-        * Sets device lock value in SharedData
-        *
-		* @param: aLocked (decice lock on/off) 
-		*/
-		void SetLockedL(TBool aLockValue);
-        /**
-        * From MCenRepNotifyHandlerCallback. Handles period changed event. Called by CenRep.
-		*
-		* @param aId (The id of the changed setting)
-        * @param aNewValue (The new value of the changed setting)
-        * @return KErNone
-		*/
-        void HandleNotifyInt(TUint32 aId, TInt aNewValue);
-
-        void HandleNotifyError(TUint32 aId, TInt error, CCenRepNotifyHandler* aHandler);
-
-        void HandleNotifyGeneric(TUint32 aId);
-
-	private:
-		/**
-        * C++ default constructor.
-		*
-		* @param aAppUi (pointer to autolock appui)
-        */
-		CAutolockCenRepI(CAutolockAppUi* aAppUi);
-		/**
-        * Symbian OS constructor.
-        */
-		void ConstructL();
-	private:
-		/**
-        * Handles period changed event. Called by CSharedDataInteger
-		*
-		* @param aPtr (pointer to CAutolockShareDataI)
-        * @return KErNone
-		*/
-		TInt HandleTimeoutChangedL();
-		/**
-        * Tells model that autolock period has been changed
-		*/
-		void ResetInactivityTimeout();	
-	private: // data
-		CAutolockAppUi*          iAppUi; //not owned!
-        CCenRepNotifyHandler* iNotifyHandler;
-        CRepository* iSession;
-
-	};
-
-#endif
-// END OF FILE
--- a/securitydialogs/Autolock/inc/AutoLockLockObserverPS.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +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: 
-*		Obsererver for Set System Locked event  
-*
-*
-*/
-
-
-#ifndef     __AUTOLOCKLOCKOBSERVERPS_H
-#define     __AUTOLOCKLOCKOBSERVERPS_H
-
-#include <e32svr.h>
-#include <e32property.h>
-#include "AutolockAppUiPS.h"
-
-class   CLockObserver: public CActive
-    {
-    public:
-		/**
-        * Creates instance of the CLockObserver class.
-        *
-		* @param aAppUi (pointer to autolock appui)
-		* @return Returns the instance just created.
-        */
-        static CLockObserver* NewL(CAutolockAppUi* aAppUi);
-		/**
-        * Destructor.
-        */
-		~CLockObserver();    
-	private:
-        /**
-        * Starts asynchronic listening KUidAutolockStatus event
-        *
-		* @return KErrNone: if no errors
-        * @return KErrInUse: if already listening
-		*/
-		TInt Start();            
-    private: // constructors
-		/**
-        * C++ default constructor.
-		*
-		* @param aAppUi (pointer to autolock appui)
-        */
-        CLockObserver(CAutolockAppUi* aAppUi);
-		 /**
-        * Symbian OS constructor.
-        */
-        void ConstructL();
-    private: // from CActive
-         /** @see CActive::RunL() */
-		void RunL();
-		/** @see CActive::DoCancel() */
-        void DoCancel();
-    private: // data
-    	CAutolockAppUi*      iAppUi; //not owned!
-      RProperty            iProperty;
- 
-    };
-
-#endif 
-// End of file
--- a/securitydialogs/Autolock/inc/AutoLockModelPS.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +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:
-*
-*/
-
-
-#ifndef _AUTOLOCKMODELPS_H__
-#define _AUTOLOCKMODELPS_H__
-
-#include <e32base.h>
-#include <aknappui.h>
-#include <e32property.h>
-
-class CUserActivityManager;
-class CAutolockCenRepI;
-class CAutolockAppUi;
-class CLockObserver;
-
-class CAutoLockModel : public CBase
-	{
-	public:
-		/**
-        * Creates instance of the CAutoLockModel class.
-        *
-		* @param aAppUi (pointer to autolock appui)
-		* @return Returns the instance just created.
-        */
-		static CAutoLockModel* NewL(CAutolockAppUi* aAppUi, TBool aLocked );
-		/**
-        * Symbian OS constructor.
-        */
-		void ConstructL( TBool aLocked );
-		/**
-        * Destructor.
-        */
-		~CAutoLockModel();
-	public:
-		/**
-        * Gets new autolock period and starts monitoring user activity 
-        */
-		void ResetInactivityTimeout();
-		/**
-        * Brings autolock app to foreground and locks the system 
-		*/
-		void LockSystemL(TInt aAutolockState = 0);
-		/**
-        * Sets device lock value in SharedData and in SystemAgent 
-        *
-		* @param: aLocked (decice lock on/off) 
-		*/
-		void SetLockedL(TInt aAutolockState = 0);
-	private:
-		/**
-        * C++ default constructor.
-		*
-		* @param aAppUi (pointer to autolock appui)
-        */
-		CAutoLockModel(CAutolockAppUi*	aAppUi); 
-	private:
-		/**
-        * Return current autolock period
-		*
-		* @return TInt (autolock period in minutes)
-        */	
-		TInt AutoLockTimeout();
-		/**
-        * Handles Active event. Called by ActivityManager
-		*
-		* @param aPtr 
-        * @return KErNone
-		*/
-		static TInt HandleActiveEventL(TAny* aPtr);
-		/**
-        * Handles Inactive event. Called by ActivityManager
-		*
-		* @param aPtr (pointer to CAutoLockModel)
-        * @return KErNone
-		*/
-		static TInt HandleInactiveEventL(TAny* aPtr);
-		/**
-        * Starts monitoring user activity
-        */		
-		void StartActivityMonitoringL();
-		/**
-        * Stop monitoring user activity.
-        */
-		void StopActivityMonitoring();
-		/**
-        * Initializes activymanager 
-        */
-		void SetActivityManagerL();
-		/**
-        * UnInitializes activymanager 
-        */
-		void CancelActivityManager();
-	private: //data
-		CUserActivityManager*    iActivityManager;
-		CAutolockAppUi*			 iAppUi; //not owned!
-        CAutolockCenRepI*        iCenRepI;
-		CLockObserver*			 iLockObserver;
-		TBool					 iMonitoring;
-		RProperty                iProperty;
-	};
-#endif
-// END OF FILE
--- a/securitydialogs/Autolock/inc/AutoLockValueObserverPS.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +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: 
-*		Observer for phone events. Used to deactive/active the side-key
-*
-*
-*/
-
-
-#ifndef     __AUTOLOCKVALUEOBSERVERPS_H
-#define     __AUTOLOCKVALUEOBSERVERPS_H
-
-#include <e32svr.h>
-#include <e32property.h>
-
-class CAutolockAppUi;
-
-class   CValueObserver: public CActive
-    {
-    public:
-		/**
-        * Creates instance of the CValueObserver class.
-        *
-		* @param aAppUi (pointer to autolock appui)
-		* @return Returns the instance just created.
-        */
-        static CValueObserver* NewL(CAutolockAppUi* aAppUi);
-		/**
-        * Destructor.
-        */
-		~CValueObserver();    
-	public:
-		/**
-        * Starts asynchronic listening KUidCurrentCall event
-        *
-		* @return KErrNone: if no errors
-        * @return KErrInUse: if already listening
-		*/
-        TInt Start();
-		/**
-        * Stops asynchronic listening KUidAutolockStatus event
-    	*/
-		void Stop();
-    private: // constructors
-        /**
-        * C++ default constructor.
-		*
-		* @param aAppUi (pointer to autolock appui)
-        */
-		CValueObserver(CAutolockAppUi* aAppUi);
-        /**
-        * Symbian OS constructor.
-        */
-		void ConstructL();
-    private: // from CActive    
-		/** @see CActive::RunL() */
-		void RunL();
-		/** @see CActive::DoCancel() */
-        void DoCancel();
-    private: // data
-    	CAutolockAppUi*      iAppUi; //not owned!
-        RProperty            iProperty;
-    };
-
-#endif 
-// End of file
--- a/securitydialogs/Autolock/inc/AutolockApp.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +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 main application class.
-*
-*/
-
-
-#ifndef AUTOLOCKAPP_H
-#define AUTOLOCKAPP_H
-
-// INCLUDES
-#include <aknapp.h>
-
-// CONSTANTS
-// UID of the application
-const TUid KUidAutolock = { 0x100059B5 };
-
-// CLASS DECLARATION
-
-/**
-* CAutolockApp application class.
-* Provides factory to create concrete document object.
-* 
-*/
-class CAutolockApp : public CAknApplication
-    {
-    
-    private:
-
-        /**
-        * From CApaApplication, creates CAutolockDocument document object.
-        * @return A pointer to the created document object.
-        */
-        CApaDocument* CreateDocumentL();
-        
-        /**
-        * From CApaApplication, returns application's UID (KUidAutolock).
-        * @return The value of KUidAutolock.
-        */
-        TUid AppDllUid() const;
-    };
-
-#endif
-
-// End of File
-
--- a/securitydialogs/Autolock/inc/AutolockAppUiInterface.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +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: 
-*     Interface to App Ui from helper classes
-*
-*/
-#ifndef AUTOLOCKAPPUIINTERFACE_H
-#define AUTOLOCKAPPUIINTERFACE_H
-
-class MAutolockAppUiInterface
-    {
-    public:
-        virtual TInt DeviceLockQueryStatus() = 0;
-        virtual TInt DeviceLockStatus() = 0;
-        virtual void CancelDeviceLockQuery() = 0;
-        virtual void ForceOrientation(TInt value) = 0;
-    };
-
-#endif // AUTOLOCKAPPUIINTERFACE_H
--- a/securitydialogs/Autolock/inc/AutolockAppUiPS.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,272 +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 UI class for application.
-*
-*/
-
-
-#ifndef AUTOLOCKAPPUIPS_H
-#define AUTOLOCKAPPUIPS_H
-
-// INCLUDES
-#include <e32std.h>
-#include <aknappui.h>
-#include <etelmm.h>
-#include <aknViewAppUi.h>
-#include <AknEcs.h>
-#include <aknnotedialog.h>
-#include <AknIncallBubbleNotify.h>
-#include <e32property.h>
-#include <rmmcustomapi.h>
-#include "AutolockWait.h"
-#include "AutoKeyguardObserver.h"
-
-#include "AutolockGripStatusObserver.h"
-#include "AutolockFpsStatusObserver.h"
-#include "AutolockAppUiInterface.h"
-
-// FORWARD DECLARATIONS
-class CAutolockContainer;
-class CAutoLockModel;
-class CValueObserver;
-
-// CONSTANTS
-const TUid KAutoLockViewId = {101}; // CDMA StartUp needs this UID.
-
-// CLASS DECLARATIONS
-
-/**
-* part of emergency call handling when telephony+devicelock is active
-* this solution is meant only for 3.1 and 3.2
-*CEcsNote
-*It defines security note used in security view.
-*/
-class CEcsNote : public CAknNoteDialog
-    {
-    public: // Constructors and destructors
-        /**
-        * C++ constructor.
-        */
-        CEcsNote();
-    public: // new
-        /**
-        * Constructs sleeping note
-        */
-        void ConstructSleepingNoteL(TInt aResourceId);
-        /**
-        * Shows slpeeping note
-        */
-        TInt ShowNote();
-        /**
-        * Hides sleeping note
-        */
-        void SleepNote();
-
-        TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,
-                                         TEventCode aType);
-                                         
-        /**
-        * API to set the emergency number to be displayed
-        *
-        * aMatchedNumber    text to display (e.g. "112" )
-        */
-        void SetEmergencyNumber( const TDesC& aMatchedNumber );
-                
-    public:
-        TBool iNoteOnScreen;        
-    };
-  
-
-/**
-* Application UI class.
-* Provides support for the following features:
-* - UIKON control architecture
-* 
-*/
-class CAutolockAppUi : public CAknViewAppUi, public MAknEcsObserver,
-                       public MAutolockAppUiInterface,
-                       public MAutolockFpsStatusObserver
-    {
-    public: // // Constructors and destructor
-
-        /**
-        * Symbian OS default constructor.
-        */      
-        void ConstructL();
-
-        /**
-        * Destructor.
-        */      
-        ~CAutolockAppUi();
-        
-        /**
-         * From MAutolockAppUiInterface
-         */
-        TBool DeviceLockQueryStatus();
-        
-        TBool DeviceLockStatus();
-
-        void CancelDeviceLockQuery();
-        void ForceOrientation(TInt value);
-        /**
-         * From MAutolockFpsStatusObserver
-         */
-        TBool DeviceFpsLock(TInt iStatus);
-
-   public: // New functions
-		/**
-        * Activates previous app
-        */     
-		void SwitchToPreviousAppL();
-		/**
-        * Activates device lock view
-        */     
-		void BringAppToForegroundL();
-		/**
-        * Pointer to model
-        *
-		* @return CAutoLockModel*
-		*/     
-		inline CAutoLockModel* Model() const;
-		/**
-        * Locks voice-key and app-key
-        */     
-		void LockKeysL();
-		/**
-        * UnLocks voice-key and app-key
-        */     
-		void UnLockKeys();
-		/**
-        * Locks voice-key
-        */     
-		void LockSideKeyL();
-		/**
-        * UnLocks voice-key
-        */     
-		void UnLockSideKey();
-        /**
-        * Returns ETrue if system is locked. 
-        */
-        inline TBool Locked() { return (iSideKey2 != 0); }
-        /**
-        * Checks whether PUK1 dialog is active. 
-        */
-		TBool IsPinBlocked();
-		/**
-        * Checks whether the phone has done hidden reset. 
-        */
-		TBool HiddenReset();
-		void EnableWGListChangeEventListening();
-		void DisableWGListChangeEventListening();
-
-    protected:    
-        /**
-        * From CEikAppUi, handles the TARM unlock message, other messages
-        * are propagated to the superclass handler.
-        * @param aClientHandleOfTargetWindowGroup The window group that the message was sent to.
-        * @param aMessageUid The message UID. 
-        * @param aMessageParameters The message parameters
-        * @return TMessageResponse EMessageHandled if the message was the TARM unlock message, 
-        * otherwise the return value from the superclass handler. 
-        */        
-        MCoeMessageObserver::TMessageResponse HandleMessageL(
-            TUint32 aClientHandleOfTargetWindowGroup,
-            TUid aMessageUid,
-            const TDesC8& aMessageParameters );
-            
-
-    private:
-        // From MEikMenuObserver
-        void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
-		
-		// from CCoeAppUi
-		void HandleForegroundEventL(TBool aForeground);
-        /**
-        * From CAknAppUi, called when screen layout changes 
-        */
-        void HandleScreenDeviceChangedL();
-    private:
-        /**
-        * From CEikAppUi, takes care of command handling.
-        * @param aCommand command to be handled
-        */
-        void HandleCommandL(TInt aCommand);
-
-        /**
-        * From CEikAppUi, handles key events.
-        * @param aKeyEvent Event to handled.
-        * @param aType Type of the key event. 
-        * @return Reponse code (EKeyWasConsumed, EKeyWasNotConsumed). 
-        */
-        virtual TKeyResponse HandleKeyEventL(
-            const TKeyEvent& aKeyEvent,TEventCode aType);
-    virtual void HandlePointerEventL(const TPointerEvent& aPointerEvent);
-     private:
-    	/**
-    	* From AknViewAppUi. Handles pointer-initiated view switch.
-    	* @param aEvent Window server event.
-    	* @param aDestination Pointer to the control which the event is targeted to.
-    	*/
-    	void HandleWsEventL( const TWsEvent& aEvent, CCoeControl* aDestination );
-
-        /**
-        * Used for communication with SysAp
-        * @param aMessage message enumeration defined in eikon.hrh
-        */        
-        void SendMessageToSysAp(TInt aMessage);
-    	
-    	/**
-        * From MAknEcsObserver
-        * part of emergency call handling when telephony+devicelock is active
-        * this solution is meant only for 3.1 and 3.2
-        * handles emergency call
-        */
-        virtual void HandleEcsEvent( CAknEcsDetector* aEcsDetector, CAknEcsDetector::TState aState );
-            
-        TBool TarmState();
-        void HandleWindowGroupListChange();
-    private: //Data
-   		CAutoLockModel*	 iModel;		 
-		RTelServer       iServer;
-	    RMobilePhone     iPhone;  
-	    TInt			 iAppKey;
-		TInt			 iSideKey1;
-		TInt			 iSideKey2;
-		CValueObserver*  iPhoneObserver;
-		TBool			 iLocked;
-		TBool            iDeviceLockQueryStatus;
-        // Idle Incall Bubbles.
-        CAknIncallBubble* iIncallBubble;
-        CAutoKeyguardObserver* iKeyguardObserver;
-        CAutolockGripStatusObserver* iGripStatusObserver;
-        CAutolockFpsStatusObserver* iFpsStatusObserver;
-        RMmCustomAPI	 iCustomPhone;
-        
-        // part of emergency call handling when t//iEmergencySupportReadyelephony+devicelock is active
-        // this solution is meant only for 3.1 and 3.2
-        CAknEcsDetector* iEcsDetector;
-        CEcsNote*		 iEcsNote;	
-        TBool            iEmergencySupportReady;
-        CWait*			 iWait;	
-		TRect aCallButtonRect;
-		TInt iGotEventDownDuringCall;
-	};
-
-	inline CAutoLockModel* CAutolockAppUi::Model() const
-		{return iModel;}
-
-#endif
-
-// End of File
--- a/securitydialogs/Autolock/inc/AutolockContainer.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +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 container control for application.
-*
-*/
-
-
-#ifndef AUTOLOCKCONTAINER_H
-#define AUTOLOCKCONTAINER_H
-
-// INCLUDES
-#include <coecntrl.h>
-#include <eikimage.h>
-#include <eiklabel.h>
-#include <AknSkinnableClock.h>
-   
-// FORWARD DECLARATIONS
-
-class CAknsLayeredBackgroundControlContext;
-
-// CLASS DECLARATION
-
-/**
-*  CAutolockContainer  container control class.
-*  
-*/
-class CAutolockContainer : public CCoeControl, MCoeControlObserver
-    {
-    public: // Constructors and destructor
-        
-        /**
-        * Symbian OS default constructor.
-        * @param aRect Frame rectangle for container.
-        */
-        void ConstructL(const TRect& aRect);
-
-        /**
-        * Destructor.
-        */
-        ~CAutolockContainer();
-
-    public: // Functions from base classes
-        /**
-        * From CCoeControl, MopSupplyObject
-        */
-        TTypeUid::Ptr MopSupplyObject( TTypeUid aId );
-        void GiveCoords( TRect& aRect );
-
-    private: // Functions from base classes
-
-       /**
-        * From CoeControl,SizeChanged.
-        */
-        void SizeChanged();
-
-       /**
-        * From CoeControl,CountComponentControls.
-        */
-        TInt CountComponentControls() const;
-
-       /**
-        * From CCoeControl,ComponentControl.
-        */
-        CCoeControl* ComponentControl(TInt aIndex) const;
-
-       /**
-        * From CCoeControl,Draw.
-        */
-        void Draw(const TRect& aRect) const;
-
-        // event handling section
-        // e.g Listbox events
-        void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
-        
-    private: //data
-        CEikImage* iEikBitmap;
-        CFbsBitmap* iBitmap;
-        CFbsBitmap* iMask;
-        CEikImage* iEikBitmapCall;
-        CFbsBitmap* iBitmapCall;
-        CFbsBitmap* iMaskCall;
-        // Owned background context.
-        CAknsLayeredBackgroundControlContext* iBgContext;
-        
-    };
-
-#endif
-
-// End of File
--- a/securitydialogs/Autolock/inc/AutolockDocument.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +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 document for application.
-*
-*/
-
-
-#ifndef AUTOLOCKDOCUMENT_H
-#define AUTOLOCKDOCUMENT_H
-
-// INCLUDES
-#include <AknDoc.h>
-// CONSTANTS
-
-// FORWARD DECLARATIONS
-class  CEikAppUi;
-
-// CLASS DECLARATION
-
-/**
-*  CAutolockDocument application class.
-*/
-class CAutolockDocument : public CAknDocument 
-    {
-    public: // Constructors and destructor
-        /**
-        * Two-phased constructor.
-        */
-        static CAutolockDocument* NewL(CEikApplication& aApp);
-
-        /**
-        * Destructor.
-        */
-        virtual ~CAutolockDocument();
-
-    public: // From CEikDocument 
-		/**
-        * Updates task name --> Sets autolock hidden
-        *
-		* @param aWgName CApaWindowGroupName*
-		*/
-		void UpdateTaskNameL( CApaWindowGroupName* aWgName );
-
-    private:
-
-        /**
-        * Symbian OS default constructor.
-        */
-        CAutolockDocument(CEikApplication& aApp): CAknDocument(aApp) { }
-        void ConstructL();
-
-    private:
-
-        /**
-        * From CEikDocument, create CAutolockAppUi "App UI" object.
-        */
-        CEikAppUi* CreateAppUiL();
-    };
-
-#endif
-
-// End of File
-
--- a/securitydialogs/Autolock/inc/AutolockFpsStatusObserver.h	Thu Aug 19 10:45:23 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: 
-*     Declares UI class for application.
-*
-*/
-
-#ifndef AUTOLOCKFPSOBSERVER_H_
-#define AUTOLOCKFPSOBSERVER_H_
-
-#include <e32base.h>
-#include <e32property.h>
-#include <w32std.h>
-#include <hwrmdomainpskeys.h>
-
-
-class MAutolockFpsStatusObserver
-    {
-    public:
-        /**
-         * Implement this method to be notified when Fps status
-         * changes.
-         */
-        IMPORT_C virtual TInt DeviceFpsLock(TInt iStatus) = 0;
-        IMPORT_C virtual TInt DeviceLockStatus() = 0;
-    };
-
-class CAutolockFpsStatusObserver : public CActive
-    {
-    public:
-        IMPORT_C static CAutolockFpsStatusObserver* NewL( MAutolockFpsStatusObserver* aObserver, RWsSession& aSession );
-
-        void RunL();
-        void DoCancel();
-        ~CAutolockFpsStatusObserver();
-    
-    private:
-        void ConstructL( MAutolockFpsStatusObserver* aObserver );   
-        CAutolockFpsStatusObserver( RWsSession& aSession );
-        void FpsStatusChangedL( TInt aFpsStatus );
-
-    private:
-        MAutolockFpsStatusObserver* iObserver;
-        RProperty iFpsStatus;
-        RWsSession& iSession;
-    };
-
-
-#endif 
--- a/securitydialogs/Autolock/inc/AutolockGripStatusObserver.h	Thu Aug 19 10:45:23 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: 
-*     Declares UI class for application.
-*
-*/
-
-#ifndef AUTOLOCKGRIPOBSERVER_H_
-#define AUTOLOCKGRIPOBSERVER_H_
-
-#include <e32base.h>
-#include <e32property.h>
-#include <w32std.h>
-#include <hwrmdomainpskeys.h>
-
-class MAutolockAppUiInterface;
-
-class CAutolockGripStatusObserver : public CActive
-    {
-    public:
-        IMPORT_C static CAutolockGripStatusObserver* NewL( MAutolockAppUiInterface* aObserver, RWsSession& aSession );
-
-        void RunL();
-        void DoCancel();
-        ~CAutolockGripStatusObserver();
-    
-    private:
-        void ConstructL( MAutolockAppUiInterface* aObserver );   
-        CAutolockGripStatusObserver( RWsSession& aSession );
-        void GripStatusChangedL( TInt aGripStatus );
-
-    private:
-        MAutolockAppUiInterface* iObserver;
-        RProperty iGripStatus;
-        RWsSession& iSession;
-    };
-
-
-#endif 
--- a/securitydialogs/Autolock/inc/AutolockView.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +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:
-*
-*/
-
-
-#ifndef __AUTOLOCKVIEW_H__
-#define __AUTOLOCKVIEW_H__
-
-#include <aknview.h>
-#include "AutolockContainer.h"
-
-class CAutolockView : public CAknView
-	{
-	public:
-		/**
-        * Symbian OS constructor.
-        */
-		void ConstructL();
-		/**
-        * Destructor.
-        */
-		~CAutolockView();
-	public: // from CAknView
-		/**
-        * Returns view id.
-        * @return An unsigned integer (view id).
-        */
-        TUid Id() const;
-		/**
-        * Handles commands.
-        * @param aCommand Command to be handled.
-        * @return void.
-        */
-		void HandleCommandL(TInt aCommand);
-		/**
-        * Handles statuspane changes
-        * @return void.
-        */
-		void HandleStatusPaneSizeChange();
-		/**
-        * Handles screen layout changes
-        */
-        void ScreenDeviceChanged();
-        void MakeVisible(TBool aVisibility);
-        void HandleCall(TInt aCommand, TRect &aRect );
-	private: // from CAknView
-		/**
-        * Activates the view.
-        * @param aPrevViewId ID of previous view
-        * @param aCustomMessageId customized message ID
-        * @param aCustomMessage sutomized message payload
-        */
-		void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage);
-		/**
-        * Deactivates view
-        */
-		void DoDeactivate();
-	private: // data
-		CAutolockContainer* iView;
-		};
-#endif 
-// end of file
--- a/securitydialogs/Autolock/inc/AutolockWait.h	Thu Aug 19 10:45:23 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: 
-*	
-*
-*/
-
-
-#ifndef     __AUTOLOCKWAIT_H
-#define     __AUTOLOCKWAIT_H
-
-//  INCLUDES
-
-#include    <e32base.h>
-#include	<eikappui.h>
-#include    <coecntrl.h>
-
-//  CLASS DEFINITIONS 
-class  CWait : public CActive
-    {
-     public:
-       /**
-        * Creates instance of the CWait class.
-        *
-		* @return Returns the instance just created.
-        */
-		static CWait* NewL();
-		/**
-        * Destructor.
-        */
-        ~CWait();
-    public:
-        /**
-		* Starts waiting for aReqStatus. 
-		*/
-		TInt WaitForRequestL();
-    public:
-        /**
-        * Sets active request type. 
-        */
-        void SetRequestType(TInt aRequestType);
-        /**
-        * Gets active request type. 
-        */
-        TInt GetRequestType();
-	private:
-		/**
-		* C++ default constructor.
-		*/
-		CWait();
-		/**
-		* Symbian OS constructor.
-		*/
-		void ConstructL();
-	private: // from CActive
-        /** @see CActive::RunL() */
-		void RunL();
-		/** @see CActive::DoCancel() */
-        void DoCancel();
-		RTimer iTimer;
-		CActiveSchedulerWait iWait;
-		// Used if there is a need to cancel an active request;
-        // namely in situations where destructor is called when Wait
-        // is active.
-        TInt iRequestType;
-	};
-
-
-// CWaitAbsorbingControl, absorbs all the key presses.
-class CWaitAbsorbingControl : public CCoeControl
-    {
-    public:
-        static CWaitAbsorbingControl* NewLC();
-        virtual ~CWaitAbsorbingControl();
-    private:
-        virtual TKeyResponse OfferKeyEventL(const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/);
-    private:
-        CWaitAbsorbingControl();
-        void ConstructL();
-    private: // Data
-         CEikAppUi*  iAppUi;
-    };
-
-#endif
-
-// End of file
--- a/securitydialogs/Autolock/inc/autolock.hrh	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +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 Autolock.
-*     The file can be included in C++ or resource file.
-*
-*/
-
-#ifndef AUTOLOCK_HRH
-#define AUTOLOCK_HRH
-
-enum TAutoLockKeys
-	{
-	ESecUiCmdUnlock = 300
-	};
-#endif      //  AUTOLOCK
-
-
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/indicatorplugin/qmakepluginstubs/indicatorautolockplugin.qtplugin	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,1 @@
+This file is a Qt plugin stub file. The real Qt plugin is located in /sys/bin. Created:2010-05-17T09:17:32
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/indicatorplugin/rom/indicatorautolockplugin.iby	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Keylock indicator
+*
+*/
+
+#ifndef INDICATORAUTOLOCKPLUGIN_IBY
+#define INDICATORAUTOLOCKPLUGIN_IBY
+
+file=ABI_DIR\UREL\indicatorautolockplugin.dll SHARED_LIB_DIR\indicatorautolockplugin.dll UNPAGED
+data=\epoc32\data\z\resource\plugins\indicators\indicatorautolockplugin.qtplugin \resource\plugins\indicators\indicatorautolockplugin.qtplugin
+
+#endif  // INDICATORAUTOLOCKPLUGIN_IBY
+
--- a/securitydialogs/Autolock/loc/autolock.loc	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +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 Autolock
-*
-*/
-
-
-
-// LOCALISATION STRINGS
-
-//d:Title pane text in System Lock View.(Phone is in locked mode)
-//l:title_pane_t2/opt9 
-//
-#define qtn_set_sec_title_locked "Locked"
-
-//d:Left Softkey text in System Lock View.
-//l:control_pane_t1/opt7
-//
-#define qtn_set_sec_unlock_system "Unlock"
-
-
-// End of File
-
-
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/qtg_large_device_lock.svg	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,140 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="60" viewBox="0 0 60 60" width="60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<g>
+<rect fill="none" height="60" width="60"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_1" x1="30" x2="30" y1="4.26" y2="55.61">
+<stop offset="0" stop-color="#D1D7D9"/>
+<stop offset="0.07" stop-color="#D1D7D9"/>
+<stop offset="0.26" stop-color="#BDC2C4"/>
+<stop offset="0.66" stop-color="#949DA1"/>
+<stop offset="0.96" stop-color="#ADB3B5"/>
+<stop offset="1" stop-color="#595C5E"/>
+</linearGradient>
+<path d="M46.574,52.922c0,1.557-1.264,2.818-2.822,2.818H16.248c-1.558,0-2.82-1.262-2.82-2.818V7.082 c0-1.556,1.262-2.82,2.82-2.82h27.504c1.559,0,2.822,1.264,2.822,2.82V52.922z" fill="url(#SVGID_1)"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_2" x1="30" x2="30" y1="4.26" y2="54.73">
+<stop offset="0" stop-color="#E4EBED"/>
+<stop offset="0.07" stop-color="#E4EBED"/>
+<stop offset="0.26" stop-color="#D6DCDE"/>
+<stop offset="0.66" stop-color="#B2BEC2"/>
+<stop offset="1" stop-color="#ADB3B5"/>
+</linearGradient>
+<path d="M43.752,4.262H16.248c-1.558,0-2.82,1.264-2.82,2.82v45.84c0,0.752,0.3,1.432,0.78,1.938 c-0.044-0.172-0.072-0.344-0.072-0.529v-1.408V8.492v-1.41c0-1.168,0.95-2.118,2.114-2.118h27.504c1.166,0,2.114,0.95,2.114,2.118 v1.41v44.43v1.408c0,0.186-0.028,0.357-0.072,0.529c0.481-0.506,0.782-1.186,0.782-1.938V7.082 C46.574,5.526,45.311,4.262,43.752,4.262z" fill="url(#SVGID_2)"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_3" x1="30" x2="30" y1="7.84" y2="42.35">
+<stop offset="0" stop-color="#B6BBBD"/>
+<stop offset="1" stop-color="#F0FBFF"/>
+</linearGradient>
+<rect fill="url(#SVGID_3)" fill-opacity="0.6" height="34.554" stroke-opacity="0.6" width="28.918" x="15.542" y="7.788"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_4" x1="30" x2="30" y1="8.54" y2="41.64">
+<stop offset="0" stop-color="#6E6E6E"/>
+<stop offset="1" stop-color="#333333"/>
+</linearGradient>
+<rect fill="url(#SVGID_4)" height="33.146" width="27.504" x="16.248" y="8.492"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_5" x1="30" x2="30" y1="9.25" y2="40.94">
+<stop offset="0" stop-color="#3BC8EB"/>
+<stop offset="0.39" stop-color="#2D9BD2"/>
+<stop offset="0.89" stop-color="#1347BA"/>
+<stop offset="1" stop-color="#1347BA"/>
+</linearGradient>
+<rect fill="url(#SVGID_5)" height="31.735" width="26.094" x="16.954" y="9.198"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_6" x1="30" x2="30" y1="9.75" y2="22.36">
+<stop offset="0" stop-color="#85EFFF"/>
+<stop offset="1" stop-color="#3BA1D9"/>
+</linearGradient>
+<polygon fill="url(#SVGID_6)" points="43.046,20.48 16.954,23.3 16.954,9.904 43.046,9.904 "/>
+<rect fill="#9FE4FF" height="0.708" width="26.094" x="16.954" y="9.198"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_7" x1="30.2" x2="30.2" y1="7.82" y2="4.99">
+<stop offset="0" stop-color="#FFFFFF"/>
+<stop offset="1" stop-color="#D1D7D9"/>
+</linearGradient>
+<path d="M27.088,7.788c-0.792,0-1.412-0.516-1.412-1.176V6.14c0-0.658,0.622-1.176,1.412-1.176h6.238 c0.79,0,1.408,0.518,1.408,1.176v0.47c0,0.66-0.621,1.176-1.408,1.176h-6.238V7.788z" fill="url(#SVGID_7)"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_8" x1="30.21" x2="30.21" y1="5.38" y2="7.2">
+<stop offset="0" stop-color="#6C7375"/>
+<stop offset="1" stop-color="#BDC2C4"/>
+</linearGradient>
+<path d="M34.034,6.612c0,0.26-0.318,0.47-0.708,0.47h-6.238c-0.39,0-0.708-0.21-0.708-0.47V6.14 c0-0.262,0.316-0.468,0.708-0.468h6.238c0.388,0,0.708,0.208,0.708,0.468V6.612z" fill="url(#SVGID_8)"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_9" x1="29.89" x2="29.89" y1="43.08" y2="53.56">
+<stop offset="0" stop-color="#B6BBBD"/>
+<stop offset="1" stop-color="#FFFFFF"/>
+</linearGradient>
+<path d="M27.344,53.626c-1.512,0-2.744-1.216-2.744-2.712 V45.76c0-1.494,1.232-2.71,2.744-2.71h5.094c1.515,0,2.744,1.216,2.744,2.71v5.154c0,1.496-1.229,2.712-2.744,2.712H27.344z" fill="url(#SVGID_9)" fill-opacity="0.6" stroke-opacity="0.6"/>
+<path d="M27.34,52.922c-1.122,0-2.032-0.902-2.032-2.008V45.76 c0-1.107,0.91-2.008,2.032-2.008h5.104c1.123,0,2.031,0.9,2.031,2.008v5.154c0,1.105-0.908,2.008-2.031,2.008H27.34z" fill="#020202" fill-opacity="0.5" stroke-opacity="0.5"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_10" x1="29.89" x2="29.89" y1="44.43" y2="52.23">
+<stop offset="0" stop-color="#A6A8AB"/>
+<stop offset="0.7" stop-color="#58595B"/>
+<stop offset="1" stop-color="#808184"/>
+</linearGradient>
+<path d="M33.771,50.914c0,0.718-0.594,1.3-1.319,1.3h-5.12c-0.728,0-1.32-0.582-1.32-1.3V45.76 c0-0.716,0.592-1.298,1.32-1.298h5.12c0.726,0,1.319,0.582,1.319,1.298V50.914z" fill="url(#SVGID_10)"/>
+<path d="M28.836,50.805c-0.782,0-1.414-0.633-1.414-1.41v-2.119 c0-0.775,0.632-1.407,1.414-1.407h2.112c0.78,0,1.411,0.632,1.411,1.407v2.119c0,0.777-0.631,1.41-1.411,1.41H28.836z" fill="#020202" fill-opacity="0.2" stroke-opacity="0.2"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_11" x1="29.89" x2="29.89" y1="46.56" y2="50.1">
+<stop offset="0" stop-color="#D1D7D9"/>
+<stop offset="0.07" stop-color="#D1D7D9"/>
+<stop offset="0.26" stop-color="#BDC2C4"/>
+<stop offset="0.66" stop-color="#949DA1"/>
+<stop offset="0.96" stop-color="#ADB3B5"/>
+<stop offset="1" stop-color="#595C5E"/>
+</linearGradient>
+<path d="M28.836,50.098c-0.392,0-0.708-0.313-0.708-0.703v-2.119c0-0.385,0.314-0.703,0.708-0.703 h2.112c0.39,0,0.708,0.316,0.708,0.703v2.119c0,0.388-0.316,0.703-0.708,0.703H28.836z" fill="url(#SVGID_11)"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_12" x1="18.66" x2="18.66" y1="43.71" y2="52.23">
+<stop offset="0" stop-color="#B6BBBD"/>
+<stop offset="1" stop-color="#F0FBFF"/>
+</linearGradient>
+<path d="M18.256,52.214c-1.496,0-2.714-1.216-2.714-2.712 v-3.036c0-1.498,1.218-2.714,2.714-2.714h0.81c1.498,0,2.714,1.216,2.714,2.714v3.036c0,1.496-1.216,2.712-2.714,2.712H18.256z" fill="url(#SVGID_12)" fill-opacity="0.4" stroke-opacity="0.4"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_13" x1="18.66" x2="18.66" y1="44.43" y2="51.52">
+<stop offset="0" stop-color="#231F20"/>
+<stop offset="1" stop-color="#6D6E70"/>
+</linearGradient>
+<path d="M18.256,51.51c-1.106,0-2.008-0.9-2.008-2.008v-3.036 c0-1.11,0.902-2.006,2.008-2.006h0.81c1.11,0,2.01,0.896,2.01,2.006v3.036c0,1.107-0.9,2.008-2.01,2.008H18.256z" fill="url(#SVGID_13)" fill-opacity="0.7" stroke-opacity="0.7"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_14" x1="18.66" x2="18.66" y1="45.14" y2="50.82">
+<stop offset="0" stop-color="#C6FF45"/>
+<stop offset="0.73" stop-color="#66A00E"/>
+<stop offset="1" stop-color="#387300"/>
+</linearGradient>
+<path d="M20.37,49.502c0,0.721-0.582,1.303-1.302,1.303h-0.812c-0.718,0-1.302-0.582-1.302-1.303 v-3.036c0-0.72,0.584-1.302,1.302-1.302h0.81c0.72,0,1.302,0.582,1.302,1.302v3.036H20.37z" fill="url(#SVGID_14)"/>
+<path d="M40.322,52.214c-1.494,0-2.711-1.216-2.711-2.712 v-3.036c0-1.498,1.217-2.714,2.711-2.714h0.812c1.5,0,2.714,1.216,2.714,2.714v3.036c0,1.496-1.214,2.712-2.714,2.712H40.322z" fill="url(#SVGID_12)" fill-opacity="0.4" stroke-opacity="0.4"/>
+<path d="M40.322,51.51c-1.108,0-2.008-0.9-2.008-2.008v-3.036 c0-1.11,0.899-2.006,2.008-2.006h0.812c1.11,0,2.009,0.896,2.009,2.006v3.036c0,1.107-0.898,2.008-2.009,2.008H40.322z" fill="url(#SVGID_13)" fill-opacity="0.7" stroke-opacity="0.7"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_17" x1="40.73" x2="40.73" y1="45.14" y2="50.82">
+<stop offset="0" stop-color="#FFC142"/>
+<stop offset="0.75" stop-color="#CF4E18"/>
+<stop offset="1" stop-color="#B52100"/>
+</linearGradient>
+<path d="M42.438,49.502c0,0.721-0.582,1.303-1.301,1.303h-0.813c-0.717,0-1.301-0.582-1.301-1.303 v-3.036c0-0.72,0.584-1.302,1.301-1.302h0.813c0.719,0,1.301,0.582,1.301,1.302V49.502z" fill="url(#SVGID_17)"/>
+<rect fill="none" height="60" width="60"/>
+</g>
+<g transform="matrix(1 0 0 1 30 30)">
+<linearGradient gradientTransform="matrix(1 0 0 -1 8.3999 5.04)" gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="-1.0313" x2="14.444" y1="-3.8467" y2="-3.8467">
+<stop offset="0" style="stop-color:#8C8C8C"/>
+<stop offset="0.5333" style="stop-color:#B3B3B3"/>
+<stop offset="1" style="stop-color:#808080"/>
+</linearGradient>
+<path d="M15.106,3.081c-4.303,0-7.794,3.46-7.854,7.749v2.881h2.657V10.83  c0.061-2.818,2.366-5.092,5.198-5.092c2.831,0,5.136,2.273,5.198,5.092v3.863h2.655V10.83C22.898,6.541,19.408,3.081,15.106,3.081z" fill="url(#SVGID_1_)"/>
+<linearGradient gradientTransform="matrix(1 0 0 -1 8.3999 5.04)" gradientUnits="userSpaceOnUse" id="SVGID_2_" x1="-0.5474" x2="13.9592" y1="-4.0928" y2="-4.0928">
+<stop offset="0" style="stop-color:#CCCCCC"/>
+<stop offset="0.5152" style="stop-color:#FFFFFF"/>
+<stop offset="1" style="stop-color:#CCCCCC"/>
+</linearGradient>
+<path d="M20.793,14.203V10.83c-0.066-3.084-2.617-5.582-5.687-5.582c-3.072,0-5.623,2.498-5.689,5.572v3.873  H7.743V10.83c0.057-4,3.359-7.258,7.363-7.258c4.003,0,7.304,3.258,7.361,7.265v3.366H20.793z" fill="url(#SVGID_2_)"/>
+<linearGradient gradientTransform="matrix(1 0 0 -1 8.3999 5.04)" gradientUnits="userSpaceOnUse" id="SVGID_3_" x1="-0.2461" x2="13.6586" y1="-4.0938" y2="-4.0938">
+<stop offset="0" style="stop-color:#B4B4B4"/>
+<stop offset="0.5" style="stop-color:#E6E6E6"/>
+<stop offset="1" style="stop-color:#BEBEBE"/>
+</linearGradient>
+<path d="M8.049,14.388V10.83c0.054-3.832,3.22-6.951,7.057-6.951c3.835,0,7.001,3.123,7.056,6.962v3.056H21.1  V10.83c-0.07-3.25-2.76-5.889-5.994-5.889c-3.236,0-5.925,2.634-5.995,5.872v3.574L8.049,14.388L8.049,14.388z" fill="url(#SVGID_3_)"/>
+<g>
+<rect fill="none" height="30" width="30"/>
+</g>
+<linearGradient gradientTransform="matrix(1 0 0 -1 8.3999 5.04)" gradientUnits="userSpaceOnUse" id="SVGID_4_" x1="-3.1958" x2="16.3945" y1="-15.3169" y2="-15.3169">
+<stop offset="0" style="stop-color:#ED8C0D"/>
+<stop offset="0.24" style="stop-color:#FFE692"/>
+<stop offset="0.75" style="stop-color:#ED8C0D"/>
+<stop offset="0.8667" style="stop-color:#FFB81F"/>
+<stop offset="1" style="stop-color:#ED8C0D"/>
+</linearGradient>
+<path d="M24.795,26.633c0,0.338-0.273,0.612-0.611,0.612H5.816c-0.338,0-0.612-0.274-0.612-0.612V14.082  c0-0.338,0.274-0.613,0.612-0.613h18.368c0.338,0,0.61,0.275,0.61,0.613L24.795,26.633L24.795,26.633z" fill="url(#SVGID_4_)"/>
+<path d="M24.184,13.469H5.816c-0.338,0-0.612,0.275-0.612,0.613v0.611  c0-0.338,0.274-0.611,0.612-0.611h18.368c0.338,0,0.61,0.273,0.61,0.611v-0.611C24.795,13.744,24.521,13.469,24.184,13.469z" fill="#FFFFFF" fill-opacity="0.4" stroke-opacity="0.4"/>
+<rect fill="#EE8F11" fill-opacity="0.5" height="2.144" stroke-opacity="0.5" width="19.591" x="5.204" y="16.225"/>
+<rect fill-opacity="0.25" height="0.308" stroke-opacity="0.25" width="19.591" x="5.204" y="16.225"/>
+<path d="M24.184,27.245H5.816c-0.338,0-0.612-0.274-0.612-0.612v-0.611  c0,0.338,0.274,0.611,0.612,0.611h18.368c0.338,0,0.61-0.273,0.61-0.611v0.611C24.795,26.971,24.521,27.245,24.184,27.245z" fill-opacity="0.25" stroke-opacity="0.25"/>
+<rect fill="#FEE38E" fill-opacity="0.25" height="0.307" stroke-opacity="0.25" width="19.591" x="5.204" y="18.367"/>
+</g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/resources/Keyguard_enabled_test.svg	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,1949 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://web.resource.org/cc/"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="128"
+   height="128"
+   id="svg2606"
+   sodipodi:version="0.32"
+   inkscape:version="0.45.1"
+   version="1.0"
+   sodipodi:docname="image-png.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   sodipodi:docbase="/home/pinheiro/pics/oxygen/scalable/mimetypes"
+   inkscape:export-filename="/home/pinheiro/artwork/Oxygen/David/imagesharperflaped.png"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  <defs
+     id="defs2608">
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4273"
+       id="linearGradient6204"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.811924,0,0,0.273245,55.77949,-173.6434)"
+       x1="105.41402"
+       y1="673.69873"
+       x2="274.53336"
+       y2="691.37091" />
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient31860">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop31862" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop31864" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4526"
+       id="linearGradient4670"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.616893,0,0,0.359632,55.77949,-173.6434)"
+       x1="322.5351"
+       y1="671.36499"
+       x2="305.54623"
+       y2="703.1059" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4526"
+       id="linearGradient4668"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.544849,0,0,0.407185,55.77949,-173.6434)"
+       x1="388.85477"
+       y1="581.20758"
+       x2="355.6568"
+       y2="561.59204" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4526"
+       id="linearGradient4666"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.544849,0,0,0.407185,55.77949,-173.6434)"
+       x1="391.99573"
+       y1="490.36765"
+       x2="343.76462"
+       y2="472.65836" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4526"
+       id="linearGradient4664"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.414913,0,0,0.534701,55.77949,-173.6434)"
+       x1="336.97562"
+       y1="514.06415"
+       x2="402.90091"
+       y2="491.13419" />
+    <linearGradient
+       id="linearGradient2797">
+      <stop
+         style="stop-color:#000000;stop-opacity:1.0000000;"
+         offset="0.0000000"
+         id="stop2799" />
+      <stop
+         style="stop-color:#484848;stop-opacity:1.0000000;"
+         offset="1.0000000"
+         id="stop2801" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2797"
+       id="linearGradient4662"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.470374,0,0,0.471655,55.77949,-173.6434)"
+       x1="313.85675"
+       y1="561.1123"
+       x2="355.78586"
+       y2="553.29712" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4526"
+       id="linearGradient4660"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.616893,0,0,0.359632,55.77949,-173.6434)"
+       x1="306.2883"
+       y1="672.46191"
+       x2="333.49854"
+       y2="707.75031" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4526"
+       id="linearGradient4658"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.544849,0,0,0.407185,55.77949,-173.6434)"
+       x1="391.99573"
+       y1="490.36765"
+       x2="343.76462"
+       y2="472.65836" />
+    <linearGradient
+       id="linearGradient4526">
+      <stop
+         id="stop4528"
+         offset="0.0000000"
+         style="stop-color:#ffffff;stop-opacity:0.69902915;" />
+      <stop
+         id="stop4530"
+         offset="1.0000000"
+         style="stop-color:#ffffff;stop-opacity:0.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4526"
+       id="linearGradient4656"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.544849,0,0,0.407185,55.77949,-173.6434)"
+       x1="388.85477"
+       y1="581.20758"
+       x2="355.6568"
+       y2="561.59204" />
+    <linearGradient
+       id="linearGradient4255"
+       inkscape:collect="always">
+      <stop
+         id="stop4257"
+         offset="0"
+         style="stop-color:#000000;stop-opacity:1;" />
+      <stop
+         id="stop4259"
+         offset="1"
+         style="stop-color:#000000;stop-opacity:0;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4255"
+       id="linearGradient4654"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.44753,0,0,0.49573,55.77949,-173.6434)"
+       x1="390.90793"
+       y1="442.95132"
+       x2="419.73016"
+       y2="470.11917" />
+    <linearGradient
+       id="linearGradient4516">
+      <stop
+         id="stop4518"
+         offset="0"
+         style="stop-color:#62004f;stop-opacity:1;" />
+      <stop
+         style="stop-color:#8d2778;stop-opacity:1;"
+         offset="0.14563107"
+         id="stop7294" />
+      <stop
+         id="stop4520"
+         offset="1"
+         style="stop-color:#ff00bf;stop-opacity:1;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4516"
+       id="linearGradient4652"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.480452,0,0,0.461761,55.77949,-173.6434)"
+       x1="299.42841"
+       y1="480.61096"
+       x2="419.73056"
+       y2="503.82071" />
+    <linearGradient
+       id="linearGradient2373">
+      <stop
+         id="stop2375"
+         offset="0.0000000"
+         style="stop-color:#083e20;stop-opacity:1.0000000;" />
+      <stop
+         id="stop2377"
+         offset="1.0000000"
+         style="stop-color:#245e3e;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2373"
+       id="linearGradient4650"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.852829,0,0,1.172568,-0.505078,0.252536)"
+       x1="249.71024"
+       y1="470.67639"
+       x2="268.70541"
+       y2="444.59937" />
+    <linearGradient
+       id="linearGradient2367">
+      <stop
+         id="stop2369"
+         offset="0.0000000"
+         style="stop-color:#957d16;stop-opacity:1.0000000;" />
+      <stop
+         id="stop2371"
+         offset="1.0000000"
+         style="stop-color:#927b16;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2367"
+       id="linearGradient4648"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(0.852829,1.172568)"
+       x1="249.71024"
+       y1="470.67639"
+       x2="268.70541"
+       y2="444.59937" />
+    <linearGradient
+       id="linearGradient2330">
+      <stop
+         id="stop2332"
+         offset="0.0000000"
+         style="stop-color:#54250d;stop-opacity:1.0000000;" />
+      <stop
+         id="stop2344"
+         offset="1.0000000"
+         style="stop-color:#9f4f19;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2330"
+       id="linearGradient4646"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.852829,0,0,1.172568,-4.61104,-5.494924)"
+       x1="249.71024"
+       y1="470.67639"
+       x2="268.70541"
+       y2="444.59937" />
+    <linearGradient
+       id="linearGradient2307">
+      <stop
+         id="stop2309"
+         offset="0"
+         style="stop-color:#8a1e51;stop-opacity:1;" />
+      <stop
+         id="stop2311"
+         offset="1.0000000"
+         style="stop-color:#7e1b4a;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2307"
+       id="linearGradient4644"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(0.852829,1.172568)"
+       x1="249.71024"
+       y1="470.67639"
+       x2="285.55072"
+       y2="455.34595" />
+    <linearGradient
+       id="linearGradient4498">
+      <stop
+         id="stop4500"
+         offset="0.0000000"
+         style="stop-color:#1a3b23;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4510"
+         offset="0.34000000"
+         style="stop-color:#255431;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4508"
+         offset="0.42000002"
+         style="stop-color:#306d40;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4506"
+         offset="0.62000000"
+         style="stop-color:#58c977;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4504"
+         offset="0.63999999"
+         style="stop-color:#2f6a3f;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4502"
+         offset="1.0000000"
+         style="stop-color:#86ffa7;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4498"
+       id="linearGradient4642"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.402062,0,0,0.551792,55.77949,-173.6434)"
+       x1="410.68747"
+       y1="351.94495"
+       x2="496.01123"
+       y2="446.42474" />
+    <linearGradient
+       id="linearGradient4472">
+      <stop
+         id="stop4474"
+         offset="0.0000000"
+         style="stop-color:#6a5000;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4486"
+         offset="0.36499998"
+         style="stop-color:#b49b1d;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4484"
+         offset="0.47000000"
+         style="stop-color:#ffe63b;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4480"
+         offset="0.62000000"
+         style="stop-color:#fde55f;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4482"
+         offset="0.65999997"
+         style="stop-color:#af8800;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4476"
+         offset="1.0000000"
+         style="stop-color:#fcff96;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4472"
+       id="linearGradient4640"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.410011,0,0,0.541094,55.77949,-173.6434)"
+       x1="407.20193"
+       y1="340.1315"
+       x2="509.36542"
+       y2="443.40552" />
+    <linearGradient
+       id="linearGradient4440">
+      <stop
+         id="stop4442"
+         offset="0.0000000"
+         style="stop-color:#7c2b00;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4458"
+         offset="0.35250002"
+         style="stop-color:#a56116;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4456"
+         offset="0.42500001"
+         style="stop-color:#cf982c;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4452"
+         offset="0.61000001"
+         style="stop-color:#ffdb59;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4448"
+         offset="0.63999999"
+         style="stop-color:#d07100;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4444"
+         offset="1.0000000"
+         style="stop-color:#fff77c;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4440"
+       id="linearGradient4638"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.395673,0,0,0.560701,55.96081,-173.4701)"
+       x1="426.25494"
+       y1="315.43689"
+       x2="542.82642"
+       y2="426.81122" />
+    <linearGradient
+       id="linearGradient4402">
+      <stop
+         id="stop4404"
+         offset="0.0000000"
+         style="stop-color:#540d0d;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4462"
+         offset="0.34999999"
+         style="stop-color:#7e2316;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4460"
+         offset="0.43000001"
+         style="stop-color:#a93a1f;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4410"
+         offset="0.62000000"
+         style="stop-color:#ff6731;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4412"
+         offset="0.66000003"
+         style="stop-color:#9f2819;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4436"
+         offset="0.77000004"
+         style="stop-color:#e1734d;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4406"
+         offset="1.0000000"
+         style="stop-color:#ffb47c;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4402"
+       id="linearGradient4636"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.400366,0,0,0.554129,55.74058,-173.7136)"
+       x1="438.62411"
+       y1="302.29001"
+       x2="560.68457"
+       y2="400.81851" />
+    <linearGradient
+       id="linearGradient4352">
+      <stop
+         id="stop4354"
+         offset="0.0000000"
+         style="stop-color:#833c0b;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4356"
+         offset="1.0000000"
+         style="stop-color:#723409;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4352"
+       id="linearGradient4633"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.476543,0,0,0.46555,55.77949,-173.6434)"
+       x1="178.40228"
+       y1="433.92719"
+       x2="274.36346"
+       y2="433.92719" />
+    <linearGradient
+       id="linearGradient4392">
+      <stop
+         id="stop4394"
+         offset="0.0000000"
+         style="stop-color:#214b2c;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4396"
+         offset="1.0000000"
+         style="stop-color:#1a3b23;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4392"
+       id="linearGradient4631"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.534168,0,0,0.415327,55.82726,-173.6161)"
+       x1="170.54399"
+       y1="569.89191"
+       x2="233.7466"
+       y2="533.10059" />
+    <linearGradient
+       id="linearGradient4360">
+      <stop
+         id="stop4362"
+         offset="0"
+         style="stop-color:#83190b;stop-opacity:1;" />
+      <stop
+         id="stop4364"
+         offset="1.0000000"
+         style="stop-color:#721509;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4360"
+       id="linearGradient4629"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.465924,0,0,0.47616,55.77949,-173.6434)"
+       x1="177.6402"
+       y1="411.45197"
+       x2="275.48526"
+       y2="411.45197" />
+    <linearGradient
+       id="linearGradient4382">
+      <stop
+         id="stop4384"
+         offset="0.0000000"
+         style="stop-color:#7e5c08;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4386"
+         offset="1.0000000"
+         style="stop-color:#6e4b11;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4382"
+       id="linearGradient4627"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.484895,0,0,0.457531,55.82726,-173.6161)"
+       x1="185.36516"
+       y1="498.74353"
+       x2="246.5347"
+       y2="442.2757" />
+    <linearGradient
+       id="linearGradient4321">
+      <stop
+         id="stop4323"
+         offset="0.0000000"
+         style="stop-color:#b20033;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4337"
+         offset="0.46000001"
+         style="stop-color:#ff7cba;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4339"
+         offset="0.55000001"
+         style="stop-color:#9c225b;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4325"
+         offset="1.0000000"
+         style="stop-color:#ff7ca1;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4321"
+       id="linearGradient4625"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.310584,0,0,0.714313,55.77949,-173.6434)"
+       x1="683.10022"
+       y1="231.87573"
+       x2="720.63422"
+       y2="271.91464" />
+    <linearGradient
+       id="linearGradient4368">
+      <stop
+         id="stop4370"
+         offset="0"
+         style="stop-color:#8a1e51;stop-opacity:1;" />
+      <stop
+         id="stop4372"
+         offset="1.0000000"
+         style="stop-color:#7e1b4a;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4368"
+       id="linearGradient4623"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.441119,0,0,0.502935,55.77949,-173.6434)"
+       x1="185.72665"
+       y1="378.45386"
+       x2="266.98257"
+       y2="378.45386" />
+    <linearGradient
+       id="linearGradient4273">
+      <stop
+         id="stop4275"
+         offset="0.0000000"
+         style="stop-color:#590012;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4466"
+         offset="0.93000001"
+         style="stop-color:#a3211f;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4468"
+         offset="0.94000000"
+         style="stop-color:#650014;stop-opacity:1.0000000;" />
+      <stop
+         id="stop4277"
+         offset="1.0000000"
+         style="stop-color:#ee6c68;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4273"
+       id="linearGradient4621"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.811924,0,0,0.273245,55.77949,-173.6434)"
+       x1="105.41402"
+       y1="673.69873"
+       x2="274.53336"
+       y2="691.37091" />
+    <linearGradient
+       id="linearGradient2441">
+      <stop
+         id="stop2443"
+         offset="0.0000000"
+         style="stop-color:#b0e9c0;stop-opacity:1.0000000;" />
+      <stop
+         id="stop2445"
+         offset="1.0000000"
+         style="stop-color:#75df92;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2441"
+       id="linearGradient4619"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(0.852829,1.172568)"
+       x1="273.20914"
+       y1="455.33145"
+       x2="276.42776"
+       y2="474.10953" />
+    <linearGradient
+       id="linearGradient2447">
+      <stop
+         id="stop2449"
+         offset="0.0000000"
+         style="stop-color:#ffd625;stop-opacity:1.0000000;" />
+      <stop
+         id="stop2451"
+         offset="1.0000000"
+         style="stop-color:#fff0ab;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2447"
+       id="linearGradient4617"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(0.852829,1.172568)"
+       x1="269.87866"
+       y1="468.31586"
+       x2="274.6358"
+       y2="450.71976" />
+    <linearGradient
+       id="linearGradient2453">
+      <stop
+         id="stop2455"
+         offset="0.0000000"
+         style="stop-color:#f6b94e;stop-opacity:1.0000000;" />
+      <stop
+         id="stop2457"
+         offset="1.0000000"
+         style="stop-color:#ffc340;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2453"
+       id="linearGradient4615"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(0.852829,1.172568)"
+       x1="262.95721"
+       y1="463.82385"
+       x2="271.31601"
+       y2="446.71695" />
+    <linearGradient
+       id="linearGradient2463">
+      <stop
+         id="stop2465"
+         offset="0.0000000"
+         style="stop-color:#fda5cf;stop-opacity:1.0000000;" />
+      <stop
+         id="stop2467"
+         offset="1.0000000"
+         style="stop-color:#ce2c79;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2463"
+       id="linearGradient4613"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(0.852829,1.172568)"
+       x1="258.13016"
+       y1="442.66943"
+       x2="247.02499"
+       y2="456.03308" />
+    <linearGradient
+       id="linearGradient2469">
+      <stop
+         id="stop2471"
+         offset="0.0000000"
+         style="stop-color:#f6754e;stop-opacity:1.0000000;" />
+      <stop
+         id="stop2473"
+         offset="1.0000000"
+         style="stop-color:#ffa879;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2469"
+       id="linearGradient4611"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.852829,0,0,1.172568,-12.28101,22.44028)"
+       x1="257.99484"
+       y1="431.38104"
+       x2="274.71591"
+       y2="420.00296" />
+    <linearGradient
+       id="linearGradient2785">
+      <stop
+         style="stop-color:#000000;stop-opacity:0.0000000;"
+         offset="0.0000000"
+         id="stop2787" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0.49803922;"
+         offset="0.36000001"
+         id="stop2793" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop2789" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2785"
+       id="linearGradient4609"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.453732,0,0,0.488954,57.57699,-173.4241)"
+       x1="277.5726"
+       y1="521.61127"
+       x2="316.56882"
+       y2="527.43481" />
+    <linearGradient
+       id="linearGradient2713">
+      <stop
+         id="stop2715"
+         offset="0.0000000"
+         style="stop-color:#b20033;stop-opacity:1.0000000;" />
+      <stop
+         id="stop2721"
+         offset="1.0000000"
+         style="stop-color:#ffe77c;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2713"
+       id="linearGradient4607"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(0.625932,1.597617)"
+       x1="542.85187"
+       y1="330.59"
+       x2="554.73236"
+       y2="359.37115" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2823"
+       id="linearGradient4605"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(1.121629,0.891561)"
+       x1="229.5614"
+       y1="692.33807"
+       x2="276.19287"
+       y2="715.24652" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2823"
+       id="linearGradient4603"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(1.121629,0.891561)"
+       x1="229.5614"
+       y1="692.33807"
+       x2="276.19287"
+       y2="715.24652" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2823"
+       id="linearGradient4601"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(1.121629,0.891561)"
+       x1="229.5614"
+       y1="692.33807"
+       x2="276.19287"
+       y2="715.24652" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2823"
+       id="linearGradient4599"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(1.121629,0.891561)"
+       x1="229.5614"
+       y1="692.33807"
+       x2="276.19287"
+       y2="715.24652" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2823"
+       id="linearGradient4597"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(1.121629,0.891561)"
+       x1="229.5614"
+       y1="692.33807"
+       x2="276.19287"
+       y2="715.24652" />
+    <linearGradient
+       id="linearGradient2823">
+      <stop
+         style="stop-color:#4d3719;stop-opacity:1;"
+         offset="0"
+         id="stop2825" />
+      <stop
+         style="stop-color:#ddae66;stop-opacity:1;"
+         offset="0.69999999"
+         id="stop2866" />
+      <stop
+         style="stop-color:#b2731c;stop-opacity:1;"
+         offset="1"
+         id="stop2827" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2823"
+       id="linearGradient4595"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(1.121629,0.891561)"
+       x1="261.13171"
+       y1="710.77112"
+       x2="267.06235"
+       y2="710.77136" />
+    <linearGradient
+       id="linearGradient3185">
+      <stop
+         id="stop3187"
+         offset="0"
+         style="stop-color:#50a3f7;stop-opacity:1;" />
+      <stop
+         id="stop3189"
+         offset="1"
+         style="stop-color:#002ea8;stop-opacity:1;" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3185"
+       id="linearGradient5341"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.3457951,0,0,2.1229785,538.33426,-11.05243)"
+       x1="-263.28992"
+       y1="56.713814"
+       x2="-263.14236"
+       y2="8.8705559" />
+    <linearGradient
+       id="linearGradient10207">
+      <stop
+         style="stop-color:#a2a2a2;stop-opacity:1;"
+         offset="0"
+         id="stop10209" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="1"
+         id="stop10211" />
+    </linearGradient>
+    <linearGradient
+       id="XMLID_12_"
+       gradientUnits="userSpaceOnUse"
+       x1="96"
+       y1="104"
+       x2="88.000198"
+       y2="96.000198">
+      <stop
+         offset="0"
+         style="stop-color:#888A85"
+         id="stop83" />
+      <stop
+         offset="0.0072"
+         style="stop-color:#8C8E89"
+         id="stop85" />
+      <stop
+         offset="0.0673"
+         style="stop-color:#ABACA9"
+         id="stop87" />
+      <stop
+         offset="0.1347"
+         style="stop-color:#C5C6C4"
+         id="stop89" />
+      <stop
+         offset="0.2652576"
+         style="stop-color:#DBDBDA"
+         id="stop91" />
+      <stop
+         offset="0.37646064"
+         style="stop-color:#EBEBEB"
+         id="stop93" />
+      <stop
+         offset="0.48740286"
+         style="stop-color:#F7F7F6"
+         id="stop95" />
+      <stop
+         offset="0.6324091"
+         style="stop-color:#FDFDFD"
+         id="stop97" />
+      <stop
+         offset="1"
+         style="stop-color:#FFFFFF"
+         id="stop99" />
+    </linearGradient>
+    <radialGradient
+       id="XMLID_8_"
+       cx="102"
+       cy="112.3047"
+       r="139.55859"
+       gradientUnits="userSpaceOnUse">
+      <stop
+         offset="0"
+         style="stop-color:#b7b8b9;stop-opacity:1;"
+         id="stop41" />
+      <stop
+         offset="0.18851049"
+         style="stop-color:#ECECEC"
+         id="stop47" />
+      <stop
+         offset="0.25718147"
+         style="stop-color:#FAFAFA"
+         id="stop49" />
+      <stop
+         offset="0.30111277"
+         style="stop-color:#FFFFFF"
+         id="stop51" />
+      <stop
+         offset="0.5313"
+         style="stop-color:#FAFAFA"
+         id="stop53" />
+      <stop
+         offset="0.8449"
+         style="stop-color:#EBECEC"
+         id="stop55" />
+      <stop
+         offset="1"
+         style="stop-color:#E1E2E3"
+         id="stop57" />
+    </radialGradient>
+    <filter
+       inkscape:collect="always"
+       x="-0.19200002"
+       width="1.3839999"
+       y="-0.19199999"
+       height="1.3839999"
+       id="filter6697">
+      <feGaussianBlur
+         inkscape:collect="always"
+         stdDeviation="1.9447689"
+         id="feGaussianBlur6699" />
+    </filter>
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath7084">
+      <path
+         style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+         d="M 72,88 L 40,120 L 32,120 L 32,80 L 72,80 L 72,88 z"
+         id="path7086" />
+    </clipPath>
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#XMLID_8_"
+       id="radialGradient9437"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1,0,0,0.9996653,-7.999998,16.003016)"
+       cx="114"
+       cy="95.028786"
+       r="139.55859"
+       fx="114"
+       fy="95.028786" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10207"
+       id="linearGradient10213"
+       x1="98.617439"
+       y1="106.41443"
+       x2="91.228737"
+       y2="99.254974"
+       gradientUnits="userSpaceOnUse" />
+    <filter
+       inkscape:collect="always"
+       id="filter2770">
+      <feGaussianBlur
+         inkscape:collect="always"
+         stdDeviation="2.0786429"
+         id="feGaussianBlur2772" />
+    </filter>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3185"
+       id="linearGradient4882"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.3457951,0,0,2.1229785,538.33426,-11.05243)"
+       x1="-263.14236"
+       y1="72.386543"
+       x2="-263.14236"
+       y2="-21.190172" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2823"
+       id="linearGradient4884"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(1.121629,0.891561)"
+       x1="261.13171"
+       y1="710.77112"
+       x2="267.06235"
+       y2="710.77136" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2823"
+       id="linearGradient4886"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(1.121629,0.891561)"
+       x1="229.5614"
+       y1="692.33807"
+       x2="276.19287"
+       y2="715.24652" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2823"
+       id="linearGradient4888"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(1.121629,0.891561)"
+       x1="229.5614"
+       y1="692.33807"
+       x2="276.19287"
+       y2="715.24652" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2823"
+       id="linearGradient4890"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(1.121629,0.891561)"
+       x1="229.5614"
+       y1="692.33807"
+       x2="276.19287"
+       y2="715.24652" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2823"
+       id="linearGradient4892"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(1.121629,0.891561)"
+       x1="229.5614"
+       y1="692.33807"
+       x2="276.19287"
+       y2="715.24652" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2823"
+       id="linearGradient4894"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(1.121629,0.891561)"
+       x1="229.5614"
+       y1="692.33807"
+       x2="276.19287"
+       y2="715.24652" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2713"
+       id="linearGradient4896"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(0.625932,1.597617)"
+       x1="542.85187"
+       y1="330.59"
+       x2="554.73236"
+       y2="359.37115" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2785"
+       id="linearGradient4898"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.453732,0,0,0.488954,57.57699,-173.4241)"
+       x1="277.5726"
+       y1="521.61127"
+       x2="316.56882"
+       y2="527.43481" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2469"
+       id="linearGradient4900"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.852829,0,0,1.172568,-12.28101,22.44028)"
+       x1="257.99484"
+       y1="431.38104"
+       x2="274.71591"
+       y2="420.00296" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2463"
+       id="linearGradient4902"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(0.852829,1.172568)"
+       x1="258.13016"
+       y1="442.66943"
+       x2="247.02499"
+       y2="456.03308" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2453"
+       id="linearGradient4904"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(0.852829,1.172568)"
+       x1="262.95721"
+       y1="463.82385"
+       x2="271.31601"
+       y2="446.71695" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2447"
+       id="linearGradient4906"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(0.852829,1.172568)"
+       x1="269.87866"
+       y1="468.31586"
+       x2="274.6358"
+       y2="450.71976" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2441"
+       id="linearGradient4908"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(0.852829,1.172568)"
+       x1="273.20914"
+       y1="455.33145"
+       x2="276.42776"
+       y2="474.10953" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4273"
+       id="linearGradient4910"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.811924,0,0,0.273245,55.77949,-173.6434)"
+       x1="105.41402"
+       y1="673.69873"
+       x2="274.53336"
+       y2="691.37091" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4368"
+       id="linearGradient4912"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.441119,0,0,0.502935,55.77949,-173.6434)"
+       x1="185.72665"
+       y1="378.45386"
+       x2="266.98257"
+       y2="378.45386" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4321"
+       id="linearGradient4914"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.310584,0,0,0.714313,55.77949,-173.6434)"
+       x1="683.10022"
+       y1="231.87573"
+       x2="720.63422"
+       y2="271.91464" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4382"
+       id="linearGradient4916"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.484895,0,0,0.457531,55.82726,-173.6161)"
+       x1="185.36516"
+       y1="498.74353"
+       x2="246.5347"
+       y2="442.2757" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4360"
+       id="linearGradient4918"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.465924,0,0,0.47616,55.77949,-173.6434)"
+       x1="177.6402"
+       y1="411.45197"
+       x2="275.48526"
+       y2="411.45197" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4392"
+       id="linearGradient4920"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.534168,0,0,0.415327,55.82726,-173.6161)"
+       x1="170.54399"
+       y1="569.89191"
+       x2="233.7466"
+       y2="533.10059" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4352"
+       id="linearGradient4922"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.476543,0,0,0.46555,55.77949,-173.6434)"
+       x1="178.40228"
+       y1="433.92719"
+       x2="274.36346"
+       y2="433.92719" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4402"
+       id="linearGradient4924"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.400366,0,0,0.554129,55.74058,-173.7136)"
+       x1="438.62411"
+       y1="302.29001"
+       x2="560.68457"
+       y2="400.81851" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4440"
+       id="linearGradient4926"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.395673,0,0,0.560701,55.96081,-173.4701)"
+       x1="426.25494"
+       y1="315.43689"
+       x2="542.82642"
+       y2="426.81122" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4472"
+       id="linearGradient4928"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.410011,0,0,0.541094,55.77949,-173.6434)"
+       x1="407.20193"
+       y1="340.1315"
+       x2="509.36542"
+       y2="443.40552" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4498"
+       id="linearGradient4930"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.402062,0,0,0.551792,55.77949,-173.6434)"
+       x1="410.68747"
+       y1="351.94495"
+       x2="496.01123"
+       y2="446.42474" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2307"
+       id="linearGradient4932"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(0.852829,1.172568)"
+       x1="249.71024"
+       y1="470.67639"
+       x2="285.55072"
+       y2="455.34595" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2330"
+       id="linearGradient4934"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.852829,0,0,1.172568,-4.61104,-5.494924)"
+       x1="249.71024"
+       y1="470.67639"
+       x2="268.70541"
+       y2="444.59937" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2367"
+       id="linearGradient4936"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(0.852829,1.172568)"
+       x1="249.71024"
+       y1="470.67639"
+       x2="268.70541"
+       y2="444.59937" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2373"
+       id="linearGradient4938"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.852829,0,0,1.172568,-0.505078,0.252536)"
+       x1="249.71024"
+       y1="470.67639"
+       x2="268.70541"
+       y2="444.59937" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4516"
+       id="linearGradient4940"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.480452,0,0,0.461761,55.77949,-173.6434)"
+       x1="299.42841"
+       y1="480.61096"
+       x2="419.73056"
+       y2="503.82071" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4255"
+       id="linearGradient4942"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.44753,0,0,0.49573,55.77949,-173.6434)"
+       x1="390.90793"
+       y1="442.95132"
+       x2="419.73016"
+       y2="470.11917" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4526"
+       id="linearGradient4944"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.544849,0,0,0.407185,55.77949,-173.6434)"
+       x1="388.85477"
+       y1="581.20758"
+       x2="355.6568"
+       y2="561.59204" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4526"
+       id="linearGradient4946"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.544849,0,0,0.407185,55.77949,-173.6434)"
+       x1="391.99573"
+       y1="490.36765"
+       x2="343.76462"
+       y2="472.65836" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4526"
+       id="linearGradient4948"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.616893,0,0,0.359632,55.77949,-173.6434)"
+       x1="306.2883"
+       y1="672.46191"
+       x2="333.49854"
+       y2="707.75031" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2797"
+       id="linearGradient4950"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.470374,0,0,0.471655,55.77949,-173.6434)"
+       x1="313.85675"
+       y1="561.1123"
+       x2="355.78586"
+       y2="553.29712" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4526"
+       id="linearGradient4952"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.414913,0,0,0.534701,55.77949,-173.6434)"
+       x1="336.97562"
+       y1="514.06415"
+       x2="402.90091"
+       y2="491.13419" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4526"
+       id="linearGradient4954"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.544849,0,0,0.407185,55.77949,-173.6434)"
+       x1="391.99573"
+       y1="490.36765"
+       x2="343.76462"
+       y2="472.65836" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4526"
+       id="linearGradient4956"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.544849,0,0,0.407185,55.77949,-173.6434)"
+       x1="388.85477"
+       y1="581.20758"
+       x2="355.6568"
+       y2="561.59204" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient4526"
+       id="linearGradient4958"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.616893,0,0,0.359632,55.77949,-173.6434)"
+       x1="322.5351"
+       y1="671.36499"
+       x2="305.54623"
+       y2="703.1059" />
+    <linearGradient
+       y2="154.50412"
+       x2="210.98608"
+       y1="154.50412"
+       x1="155.21127"
+       gradientTransform="matrix(0.9295551,0,0,0.9288601,-84.40008,12.847771)"
+       gradientUnits="userSpaceOnUse"
+       id="linearGradient9061"
+       xlink:href="#linearGradient6001"
+       inkscape:collect="always" />
+    <linearGradient
+       y2="167.16171"
+       x2="83.742836"
+       y1="154.27817"
+       x1="82.802177"
+       gradientTransform="matrix(0.6260112,0,0,0.2001745,68.175377,138.95724)"
+       gradientUnits="userSpaceOnUse"
+       id="linearGradient8903"
+       xlink:href="#linearGradient3426"
+       inkscape:collect="always" />
+    <linearGradient
+       id="linearGradient3134">
+      <stop
+         id="stop3136"
+         offset="0"
+         style="stop-color:#ffd500;stop-opacity:1;" />
+      <stop
+         id="stop3138"
+         offset="1"
+         style="stop-color:#ff7e00;stop-opacity:1;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient3146">
+      <stop
+         id="stop3148"
+         offset="0"
+         style="stop-color:#ff7e00;stop-opacity:1;" />
+      <stop
+         id="stop3150"
+         offset="1"
+         style="stop-color:#ffd500;stop-opacity:1;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient3158">
+      <stop
+         id="stop3160"
+         offset="0"
+         style="stop-color:#fff8de;stop-opacity:1;" />
+      <stop
+         id="stop3162"
+         offset="1"
+         style="stop-color:#ffff00;stop-opacity:1;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient3426"
+       inkscape:collect="always">
+      <stop
+         id="stop3428"
+         offset="0"
+         style="stop-color:#555555;stop-opacity:1;" />
+      <stop
+         id="stop3430"
+         offset="1"
+         style="stop-color:#555555;stop-opacity:0;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient6001"
+       inkscape:collect="always">
+      <stop
+         id="stop6003"
+         offset="0"
+         style="stop-color:#000000;stop-opacity:1;" />
+      <stop
+         id="stop6005"
+         offset="1"
+         style="stop-color:#000000;stop-opacity:0;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient7545">
+      <stop
+         id="stop7547"
+         offset="0"
+         style="stop-color:#323232;stop-opacity:1;" />
+      <stop
+         id="stop7549"
+         offset="1"
+         style="stop-color:#101010;stop-opacity:1;" />
+    </linearGradient>
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath4318">
+      <path
+         style="opacity:0.48888891;fill:#f9f2ea;fill-opacity:1;stroke:none;stroke-width:0.1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+         d="M 1.954599,2.1834159 L 1.954599,187.15135 L 256.71404,187.15135 L 256.71404,2.1834159 L 1.954599,2.1834159 z "
+         id="path4320" />
+    </clipPath>
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath31854">
+      <path
+         style="opacity:0.48888891;fill:#f9f2ea;fill-opacity:1;stroke:none;stroke-width:0.1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+         d="M 12,28 L 12,108 L 92.5,108 L 116,82.75 L 116,28 L 12,28 z "
+         id="path31856"
+         sodipodi:nodetypes="cccccc" />
+    </clipPath>
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient31860"
+       id="radialGradient31866"
+       cx="101.5"
+       cy="92.997192"
+       fx="101.5"
+       fy="92.997192"
+       r="21.5"
+       gradientTransform="matrix(0.7247027,0.6890616,-0.6744186,0.7093023,90.661709,-42.65288)"
+       gradientUnits="userSpaceOnUse" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient6001"
+       id="linearGradient8360"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.4103611,0,0,0.4330773,-28.25306,27.952127)"
+       x1="121.40629"
+       y1="177.05572"
+       x2="177.1811"
+       y2="177.05572" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="1"
+     inkscape:cx="-126.82503"
+     inkscape:cy="44.445553"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     width="128px"
+     height="128px"
+     gridspacingx="4px"
+     gridspacingy="4px"
+     gridempspacing="2"
+     showgrid="true"
+     inkscape:grid-points="true"
+     showguides="true"
+     inkscape:guide-bbox="true"
+     inkscape:window-width="1016"
+     inkscape:window-height="692"
+     inkscape:window-x="351"
+     inkscape:window-y="46"
+     showborder="true">
+    <sodipodi:guide
+       orientation="horizontal"
+       position="40.875"
+       id="guide5004" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata2611">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Livello 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <path
+       style="opacity:0.5;fill:#000000;fill-opacity:1;filter:url(#filter2770)"
+       d="M 16,8 L 16,96.626087 C 16,96.626087 94.51625,96.626087 94.51625,96.626087 L 94.5475,96.626087 C 94.547503,96.626087 106.45375,86.719837 111.95375,81.219837 C 117.45375,75.719837 127.36,63.813587 127.36,63.813587 L 127.36,63.782337 L 127.36,8 L 16,8 z "
+       id="path7865"
+       sodipodi:nodetypes="csccscccc"
+       transform="matrix(1.0416667,0,0,1.0267857,-10.666667,14.785711)" />
+    <path
+       style="fill:#ffffff;fill-opacity:1"
+       d="M 8.000001,24 L 8,112 C 8,112 87.146418,112 87.146418,112 L 120,79.14642 L 120,24 L 8.000001,24 z "
+       id="path34"
+       sodipodi:nodetypes="cccccc" />
+    <path
+       style="fill:url(#radialGradient9437);fill-opacity:1"
+       d="M 10.000002,25.000003 C 9.449002,25.000003 9.000002,25.448853 9.000002,25.999668 L 9.000002,109.96352 C 9.000002,110.51533 9.449002,110.96318 10.000002,110.96318 L 85.171999,110.96318 C 85.434999,110.96318 87.934679,111.08131 88.12068,110.89438 L 118.707,80.094202 C 118.894,79.907264 119,77.40942 119,77.146508 L 119,25.999668 C 119,25.448853 118.552,25.000003 118,25.000003 L 10.000002,25.000003 z "
+       id="path59"
+       sodipodi:nodetypes="ccccccccccc" />
+    <g
+       id="g4805"
+       transform="matrix(0.9166667,0,0,0.9166667,-112.66667,13.33333)">
+      <path
+         sodipodi:nodetypes="cccccc"
+         id="rect3183"
+         d="M 136,16 L 249.45454,16 L 249.45454,78.40711 L 223.14295,103.27273 L 136,103.27273 L 136,16 z "
+         style="fill:url(#linearGradient4882);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.20000005;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dashoffset:4;stroke-opacity:1" />
+      <g
+         transform="matrix(0.5620693,0,0,0.6015749,58.600837,15.161068)"
+         id="g4460">
+        <path
+           style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.5138334px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+           d="M 187.22261,104.20627 C 187.22261,104.20627 187.22261,102.23277 187.22261,104.20627 z "
+           id="path4462" />
+        <path
+           style="fill:#422f17;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.5138334px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+           d="M 183.201,113.07522 C 193.37175,108.10319 193.63086,108.52844 200.46351,113.69314 L 200.29499,105.21496 C 200.35117,105.10532 201.41844,103.68002 201.41844,105.21496 C 201.41844,106.7499 201.64313,115.74027 201.64313,115.74027 C 201.64313,115.74027 201.13758,128.18425 199.34006,129.171 C 197.99193,129.60955 189.06054,134.37883 189.06054,134.37883 C 189.06054,134.37883 187.26303,135.25594 185.91489,134.37883 C 184.56675,133.50173 176.92733,128.0198 176.92733,128.0198 C 176.92733,128.0198 175.80388,126.92341 176.47795,125.60775 C 177.15201,124.29208 186.54379,99.322577 188.7681,101.64836"
+           id="path4464"
+           sodipodi:nodetypes="ccccccccccz" />
+        <g
+           id="g4466"
+           style="fill:url(#linearGradient8360);fill-opacity:1"
+           transform="matrix(0.476791,0,0,0.465307,56.04458,-173.9504)">
+          <path
+             style="fill:url(#linearGradient4886);fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+             d="M 263.1947,617.63145 L 282.04481,607.26389 C 282.04481,607.26389 286.52172,604.90763 291.23424,608.2064 C 295.94677,611.50517 305.37183,619.28084 305.37183,619.28084 L 306.19652,623.28649 L 290.0847,610.59125 C 289.08502,610.42464 286.38369,608.94186 283.45857,609.85578 C 280.86668,611.26954 261.20025,622.17737 261.20025,622.17737 L 263.1947,617.63145 z "
+             id="path4468"
+             sodipodi:nodetypes="ccccccccc" />
+          <path
+             style="fill:url(#linearGradient4888);fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+             d="M 260.84963,623.11423 L 282.16544,611.73514 C 282.16544,611.73514 286.1711,608.90763 290.88362,612.2064 C 295.59615,615.50517 306.90623,624.6946 305.96372,624.22335 L 305.6995,630.43604 L 287.34923,616.32704 C 287.34923,616.32704 283.81483,614.67765 281.22294,616.09141 C 278.63105,617.50517 258.13155,628.57961 258.13155,628.57961 L 260.84963,623.11423 z "
+             id="path4471"
+             sodipodi:nodetypes="ccccccccc" />
+          <path
+             style="fill:url(#linearGradient4890);fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+             d="M 257.89592,629.40713 L 280.0448,617.86143 C 280.0448,617.86143 284.05046,615.03392 288.76298,618.33269 C 293.47551,621.63146 306.35759,631.99903 305.41508,631.52778 L 304.9236,637.22041 L 285.22859,622.45333 C 285.22859,622.45333 281.69419,620.80394 279.1023,622.2177 C 276.51041,623.63146 256.01091,634.7059 256.01091,634.7059 L 257.89592,629.40713 z "
+             id="path4473"
+             sodipodi:nodetypes="ccccccccc" />
+          <path
+             style="fill:url(#linearGradient4892);fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+             d="M 255.53966,635.29779 L 277.68854,623.75209 C 277.68854,623.75209 281.6942,620.92458 286.40672,624.22335 C 291.11925,627.52212 305.67931,638.38115 304.7368,637.9099 L 303.84308,644.36659 L 282.87233,628.34399 C 282.87233,628.34399 279.33793,626.6946 276.74604,628.10836 C 274.15415,629.52212 253.65465,640.59656 253.65465,640.59656 L 255.53966,635.29779 z "
+             id="path4475"
+             sodipodi:nodetypes="ccccccccc" />
+          <path
+             style="fill:url(#linearGradient4894);fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+             d="M 253.29839,641.66534 L 275.44727,629.41277 C 275.44727,629.41277 279.92418,626.22344 284.6367,630.35528 C 289.34923,633.65405 303.72244,644.96412 303.72244,644.96412 C 303.80098,647.32038 302.70139,649.79446 301.13055,651.32603 C 301.44472,649.51956 304.11515,648.41997 300.42367,645.55318 L 282.32022,632.57352 C 281.32055,632.07368 278.78582,630.92413 276.19393,632.33789 C 273.60204,633.75165 253.76964,644.49286 253.76964,644.49286 L 253.29839,641.66534 z "
+             id="path4477"
+             sodipodi:nodetypes="cccccccccc" />
+        </g>
+        <path
+           style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.5138334px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.55940594"
+           d="M 202.05456,103.14424 C 202.05456,103.14424 216.03593,126.86726 225.09204,93.530989"
+           id="path4479"
+           sodipodi:nodetypes="cc" />
+        <g
+           id="g4481"
+           transform="matrix(0.476791,0,0,0.465307,55.77949,-173.6434)">
+          <path
+             style="fill:url(#linearGradient4896);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+             d="M 338.22446,521.19983 C 338.22446,521.19983 377.21191,565.18567 333.22607,578.18149 C 329.89381,579.18117 338.22446,521.19983 338.22446,521.19983 z "
+             id="path4483"
+             sodipodi:nodetypes="ccc" />
+          <path
+             style="fill:#0b6c46;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 275.0748,560.94594 L 275.21707,570.0003 C 283.27792,574.86011 293.10363,578.29621 303.96622,579.55254 C 314.81983,580.80783 325.18449,579.70093 334.1368,576.81477 L 333.99453,567.76041 C 325.93737,562.90699 284.03215,558.05439 275.0748,560.94594 z "
+             id="path4485"
+             sodipodi:nodetypes="cccccc" />
+          <path
+             style="fill:#bea613;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 275.68002,559.47428 L 275.57592,566.89757 C 283.50748,571.92005 293.36967,575.46859 304.29245,576.73188 C 315.20005,577.99342 325.63274,576.80211 334.49332,573.73219 L 334.60208,566.26861 C 326.67617,561.25722 284.54863,556.39486 275.68002,559.47428 z "
+             id="path4487"
+             sodipodi:nodetypes="cccccc" />
+          <path
+             style="fill:#b37711;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 276.88308,547.60287 L 276.00468,563.19042 C 283.77731,568.47998 293.58498,572.288 304.65829,573.56871 C 315.7236,574.84849 326.15339,573.37529 334.92441,570.00489 L 335.80281,554.41734 C 328.03268,549.13385 285.65791,544.22713 276.88308,547.60287 z "
+             id="path4489"
+             sodipodi:nodetypes="cccccc" />
+          <path
+             style="fill:#ac182a;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 277.50759,547.18114 L 276.67811,557.36777 C 284.00502,563.19427 293.8856,567.44309 305.21521,568.75344 C 316.54212,570.06348 327.13535,568.18047 335.59784,564.18225 L 336.42732,553.99561 C 329.10088,548.17129 285.97104,543.1809 277.50759,547.18114 z "
+             id="path4491"
+             sodipodi:nodetypes="cccccc" />
+          <path
+             style="fill:#be2873;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 278.81487,540.62031 L 277.33523,551.68616 C 284.05502,558.16146 294.04935,562.94986 305.73019,564.30083 C 317.38774,565.64911 328.23427,563.29207 336.2503,558.54093 L 337.73926,547.39449 C 331.01935,540.93903 286.83532,535.84983 278.81487,540.62031 z "
+             id="path4493"
+             sodipodi:nodetypes="cccccc" />
+          <path
+             style="fill:#ab0d2d;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 279.47201,530.46825 L 278.30926,543.26448 C 283.43866,551.13384 293.77039,557.26207 306.37566,558.71996 C 318.97018,560.1766 330.43404,556.57932 337.22666,550.0991 L 338.39407,537.26258 C 333.25996,529.40295 286.26227,523.97748 279.47201,530.46825 z "
+             id="path4495"
+             sodipodi:nodetypes="cccccc" />
+          <path
+             style="fill:#8d0b1e;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 280.98901,520.09478 L 279.05493,536.81726 C 283.24905,544.62442 293.92558,550.97115 307.09569,552.49436 C 320.24075,554.01468 332.09271,550.29201 337.97,543.67203 L 339.9134,526.86896 C 335.70236,519.08219 286.85447,513.45108 280.98901,520.09478 z "
+             id="path4497"
+             sodipodi:nodetypes="cccccc" />
+          <path
+             style="fill:#790a59;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 281.88381,512.35812 L 279.94973,529.0806 C 284.14385,536.88776 294.82038,543.23448 307.9905,544.7577 C 321.13555,546.27801 332.98752,542.55535 338.8648,535.93536 L 340.8082,519.1323 C 336.59716,511.34553 287.74927,505.71442 281.88381,512.35812 z "
+             id="path4499"
+             sodipodi:nodetypes="cccccc" />
+          <path
+             style="fill:#002c91;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 282.92775,503.33201 L 280.99367,520.05449 C 285.18778,527.86165 295.86432,534.20837 309.03443,535.73159 C 322.17949,537.25191 334.03145,533.52924 339.90874,526.90926 L 341.85214,510.10619 C 337.6411,502.31942 288.79321,496.68831 282.92775,503.33201 z "
+             id="path4501"
+             sodipodi:nodetypes="cccccc" />
+          <path
+             style="fill:#0b6c46;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 248.40625,547.75 L 253.90625,562.53125 L 267.34375,573.6875 C 270.1161,572.87512 272.81821,571.85611 275.375,570.46875 L 277.1875,555.125 C 273.53213,551.65247 260.03014,548.67004 248.40625,547.75 z "
+             id="path4503" />
+          <path
+             style="fill:#bea613;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 247.0625,544.125 L 253.90625,562.53125 L 264.21875,571.09375 C 268.30846,570.26259 272.21002,568.75831 275.84375,566.65625 L 277.4375,551.75 C 273.68372,547.98759 259.044,544.83986 247.0625,544.125 z "
+             id="path4505" />
+          <path
+             style="fill:#9f690f;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 247.5,545.3125 L 253.90625,562.53125 L 260.09375,567.65625 C 265.91841,567.12148 271.4714,565.18231 276.4375,562.03125 L 277.25,553.15625 C 273.64896,549.24433 259.39196,546.0513 247.5,545.3125 z "
+             id="path4507" />
+          <path
+             style="fill:#a01728;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 242.34375,533.09375 C 238.15485,533.3011 234.78501,534.0274 233.0625,535.34375 L 232.8125,537.59375 L 243.25,533.875 L 253.5625,561.59375 C 262.23387,562.6764 270.53733,560.01218 277.34375,554.8125 L 278.75,541.53125 C 274.73183,536.34031 254.91044,532.4717 242.34375,533.09375 z "
+             id="path4509" />
+          <path
+             style="fill:#ae055a;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 233.90026,527.51949 L 232.5274,541.56434 C 237.36729,549.31327 244.88205,554.85296 253.9423,556.07987 C 262.9845,557.30434 271.63361,553.97964 278.22229,547.80305 L 279.60771,533.65824 C 274.76644,525.93383 240.49366,521.31884 233.90026,527.51949 z "
+             id="path4511"
+             sodipodi:nodetypes="cccccc" />
+          <path
+             style="fill:#9e0c2a;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 235.3218,518.43899 L 233.84056,531.11784 C 237.34375,540.65021 245.03521,547.83318 254.81251,549.15719 C 264.58147,550.48008 273.79512,545.59896 279.53859,537.33156 L 281.02611,524.60272 C 277.51859,515.08257 241.06411,510.15862 235.3218,518.43899 z "
+             id="path4513"
+             sodipodi:nodetypes="cccccc" />
+          <path
+             style="fill:#720818;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 237.45332,502.37747 L 234.84585,523.12052 C 237.62058,532.61147 245.56782,540.05144 255.78324,541.43478 C 265.97922,542.81549 275.50503,537.76468 280.54074,529.35923 L 283.16077,508.51621 C 280.37145,499.05111 242.48132,493.94315 237.45332,502.37747 z "
+             id="path4515"
+             sodipodi:nodetypes="cccccc" />
+          <path
+             style="fill:#67094d;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 238.65967,492.78069 L 236.0522,513.52374 C 238.82693,523.01468 246.77417,530.45465 256.98959,531.838 C 267.18557,533.21871 276.71138,528.1679 281.74708,519.76244 L 284.36712,498.91943 C 281.5778,489.45433 243.68766,484.34636 238.65967,492.78069 z "
+             id="path4517"
+             sodipodi:nodetypes="cccccc" />
+          <path
+             style="fill:#0035a8;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 240.06707,481.58444 L 237.4596,502.32749 C 240.23433,511.81844 248.18158,519.25841 258.397,520.64175 C 268.59297,522.02246 278.11878,516.97165 283.15449,508.5662 L 285.77453,487.72318 C 282.98521,478.25808 245.09507,473.15011 240.06707,481.58444 z "
+             id="path4519"
+             sodipodi:nodetypes="cccccc" />
+          <path
+             style="fill:#00a867;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 240.87131,475.18658 L 238.26383,495.92963 C 241.03856,505.42058 248.31935,510.86119 258.53477,512.24454 C 268.73075,513.62525 278.92301,510.5738 283.95872,502.16834 L 286.57876,481.32533 C 283.78944,471.86023 245.8993,466.75226 240.87131,475.18658 z "
+             id="path4521"
+             sodipodi:nodetypes="cccccc" />
+          <path
+             style="fill:#006145;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
+             d="M 284.92775,491.33201 L 282.99367,508.05449 C 287.18778,515.86165 297.86432,522.20837 311.03443,523.73159 C 324.17949,525.25191 336.03145,521.52924 341.90874,514.90926 L 343.85214,498.10619 C 339.6411,490.31942 290.79321,484.68831 284.92775,491.33201 z "
+             id="path4523"
+             sodipodi:nodetypes="cccccc" />
+        </g>
+        <path
+           style="fill:url(#linearGradient4898);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+           d="M 190.03122,64.297807 C 190.03122,64.297807 182.72882,69.231546 180.36959,90.17252 C 184.97572,95.764091 211.15199,97.518308 211.15199,97.518308 C 211.15199,97.518308 205.42243,73.836368 208.90511,64.736364"
+           id="path4525"
+           sodipodi:nodetypes="cccc" />
+        <g
+           id="g4527"
+           transform="matrix(-0.774175,-0.401016,-0.348567,0.890665,597.6601,-302.2593)">
+          <path
+             style="fill:url(#linearGradient4900);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+             d="M 207.7583,506.50835 C 206.40141,508.14027 202.6659,520.80791 217.80808,536.11211 C 209.99845,521.01422 210.25164,515.35549 212.77702,513.84026 C 211.26179,512.57757 211.79891,504.74058 207.7583,506.50835 z "
+             id="path4529"
+             sodipodi:nodetypes="cccc" />
+          <path
+             style="fill:url(#linearGradient4902);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+             d="M 210.95084,511.50794 C 210.95084,511.50794 205.53158,526.18807 221.81423,540.68643 C 214.0046,525.58854 214.65742,520.7694 217.1828,519.25417 C 215.66757,517.99148 214.99145,509.74017 210.95084,511.50794 z "
+             id="path4531"
+             sodipodi:nodetypes="cccc" />
+          <path
+             style="fill:url(#linearGradient4904);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+             d="M 215.63896,514.69258 C 214.26567,516.28385 212.37855,522.69625 221.02957,539.78214 C 224.42558,543.33631 225.80981,544.21794 228.40596,546.12917 C 225.88057,540.57332 225.18702,531.44512 225.18702,531.44512 C 225.18702,531.44511 222.30922,521.66678 215.63896,514.69258 z "
+             id="path4533"
+             sodipodi:nodetypes="ccccc" />
+          <path
+             style="fill:url(#linearGradient4906);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+             d="M 220.25,520.1875 C 218.87671,521.77877 217.69273,527.32036 226.34375,544.40625 C 226.73044,544.6265 227.16007,545.21026 234.57596,551.27054 C 232.05057,545.71469 229.79806,536.94004 229.79806,536.94004 C 229.79806,536.94003 226.92026,527.1617 220.25,520.1875 z "
+             id="path4535"
+             sodipodi:nodetypes="ccccc" />
+          <path
+             style="fill:url(#linearGradient4908);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+             d="M 226.43242,527.87754 C 225.19989,531.53305 222.40285,535.39769 233.4082,550.0827 C 236.39784,552.68732 237.75066,552.31339 241.50027,554.94898 C 238.97488,549.39313 233.83867,536.94004 233.83867,536.94004 C 233.83867,536.94003 230.56317,532.74151 226.43242,527.87754 z "
+             id="path4537"
+             sodipodi:nodetypes="ccccc" />
+        </g>
+        <path
+           style="fill:url(#linearGradient6204);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+           d="M 147.23396,1.5882927 C 147.13465,2.646801 146.98467,5.018187 147.77035,8.3934076 C 146.71944,8.7518336 142.71094,10.274486 139.09871,21.320218 C 141.74768,16.6199 141.9984,15.68199 148.50043,10.981678 C 148.72205,9.0350846 149.12685,6.368708 151.61447,1.5882927 L 147.23396,1.5882927 z M 266.35721,1.5882927 C 267.93182,4.3792274 271.22943,10.952536 270.11194,15.67837 C 269.87112,16.383427 269.32225,18.148541 269.32225,18.324804 C 271.12838,19.441122 277.62699,22.665569 280.03515,37.824075 C 280.45658,31.654914 282.6271,21.609411 270.82712,13.0901 C 272.37122,8.9999353 272.85313,6.0215192 272.37669,1.5882927 L 266.35721,1.5882927 z "
+           id="path4539" />
+        <path
+           style="fill:url(#linearGradient4912);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+           d="M 151.33138,1.5882927 C 150.48086,3.2294259 148.16646,7.8677178 148.47063,10.923514 C 143.724,13.810912 141.42889,16.685518 139.20301,21.291136 L 139.21791,21.203891 C 139.21791,21.203896 136.26512,28.807398 138.60702,37.126115 C 138.99068,33.147428 137.3331,25.956979 148.85802,14.558725 C 148.80375,14.543877 150.01326,17.8718 151.25688,20.49139 C 151.54908,19.347051 149.72571,9.4677224 164.91992,1.5882927 L 151.33138,1.5882927 z "
+           id="path4541" />
+        <path
+           style="fill:url(#linearGradient4914);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+           d="M 257.78987,1.5882927 C 267.38505,10.987587 266.20821,24.155682 266.20821,24.155682 C 266.20821,24.155682 267.57261,21.334763 267.74288,21.334758 C 281.53576,34.296881 273.18127,52.408537 273.18128,52.408542 C 273.18128,52.408542 277.96196,48.41812 280.00535,38.114892 C 279.32422,24.654226 271.48484,19.4673 269.44145,18.179395 C 269.44145,18.179395 270.46314,16.357639 270.63343,13.366376 C 269.43017,7.1595205 267.60358,3.4581243 266.49131,1.5882927 L 257.78987,1.5882927 z "
+           id="path4543" />
+        <path
+           sodipodi:nodetypes="ccccccccc"
+           id="path4545"
+           d="M 153.27873,24.934713 C 153.27873,24.934713 140.44556,34.402142 145.39585,50.498089 C 147.26897,55.31734 151.52603,59.471866 151.52603,59.471866 C 151.52603,59.471866 143.35247,47.340646 155.95337,32.051988 C 155.95337,32.051988 158.67789,38.865409 164.12693,48.836277 C 166.68117,44.183203 172.98162,38.865414 185.58253,31.553445 C 198.18343,24.241475 184.56083,18.258958 184.56083,18.258958 C 184.56083,18.258958 159.01846,24.687886 159.5293,40.028681 C 158.50761,38.865414 154.07171,26.714033 153.27873,24.934713 z "
+           style="fill:url(#linearGradient4916);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+        <path
+           style="fill:url(#linearGradient4918);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+           d="M 164.57723,1.5882927 C 158.84878,4.5412985 150.6096,10.478388 151.22708,20.229654 C 151.14194,20.229659 148.91762,14.427858 148.91762,14.427858 C 148.91762,14.427858 137.51508,22.973719 138.62192,36.849839 C 139.47333,41.419819 142.00415,45.574345 142.00415,45.574345 C 142.00415,45.574345 137.00423,29.785064 150.54169,19.066387 C 151.91856,23.362762 154.14866,27.917015 155.7268,31.382482 C 155.64166,30.883942 151.04828,16.316092 183.82766,6.0959543 C 183.96763,4.234824 183.90823,2.8077135 183.76807,1.5882927 L 164.57723,1.5882927 z "
+           id="path4547" />
+        <path
+           sodipodi:nodetypes="ccccccccc"
+           id="path4549"
+           d="M 151.52603,59.638046 C 151.52603,59.638046 155.00221,63.86141 156.19419,64.692318 C 156.96046,65.523221 150.06402,54.085235 160.11069,40.624567 C 161.91681,46.147436 169.98707,60.322932 169.98707,60.322932 C 169.98707,60.322932 176.55756,50.498089 186.77451,46.509742 C 191.37213,33.54762 187.28535,34.877067 185.41224,31.553445 C 183.36885,31.885804 164.12693,45.014111 163.95665,48.503913 C 163.61608,48.420823 157.18062,34.137601 156.07378,32.060336 C 155.05208,31.063253 143.69303,46.675922 151.52603,59.638046 z "
+           style="fill:url(#linearGradient4920);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+        <path
+           sodipodi:nodetypes="ccccccccc"
+           id="path4551"
+           d="M 184.25763,6.2665591 C 183.30647,5.2576619 150.9578,16.177952 155.56502,30.778266 C 151.47825,22.30303 150.71197,19.145591 150.71197,19.145591 C 150.47116,18.205527 137.51508,28.202457 141.94243,45.48529 C 143.04926,47.811825 144.6755,50.165138 145.59923,50.960911 C 144.74781,47.969652 142.45327,34.018795 153.09593,25.128109 C 156.07587,32.606258 157.72277,35.774491 159.6372,39.737785 C 160.48861,38.906882 157.43814,27.537734 185.0239,18.065414 C 188.25927,9.8394515 184.25763,6.2665591 184.25763,6.2665591 z "
+           style="fill:url(#linearGradient4922);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+        <path
+           style="fill:url(#linearGradient4924);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+           d="M 241.40018,1.5882927 C 263.39065,16.032799 261.37514,29.427117 261.6191,32.284014 C 263.40706,30.123659 264.89064,27.475154 265.65692,26.394972 C 276.12929,39.440189 270.04808,56.04583 269.36695,56.959828 C 270.04808,56.959828 272.50441,53.646586 273.27068,52.234051 C 282.55107,30.713603 269.19028,20.896463 267.74288,21.145728 C 266.97661,22.059725 266.46151,23.563663 266.46151,23.646753 C 266.51992,10.990844 261.44708,4.4820603 258.22196,1.5882927 L 241.40018,1.5882927 z "
+           id="path4553" />
+        <path
+           style="fill:url(#linearGradient4926);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+           d="M 224.71249,1.5882927 C 222.34772,2.9998434 222.30409,5.0218024 229.22711,7.9717232 C 246.68625,17.137326 254.14503,30.950826 256.55319,39.176374 C 257.03482,38.588835 261.42603,32.608072 261.87239,32.109524 C 271.24429,49.356086 263.52626,62.589205 262.33428,63.503207 C 262.33428,63.503207 267.99535,60.040574 269.56065,57.337889 C 276.96574,38.125366 265.59733,26.191405 265.59732,26.1914 C 265.59732,26.1914 265.34932,27.249262 261.85749,31.949574 C 262.54736,16.549025 249.498,6.2501757 241.98127,1.5882927 L 224.71249,1.5882927 z "
+           id="path4555" />
+        <path
+           sodipodi:nodetypes="ccccccccc"
+           id="path4557"
+           d="M 229.8082,7.9283659 C 229.8082,7.9283659 253.00764,20.094222 256.49947,38.660451 C 261.5566,31.844997 260.59334,32.716861 261.67701,32.129318 C 262.76068,31.541779 271.79128,50.343025 262.51987,63.503896 C 255.29539,69.849315 254.57294,69.614298 252.76682,70.554362 C 253.24845,69.379281 264.32598,61.956136 256.13825,39.042119 C 254.09131,42.919871 249.90625,47.129992 249.90625,47.129992 C 249.90625,47.129992 246.74643,31.306767 224.9526,19.673496 C 210.14242,13.915615 229.79813,7.1606466 229.96841,7.4930107"
+           style="fill:url(#linearGradient4928);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+        <path
+           sodipodi:nodetypes="ccccccccc"
+           id="path4559"
+           d="M 225.073,19.604663 L 219.54392,33.539412 C 219.88449,33.871776 234.70564,40.589879 240.96685,56.570938 C 241.60874,56.598614 248.91377,48.697914 249.63622,47.287819 C 250.35867,45.87773 255.35559,66.73536 246.98725,74.432115 C 250.84825,72.119418 252.80814,71.640445 253.9709,69.966819 C 254.45254,68.791742 263.90456,60.037415 256.19845,39.12103 C 254.07389,42.133 251.22218,45.137552 249.99745,46.465268 C 248.56966,41.118961 242.5165,29.216678 225.073,19.604663 z "
+           style="fill:url(#linearGradient4930);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+        <path
+           style="fill:#1f4a2a;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+           d="M 183.54457,1.5882927 L 183.82766,6.9247824 C 183.82767,6.9247778 203.772,-4.7868273 230.16579,8.175295 C 231.62859,6.1193267 233.0947,3.6616496 234.32281,1.5882927 L 183.54457,1.5882927 z "
+           id="path4561" />
+        <g
+           id="g4563"
+           transform="matrix(0.476791,0,0,0.465307,55.77949,-173.6434)">
+          <path
+             style="fill:url(#linearGradient4932);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+             d="M 210.6168,512.94073 C 210.6168,512.94073 209.80617,527.05721 224.94835,542.36141 C 217.13872,527.26352 214.65742,520.7694 217.1828,519.25417 C 215.66757,517.99148 214.65741,511.17296 210.6168,512.94073 z "
+             id="path4565"
+             sodipodi:nodetypes="cccc" />
+          <path
+             style="fill:url(#linearGradient4934);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+             d="M 215.63896,514.69258 C 214.26567,516.28385 213.08169,521.82544 221.73271,538.91133 C 226.65449,544.60372 227.44153,545.08454 234.78918,551.64182 C 232.26379,546.08597 225.18702,531.44512 225.18702,531.44512 C 225.18702,531.44511 222.30922,521.66678 215.63896,514.69258 z "
+             id="path4567"
+             sodipodi:nodetypes="ccccc" />
+          <path
+             style="fill:url(#linearGradient4936);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+             d="M 220.25,520.1875 C 218.87671,521.77877 217.69273,527.32036 226.34375,544.40625 C 231.26553,550.09864 232.05257,550.57946 239.40022,557.13674 C 236.87483,551.58089 229.79806,536.94004 229.79806,536.94004 C 229.79806,536.94003 226.92026,527.1617 220.25,520.1875 z "
+             id="path4569"
+             sodipodi:nodetypes="ccccc" />
+          <path
+             style="fill:url(#linearGradient4938);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+             d="M 226.43242,527.87754 C 225.19989,531.53305 224.73957,539.88003 235.74492,554.56504 C 238.73456,557.16966 242.85692,559.62588 246.60653,562.26147 C 244.08114,556.70562 233.83867,536.94004 233.83867,536.94004 C 233.83867,536.94003 230.56317,532.74151 226.43242,527.87754 z "
+             id="path4571"
+             sodipodi:nodetypes="ccccc" />
+        </g>
+        <path
+           sodipodi:nodetypes="ccccccccccccccccccccc"
+           id="path4573"
+           d="M 176.85034,88.193825 C 176.85034,88.193825 174.12582,88.692369 173.27441,87.861466 C 172.423,87.030558 167.65509,81.214225 167.31452,76.893514 C 165.10084,74.068435 157.26785,66.590287 156.41644,64.928475 C 154.8839,62.768125 150.79711,52.365184 159.82209,40.067786 C 163.73859,47.712114 169.18763,58.846252 169.86875,59.677155 C 170.89046,59.012427 172.59328,53.528454 186.55644,45.884123 C 185.87531,36.910347 183.66164,7.9283659 184.17248,6.5989186 C 184.68333,5.2694714 204.94695,-5.366116 230.14876,8.26073 C 222.9969,25.377378 220.27238,31.858444 219.93181,33.686435 C 220.1021,34.018795 234.40583,38.339505 241.38741,55.954699 C 245.47419,51.633987 247.00673,49.473636 249.90153,46.316193 C 252.28549,52.631075 253.98832,67.753554 247.00673,74.566979 C 239.68458,80.050957 230.31905,84.205483 229.46763,85.368751 C 228.61622,86.532018 222.65633,93.843983 216.35588,95.17343 C 216.35588,95.00725 220.44266,91.683628 220.78323,90.35418 C 221.12379,89.024733 222.65633,77.724418 222.65633,77.724418 L 209.3743,65.09466 L 189.11068,64.097572 C 189.11068,64.097572 178.2126,70.744813 175.65836,73.736076 C 175.3178,76.561155 176.85034,88.193825 176.85034,88.193825 z "
+           style="fill:url(#linearGradient4940);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+        <path
+           sodipodi:nodetypes="ccccc"
+           id="path4575"
+           d="M 270.62287,13.502604 C 269.42734,27.183314 242.50914,55.097143 223.14083,76.429747 C 223.14083,76.429747 222.41838,77.134795 222.41838,77.134795 C 222.6592,77.134795 240.25709,62.968732 251.73862,59.871179 C 280.07812,68.073941 288.57012,22.015298 270.62287,13.502604 z "
+           style="fill:url(#linearGradient4942);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+        <path
+           id="path4577"
+           d="M 279.49738,40.589879 C 279.49738,40.589879 255.4158,61.741276 233.01993,71.611931 C 210.62406,81.482581 228.68524,83.597723 228.68524,83.597723 C 228.68524,83.597723 272.75454,64.561464 279.49738,40.589879 z "
+           style="opacity:0.39999994;fill:url(#linearGradient4944);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+        <path
+           sodipodi:nodetypes="cccc"
+           id="path4579"
+           d="M 272.27788,4.7043653 C 272.27788,1.048383 261.13777,30.50883 227.84381,49.685626 C 205.44794,59.556278 216.35727,70.977559 222.48744,74.633541 C 237.13174,59.01252 269.96238,31.002484 272.27788,4.7043653 z "
+           style="opacity:0.39999994;fill:url(#linearGradient4946);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+        <path
+           style="opacity:0.69999994;fill:url(#linearGradient4948);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+           d="M 260.28034,66.231116 C 260.28034,66.231116 238.12529,82.917216 227.52939,86.207434 C 247.10271,85.274289 257.39056,81.977156 260.28034,66.231116 z "
+           id="path4581"
+           sodipodi:nodetypes="ccc" />
+        <path
+           style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+           d="M 177.1116,88.199027 L 181.83007,92.365293 C 183.06586,92.474933 185.4251,92.146017 187.22261,91.378549 C 187.22261,91.378549 199.35581,100.58819 218.90377,93.461682 C 206.43353,102.23277 198.12003,97.956864 190.81764,98.505056 C 186.32385,94.777342 174.41533,88.199027 173.74126,88.199027 C 173.06719,88.199027 177.1116,88.199027 177.1116,88.199027 z "
+           id="path4583"
+           sodipodi:nodetypes="ccccccc" />
+        <path
+           style="fill:url(#linearGradient4950);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+           d="M 209.24214,66.052029 C 210.1409,77.381351 205.19774,100.11309 205.19774,100.04 L 190.36826,99.162889 L 180.48194,91.926741 L 194.41266,108.59181 L 219.80253,92.146017 C 219.80253,92.146017 220.02722,81.620712 222.04942,79.866491 C 224.07162,78.112274 221.82473,77.235166 221.82473,77.235166 C 221.82473,77.235166 212.38779,70.656846 209.24214,66.052029 z "
+           id="path4585"
+           sodipodi:nodetypes="ccccccccc" />
+        <path
+           style="fill:url(#linearGradient4952);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+           d="M 205.42243,100.25928 L 222.94818,77.673718 C 222.94818,77.673718 220.02722,82.059264 219.80253,91.926741 C 219.80253,91.926741 205.42243,100.25928 205.42243,100.25928 z "
+           id="path4587"
+           sodipodi:nodetypes="cccc" />
+        <path
+           sodipodi:nodetypes="cccc"
+           id="path4589"
+           d="M 272.27788,6.5655933 C 272.27788,2.9096111 261.13777,32.370058 227.84381,51.546854 C 205.44794,61.417506 216.35727,70.977559 222.48744,74.633541 C 237.13174,59.01252 269.96238,32.863712 272.27788,6.5655933 z "
+           style="opacity:0.39999994;fill:url(#linearGradient4954);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+        <path
+           id="path4591"
+           d="M 278.5438,42.451107 C 278.5438,42.451107 255.4158,63.602504 233.01993,73.473159 C 210.62406,83.343809 228.68524,83.597723 228.68524,83.597723 C 228.68524,83.597723 268.94113,65.492376 278.5438,42.451107 z "
+           style="opacity:0.59999988;fill:url(#linearGradient4956);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+           sodipodi:nodetypes="cccc" />
+        <path
+           style="opacity:0.69999994;fill:url(#linearGradient4958);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+           d="M 260.28034,66.231116 C 260.28034,66.231116 238.12529,82.917216 227.52939,86.207434 C 244.56065,83.723765 257.39056,81.977156 260.28034,66.231116 z "
+           id="path4593"
+           sodipodi:nodetypes="ccc" />
+      </g>
+      <rect
+         y="77"
+         x="236"
+         height="0"
+         width="1"
+         id="rect1327"
+         style="opacity:0.57786889;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.63199997;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1" />
+      <path
+         style="fill:#ffffff;fill-opacity:0.75688076;fill-rule:nonzero;stroke:none;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1"
+         d="M 77.062579,3.7839329 L 77.062579,0.98922447 L 77.062579,3.7839329 z "
+         id="path2276"
+         sodipodi:nodetypes="ccc" />
+      <g
+         id="g4640"
+         transform="matrix(-0.782995,0,0,0.650879,-2245.796,690.3016)"
+         style="opacity:0.40163933" />
+      <g
+         style="opacity:0.40163933"
+         transform="matrix(-0.782995,0,0,0.650879,-2245.796,690.3016)"
+         id="g4646" />
+      <g
+         style="opacity:0.40163933"
+         transform="matrix(1,0,0,0.650879,955.167,697.6294)"
+         id="g4730" />
+      <g
+         id="g4748"
+         transform="matrix(1,0,0,0.650879,955.167,697.6294)"
+         style="opacity:0.40163933" />
+      <path
+         style="fill:#ffffff;fill-opacity:0.75688076;fill-rule:nonzero;stroke:none;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1"
+         d="M 181.23105,2.6244365 L 181.23105,0.41896716 L 181.23105,2.6244365 z "
+         id="path2408"
+         sodipodi:nodetypes="ccc" />
+    </g>
+    <path
+       style="opacity:0.24344569;fill:url(#radialGradient31866);fill-opacity:1;stroke:none;stroke-width:10;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dashoffset:1.08779998;stroke-opacity:1"
+       d="M 73,63.5 L 116,63.5 L 116,85.5 L 93.5,108 L 73,108 L 73,63.5 z "
+       id="rect31858"
+       sodipodi:nodetypes="cccccc" />
+    <g
+       id="g4960"
+       transform="translate(10,-6)">
+      <path
+         transform="translate(40,0)"
+         clip-path="url(#clipPath7084)"
+         sodipodi:nodetypes="cccc"
+         style="opacity:0.4;fill:#000000;fill-opacity:1;filter:url(#filter6697)"
+         id="path5540"
+         d="M 41.879531,115.98249 C 41.879531,115.98249 66.18914,91.672876 66.18914,91.672876 C 66.18914,91.672876 56.836,94.586 46.586,94.586 C 46.586,104.836 41.879531,115.98249 41.879531,115.98249 z " />
+      <path
+         sodipodi:nodetypes="csccc"
+         d="M 79.172,120 C 79.172,120 91.086,110.086 96.586,104.586 C 102.086,99.086 112,87.172 112,87.172 C 112,87.172 98.25,96 88,96 C 88,106.25 79.172,120 79.172,120 z "
+         id="path14523"
+         style="fill:url(#linearGradient10213);fill-opacity:1" />
+    </g>
+  </g>
+  <g
+     inkscape:groupmode="layer"
+     id="layer2"
+     style="display:inline" />
+  <g
+     inkscape:groupmode="layer"
+     id="layer3" />
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/resources/iconnotifier.svg	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,260 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://web.resource.org/cc/"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="128"
+   height="128"
+   id="svg2606"
+   sodipodi:version="0.32"
+   inkscape:version="0.45+devel"
+   version="1.0"
+   sodipodi:docname="unknown.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   sodipodi:docbase="/home/david/Progetti/sandbox/svg/mimetypes">
+  <defs
+     id="defs2608">
+    <linearGradient
+       y2="0"
+       x2="28"
+       y1="57.5"
+       x1="28"
+       gradientUnits="userSpaceOnUse"
+       id="linearGradient2973">
+			<stop
+   id="stop2975"
+   style="stop-color:#2c72c7;stop-opacity:1;"
+   offset="0" />
+
+			<stop
+   id="stop2977"
+   style="stop-color:#0057ae;stop-opacity:1;"
+   offset="1" />
+
+		</linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient2973"
+       id="linearGradient2086"
+       x1="86.43512"
+       y1="76.830994"
+       x2="22.813417"
+       y2="8.9537134"
+       gradientUnits="userSpaceOnUse" />
+    <linearGradient
+       id="linearGradient10207">
+      <stop
+         style="stop-color:#a2a2a2;stop-opacity:1;"
+         offset="0"
+         id="stop10209" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="1"
+         id="stop10211" />
+    </linearGradient>
+    <linearGradient
+       id="XMLID_12_"
+       gradientUnits="userSpaceOnUse"
+       x1="96"
+       y1="104"
+       x2="88.000198"
+       y2="96.000198">
+      <stop
+         offset="0"
+         style="stop-color:#888A85"
+         id="stop83" />
+      <stop
+         offset="0.0072"
+         style="stop-color:#8C8E89"
+         id="stop85" />
+      <stop
+         offset="0.0673"
+         style="stop-color:#ABACA9"
+         id="stop87" />
+      <stop
+         offset="0.1347"
+         style="stop-color:#C5C6C4"
+         id="stop89" />
+      <stop
+         offset="0.2652576"
+         style="stop-color:#DBDBDA"
+         id="stop91" />
+      <stop
+         offset="0.37646064"
+         style="stop-color:#EBEBEB"
+         id="stop93" />
+      <stop
+         offset="0.48740286"
+         style="stop-color:#F7F7F6"
+         id="stop95" />
+      <stop
+         offset="0.6324091"
+         style="stop-color:#FDFDFD"
+         id="stop97" />
+      <stop
+         offset="1"
+         style="stop-color:#FFFFFF"
+         id="stop99" />
+    </linearGradient>
+    <radialGradient
+       id="XMLID_8_"
+       cx="102"
+       cy="112.3047"
+       r="139.55859"
+       gradientUnits="userSpaceOnUse">
+      <stop
+         offset="0"
+         style="stop-color:#b7b8b9;stop-opacity:1;"
+         id="stop41" />
+      <stop
+         offset="0.18851049"
+         style="stop-color:#ECECEC"
+         id="stop47" />
+      <stop
+         offset="0.25718147"
+         style="stop-color:#FAFAFA"
+         id="stop49" />
+      <stop
+         offset="0.30111277"
+         style="stop-color:#FFFFFF"
+         id="stop51" />
+      <stop
+         offset="0.5313"
+         style="stop-color:#FAFAFA"
+         id="stop53" />
+      <stop
+         offset="0.8449"
+         style="stop-color:#EBECEC"
+         id="stop55" />
+      <stop
+         offset="1"
+         style="stop-color:#E1E2E3"
+         id="stop57" />
+    </radialGradient>
+    <filter
+       inkscape:collect="always"
+       x="-0.19200002"
+       width="1.3839999"
+       y="-0.19199999"
+       height="1.3839999"
+       id="filter6697">
+      <feGaussianBlur
+         inkscape:collect="always"
+         stdDeviation="1.9447689"
+         id="feGaussianBlur6699" />
+    </filter>
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath7084">
+      <path
+         style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+         d="M 72,88 L 40,120 L 32,120 L 32,80 L 72,80 L 72,88 z"
+         id="path7086" />
+    </clipPath>
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#XMLID_8_"
+       id="radialGradient9437"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1,0,0,0.9996653,2e-6,3.0160848e-3)"
+       cx="102"
+       cy="112.3047"
+       r="139.55859" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10207"
+       id="linearGradient10213"
+       x1="98.617439"
+       y1="106.41443"
+       x2="91.228737"
+       y2="99.254974"
+       gradientUnits="userSpaceOnUse" />
+    <filter
+       inkscape:collect="always"
+       id="filter2770">
+      <feGaussianBlur
+         inkscape:collect="always"
+         stdDeviation="2.0786429"
+         id="feGaussianBlur2772" />
+    </filter>
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="2.8284271"
+     inkscape:cx="64"
+     inkscape:cy="85.975621"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     width="128px"
+     height="128px"
+     gridspacingx="4px"
+     gridspacingy="4px"
+     gridempspacing="2"
+     showgrid="true"
+     inkscape:grid-points="true"
+     showguides="true"
+     inkscape:guide-bbox="true"
+     inkscape:window-width="1016"
+     inkscape:window-height="692"
+     inkscape:window-x="0"
+     inkscape:window-y="0" />
+  <metadata
+     id="metadata2611">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Livello 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <path
+       style="opacity:0.5;fill:#000000;fill-opacity:1;filter:url(#filter2770)"
+       d="M 16,8 L 16,120 C 16,120 79.15625,120 79.15625,120 L 79.1875,120 C 79.187503,120 91.09375,110.09375 96.59375,104.59375 C 102.09375,99.09375 112,87.1875 112,87.1875 L 112,87.15625 L 112,8 L 16,8 z"
+       id="path7865"
+       sodipodi:nodetypes="csccscccc"
+       transform="matrix(1.0416667,0,0,1.0267857,-2.6666667,-1.2142891)" />
+    <path
+       style="fill:#ffffff;fill-opacity:1"
+       d="M 16.000001,8 L 16,120 C 16,120 79.146418,120 79.146418,120 L 112,87.14642 L 112,8 L 16.000001,8 z"
+       id="path34"
+       sodipodi:nodetypes="cccccc" />
+    <path
+       style="fill:url(#radialGradient9437);fill-opacity:1"
+       d="M 18.000002,9.0000034 C 17.449002,9.0000034 17.000002,9.4488534 17.000002,9.9996684 L 17.000002,117.96352 C 17.000002,118.51533 17.449002,118.96318 18.000002,118.96318 L 77.171999,118.96318 C 77.434999,118.96318 79.934679,119.08131 80.12068,118.89438 L 110.707,88.094202 C 110.894,87.907264 111,85.40942 111,85.146508 L 111,9.9996684 C 111,9.4488534 110.552,9.0000034 110,9.0000034 L 18.000002,9.0000034 z"
+       id="path59"
+       sodipodi:nodetypes="ccccccccccc" />
+    <path
+       d="M 41.879531,115.98249 C 41.879531,115.98249 66.18914,91.672876 66.18914,91.672876 C 66.18914,91.672876 56.836,94.586 46.586,94.586 C 46.586,104.836 41.879531,115.98249 41.879531,115.98249 z"
+       id="path5540"
+       style="opacity:0.4;fill:#000000;fill-opacity:1;filter:url(#filter6697)"
+       sodipodi:nodetypes="cccc"
+       clip-path="url(#clipPath7084)"
+       transform="translate(40,0)" />
+    <path
+       style="fill:url(#linearGradient10213);fill-opacity:1"
+       id="path14523"
+       d="M 79.172,120 C 79.172,120 91.086,110.086 96.586,104.586 C 102.086,99.086 112,87.172 112,87.172 C 112,87.172 98.25,96 88,96 C 88,106.25 79.172,120 79.172,120 z"
+       sodipodi:nodetypes="csccc" />
+    <path
+       id="text2076"
+       d="M 62.842105,28 C 69.438566,28.00007 74.631544,30.070244 78.421053,34.210526 C 80.947326,37.017606 82.210485,40.386024 82.210528,44.315789 C 82.210485,49.157946 79.894696,54.596537 75.263159,60.631581 C 74.421018,61.684251 73.052597,63.368459 71.157895,65.684214 C 67.789444,69.89477 65.57892,74.807045 64.526316,80.421056 C 64.456114,80.912302 64.38594,81.40353 64.315789,81.89474 L 62.526315,81.89474 C 62.666642,76.491254 63.719273,71.508803 65.68421,66.947371 L 68.631579,60.210528 C 71.228037,54.245661 72.526282,48.771981 72.526316,43.789473 C 72.526282,39.228131 70.806986,35.684274 67.36842,33.157894 C 65.543832,31.824628 63.473658,31.157962 61.157895,31.157894 C 57.508752,31.157962 54.631562,32.280768 52.526315,34.526317 C 51.614021,35.579011 51.15788,36.631642 51.157894,37.684211 C 51.15788,38.315851 51.894722,39.543919 53.36842,41.368421 C 54.561386,42.982513 55.157877,44.350934 55.157894,45.473685 C 55.157877,47.649175 54.175422,49.017596 52.210526,49.578948 C 51.789459,49.719349 51.33332,49.789525 50.842103,49.789475 C 47.473673,49.789525 45.789465,47.614088 45.789472,43.26316 C 45.789465,37.929885 48.070165,33.789539 52.631576,30.842104 C 55.578928,28.947438 58.982435,28.00007 62.842105,28 M 63.578947,88.736839 C 65.894709,88.736854 67.578918,89.82458 68.631579,92.00001 C 69.052602,92.77194 69.263127,93.61404 69.263159,94.52631 C 69.263127,97.05264 68.070146,98.73684 65.68421,99.57894 C 64.98243,99.85965 64.245588,100 63.473684,100 C 60.87717,100 59.157873,98.8772 58.315788,96.63158 C 58.105243,96.00001 57.99998,95.33335 57.999998,94.63158 C 57.99998,91.96492 59.122785,90.14037 61.36842,89.157906 C 62.070151,88.877214 62.806993,88.736854 63.578947,88.736839"
+       style="font-size:74.98017883px;font-style:normal;font-weight:normal;fill:url(#linearGradient2086);fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" />
+  </g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/resources/qtg_large_device_lock.svg	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,140 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="60" viewBox="0 0 60 60" width="60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<g>
+<rect fill="none" height="60" width="60"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_1" x1="30" x2="30" y1="4.26" y2="55.61">
+<stop offset="0" stop-color="#D1D7D9"/>
+<stop offset="0.07" stop-color="#D1D7D9"/>
+<stop offset="0.26" stop-color="#BDC2C4"/>
+<stop offset="0.66" stop-color="#949DA1"/>
+<stop offset="0.96" stop-color="#ADB3B5"/>
+<stop offset="1" stop-color="#595C5E"/>
+</linearGradient>
+<path d="M46.574,52.922c0,1.557-1.264,2.818-2.822,2.818H16.248c-1.558,0-2.82-1.262-2.82-2.818V7.082 c0-1.556,1.262-2.82,2.82-2.82h27.504c1.559,0,2.822,1.264,2.822,2.82V52.922z" fill="url(#SVGID_1)"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_2" x1="30" x2="30" y1="4.26" y2="54.73">
+<stop offset="0" stop-color="#E4EBED"/>
+<stop offset="0.07" stop-color="#E4EBED"/>
+<stop offset="0.26" stop-color="#D6DCDE"/>
+<stop offset="0.66" stop-color="#B2BEC2"/>
+<stop offset="1" stop-color="#ADB3B5"/>
+</linearGradient>
+<path d="M43.752,4.262H16.248c-1.558,0-2.82,1.264-2.82,2.82v45.84c0,0.752,0.3,1.432,0.78,1.938 c-0.044-0.172-0.072-0.344-0.072-0.529v-1.408V8.492v-1.41c0-1.168,0.95-2.118,2.114-2.118h27.504c1.166,0,2.114,0.95,2.114,2.118 v1.41v44.43v1.408c0,0.186-0.028,0.357-0.072,0.529c0.481-0.506,0.782-1.186,0.782-1.938V7.082 C46.574,5.526,45.311,4.262,43.752,4.262z" fill="url(#SVGID_2)"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_3" x1="30" x2="30" y1="7.84" y2="42.35">
+<stop offset="0" stop-color="#B6BBBD"/>
+<stop offset="1" stop-color="#F0FBFF"/>
+</linearGradient>
+<rect fill="url(#SVGID_3)" fill-opacity="0.6" height="34.554" stroke-opacity="0.6" width="28.918" x="15.542" y="7.788"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_4" x1="30" x2="30" y1="8.54" y2="41.64">
+<stop offset="0" stop-color="#6E6E6E"/>
+<stop offset="1" stop-color="#333333"/>
+</linearGradient>
+<rect fill="url(#SVGID_4)" height="33.146" width="27.504" x="16.248" y="8.492"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_5" x1="30" x2="30" y1="9.25" y2="40.94">
+<stop offset="0" stop-color="#3BC8EB"/>
+<stop offset="0.39" stop-color="#2D9BD2"/>
+<stop offset="0.89" stop-color="#1347BA"/>
+<stop offset="1" stop-color="#1347BA"/>
+</linearGradient>
+<rect fill="url(#SVGID_5)" height="31.735" width="26.094" x="16.954" y="9.198"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_6" x1="30" x2="30" y1="9.75" y2="22.36">
+<stop offset="0" stop-color="#85EFFF"/>
+<stop offset="1" stop-color="#3BA1D9"/>
+</linearGradient>
+<polygon fill="url(#SVGID_6)" points="43.046,20.48 16.954,23.3 16.954,9.904 43.046,9.904 "/>
+<rect fill="#9FE4FF" height="0.708" width="26.094" x="16.954" y="9.198"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_7" x1="30.2" x2="30.2" y1="7.82" y2="4.99">
+<stop offset="0" stop-color="#FFFFFF"/>
+<stop offset="1" stop-color="#D1D7D9"/>
+</linearGradient>
+<path d="M27.088,7.788c-0.792,0-1.412-0.516-1.412-1.176V6.14c0-0.658,0.622-1.176,1.412-1.176h6.238 c0.79,0,1.408,0.518,1.408,1.176v0.47c0,0.66-0.621,1.176-1.408,1.176h-6.238V7.788z" fill="url(#SVGID_7)"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_8" x1="30.21" x2="30.21" y1="5.38" y2="7.2">
+<stop offset="0" stop-color="#6C7375"/>
+<stop offset="1" stop-color="#BDC2C4"/>
+</linearGradient>
+<path d="M34.034,6.612c0,0.26-0.318,0.47-0.708,0.47h-6.238c-0.39,0-0.708-0.21-0.708-0.47V6.14 c0-0.262,0.316-0.468,0.708-0.468h6.238c0.388,0,0.708,0.208,0.708,0.468V6.612z" fill="url(#SVGID_8)"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_9" x1="29.89" x2="29.89" y1="43.08" y2="53.56">
+<stop offset="0" stop-color="#B6BBBD"/>
+<stop offset="1" stop-color="#FFFFFF"/>
+</linearGradient>
+<path d="M27.344,53.626c-1.512,0-2.744-1.216-2.744-2.712 V45.76c0-1.494,1.232-2.71,2.744-2.71h5.094c1.515,0,2.744,1.216,2.744,2.71v5.154c0,1.496-1.229,2.712-2.744,2.712H27.344z" fill="url(#SVGID_9)" fill-opacity="0.6" stroke-opacity="0.6"/>
+<path d="M27.34,52.922c-1.122,0-2.032-0.902-2.032-2.008V45.76 c0-1.107,0.91-2.008,2.032-2.008h5.104c1.123,0,2.031,0.9,2.031,2.008v5.154c0,1.105-0.908,2.008-2.031,2.008H27.34z" fill="#020202" fill-opacity="0.5" stroke-opacity="0.5"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_10" x1="29.89" x2="29.89" y1="44.43" y2="52.23">
+<stop offset="0" stop-color="#A6A8AB"/>
+<stop offset="0.7" stop-color="#58595B"/>
+<stop offset="1" stop-color="#808184"/>
+</linearGradient>
+<path d="M33.771,50.914c0,0.718-0.594,1.3-1.319,1.3h-5.12c-0.728,0-1.32-0.582-1.32-1.3V45.76 c0-0.716,0.592-1.298,1.32-1.298h5.12c0.726,0,1.319,0.582,1.319,1.298V50.914z" fill="url(#SVGID_10)"/>
+<path d="M28.836,50.805c-0.782,0-1.414-0.633-1.414-1.41v-2.119 c0-0.775,0.632-1.407,1.414-1.407h2.112c0.78,0,1.411,0.632,1.411,1.407v2.119c0,0.777-0.631,1.41-1.411,1.41H28.836z" fill="#020202" fill-opacity="0.2" stroke-opacity="0.2"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_11" x1="29.89" x2="29.89" y1="46.56" y2="50.1">
+<stop offset="0" stop-color="#D1D7D9"/>
+<stop offset="0.07" stop-color="#D1D7D9"/>
+<stop offset="0.26" stop-color="#BDC2C4"/>
+<stop offset="0.66" stop-color="#949DA1"/>
+<stop offset="0.96" stop-color="#ADB3B5"/>
+<stop offset="1" stop-color="#595C5E"/>
+</linearGradient>
+<path d="M28.836,50.098c-0.392,0-0.708-0.313-0.708-0.703v-2.119c0-0.385,0.314-0.703,0.708-0.703 h2.112c0.39,0,0.708,0.316,0.708,0.703v2.119c0,0.388-0.316,0.703-0.708,0.703H28.836z" fill="url(#SVGID_11)"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_12" x1="18.66" x2="18.66" y1="43.71" y2="52.23">
+<stop offset="0" stop-color="#B6BBBD"/>
+<stop offset="1" stop-color="#F0FBFF"/>
+</linearGradient>
+<path d="M18.256,52.214c-1.496,0-2.714-1.216-2.714-2.712 v-3.036c0-1.498,1.218-2.714,2.714-2.714h0.81c1.498,0,2.714,1.216,2.714,2.714v3.036c0,1.496-1.216,2.712-2.714,2.712H18.256z" fill="url(#SVGID_12)" fill-opacity="0.4" stroke-opacity="0.4"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_13" x1="18.66" x2="18.66" y1="44.43" y2="51.52">
+<stop offset="0" stop-color="#231F20"/>
+<stop offset="1" stop-color="#6D6E70"/>
+</linearGradient>
+<path d="M18.256,51.51c-1.106,0-2.008-0.9-2.008-2.008v-3.036 c0-1.11,0.902-2.006,2.008-2.006h0.81c1.11,0,2.01,0.896,2.01,2.006v3.036c0,1.107-0.9,2.008-2.01,2.008H18.256z" fill="url(#SVGID_13)" fill-opacity="0.7" stroke-opacity="0.7"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_14" x1="18.66" x2="18.66" y1="45.14" y2="50.82">
+<stop offset="0" stop-color="#C6FF45"/>
+<stop offset="0.73" stop-color="#66A00E"/>
+<stop offset="1" stop-color="#387300"/>
+</linearGradient>
+<path d="M20.37,49.502c0,0.721-0.582,1.303-1.302,1.303h-0.812c-0.718,0-1.302-0.582-1.302-1.303 v-3.036c0-0.72,0.584-1.302,1.302-1.302h0.81c0.72,0,1.302,0.582,1.302,1.302v3.036H20.37z" fill="url(#SVGID_14)"/>
+<path d="M40.322,52.214c-1.494,0-2.711-1.216-2.711-2.712 v-3.036c0-1.498,1.217-2.714,2.711-2.714h0.812c1.5,0,2.714,1.216,2.714,2.714v3.036c0,1.496-1.214,2.712-2.714,2.712H40.322z" fill="url(#SVGID_12)" fill-opacity="0.4" stroke-opacity="0.4"/>
+<path d="M40.322,51.51c-1.108,0-2.008-0.9-2.008-2.008v-3.036 c0-1.11,0.899-2.006,2.008-2.006h0.812c1.11,0,2.009,0.896,2.009,2.006v3.036c0,1.107-0.898,2.008-2.009,2.008H40.322z" fill="url(#SVGID_13)" fill-opacity="0.7" stroke-opacity="0.7"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_17" x1="40.73" x2="40.73" y1="45.14" y2="50.82">
+<stop offset="0" stop-color="#FFC142"/>
+<stop offset="0.75" stop-color="#CF4E18"/>
+<stop offset="1" stop-color="#B52100"/>
+</linearGradient>
+<path d="M42.438,49.502c0,0.721-0.582,1.303-1.301,1.303h-0.813c-0.717,0-1.301-0.582-1.301-1.303 v-3.036c0-0.72,0.584-1.302,1.301-1.302h0.813c0.719,0,1.301,0.582,1.301,1.302V49.502z" fill="url(#SVGID_17)"/>
+<rect fill="none" height="60" width="60"/>
+</g>
+<g transform="matrix(1 0 0 1 30 30)">
+<linearGradient gradientTransform="matrix(1 0 0 -1 8.3999 5.04)" gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="-1.0313" x2="14.444" y1="-3.8467" y2="-3.8467">
+<stop offset="0" style="stop-color:#8C8C8C"/>
+<stop offset="0.5333" style="stop-color:#B3B3B3"/>
+<stop offset="1" style="stop-color:#808080"/>
+</linearGradient>
+<path d="M15.106,3.081c-4.303,0-7.794,3.46-7.854,7.749v2.881h2.657V10.83  c0.061-2.818,2.366-5.092,5.198-5.092c2.831,0,5.136,2.273,5.198,5.092v3.863h2.655V10.83C22.898,6.541,19.408,3.081,15.106,3.081z" fill="url(#SVGID_1_)"/>
+<linearGradient gradientTransform="matrix(1 0 0 -1 8.3999 5.04)" gradientUnits="userSpaceOnUse" id="SVGID_2_" x1="-0.5474" x2="13.9592" y1="-4.0928" y2="-4.0928">
+<stop offset="0" style="stop-color:#CCCCCC"/>
+<stop offset="0.5152" style="stop-color:#FFFFFF"/>
+<stop offset="1" style="stop-color:#CCCCCC"/>
+</linearGradient>
+<path d="M20.793,14.203V10.83c-0.066-3.084-2.617-5.582-5.687-5.582c-3.072,0-5.623,2.498-5.689,5.572v3.873  H7.743V10.83c0.057-4,3.359-7.258,7.363-7.258c4.003,0,7.304,3.258,7.361,7.265v3.366H20.793z" fill="url(#SVGID_2_)"/>
+<linearGradient gradientTransform="matrix(1 0 0 -1 8.3999 5.04)" gradientUnits="userSpaceOnUse" id="SVGID_3_" x1="-0.2461" x2="13.6586" y1="-4.0938" y2="-4.0938">
+<stop offset="0" style="stop-color:#B4B4B4"/>
+<stop offset="0.5" style="stop-color:#E6E6E6"/>
+<stop offset="1" style="stop-color:#BEBEBE"/>
+</linearGradient>
+<path d="M8.049,14.388V10.83c0.054-3.832,3.22-6.951,7.057-6.951c3.835,0,7.001,3.123,7.056,6.962v3.056H21.1  V10.83c-0.07-3.25-2.76-5.889-5.994-5.889c-3.236,0-5.925,2.634-5.995,5.872v3.574L8.049,14.388L8.049,14.388z" fill="url(#SVGID_3_)"/>
+<g>
+<rect fill="none" height="30" width="30"/>
+</g>
+<linearGradient gradientTransform="matrix(1 0 0 -1 8.3999 5.04)" gradientUnits="userSpaceOnUse" id="SVGID_4_" x1="-3.1958" x2="16.3945" y1="-15.3169" y2="-15.3169">
+<stop offset="0" style="stop-color:#ED8C0D"/>
+<stop offset="0.24" style="stop-color:#FFE692"/>
+<stop offset="0.75" style="stop-color:#ED8C0D"/>
+<stop offset="0.8667" style="stop-color:#FFB81F"/>
+<stop offset="1" style="stop-color:#ED8C0D"/>
+</linearGradient>
+<path d="M24.795,26.633c0,0.338-0.273,0.612-0.611,0.612H5.816c-0.338,0-0.612-0.274-0.612-0.612V14.082  c0-0.338,0.274-0.613,0.612-0.613h18.368c0.338,0,0.61,0.275,0.61,0.613L24.795,26.633L24.795,26.633z" fill="url(#SVGID_4_)"/>
+<path d="M24.184,13.469H5.816c-0.338,0-0.612,0.275-0.612,0.613v0.611  c0-0.338,0.274-0.611,0.612-0.611h18.368c0.338,0,0.61,0.273,0.61,0.611v-0.611C24.795,13.744,24.521,13.469,24.184,13.469z" fill="#FFFFFF" fill-opacity="0.4" stroke-opacity="0.4"/>
+<rect fill="#EE8F11" fill-opacity="0.5" height="2.144" stroke-opacity="0.5" width="19.591" x="5.204" y="16.225"/>
+<rect fill-opacity="0.25" height="0.308" stroke-opacity="0.25" width="19.591" x="5.204" y="16.225"/>
+<path d="M24.184,27.245H5.816c-0.338,0-0.612-0.274-0.612-0.612v-0.611  c0,0.338,0.274,0.611,0.612,0.611h18.368c0.338,0,0.61-0.273,0.61-0.611v0.611C24.795,26.971,24.521,27.245,24.184,27.245z" fill-opacity="0.25" stroke-opacity="0.25"/>
+<rect fill="#FEE38E" fill-opacity="0.25" height="0.307" stroke-opacity="0.25" width="19.591" x="5.204" y="18.367"/>
+</g>
+</svg>
--- a/securitydialogs/Autolock/rom/Autolock.iby	Thu Aug 19 10:45:23 2010 +0300
+++ b/securitydialogs/Autolock/rom/Autolock.iby	Tue Aug 31 16:04:40 2010 +0300
@@ -14,12 +14,26 @@
 * Description:
 *
 */
-
 #ifndef __AUTOLOCK_IBY__
 #define __AUTOLOCK_IBY__
 
+#include <data_caging_paths_for_iby.hrh>
+
 S60_APP_EXE(Autolock)
 S60_APP_BITMAP(Autolock)
-S60_APP_AIF_RSC(Autolock)
+//S60_APP_AIF_RSC(Autolock)
+S60_APP_RESOURCE(Autolock)
+
+file=ABI_DIR\BUILD_DIR\autolockuseractivityservice.dll             SHARED_LIB_DIR\autolockuseractivityservice.dll
+data=\epoc32\data\z\resource\qt\crml\autolock.qcrml \resource\qt\crml\autolock.qcrml
 
-#endif
+// this is already done in IndicatorAutolockPlugin.iby
+// file=ABI_DIR\BUILD_DIR\IndicatorAutolockPlugin.dll             SHARED_LIB_DIR\IndicatorAutolockPlugin.dll
+
+// Autolock_reg.rsc needs to be also in  import\apps  because this is where QtHighway searches for it.
+data=ZSYSTEM\..\PRIVATE\10003a3f\import\apps\Autolock_reg.rsc               private\10003a3f\import\apps\Autolock_reg.rsc  
+      
+// this is already done in IndicatorAutolockPlugin.iby
+// data=\epoc32\data\z\resource\plugins\indicators\indicatorautolockplugin.qtplugin \resource\plugins\indicators\indicatorautolockplugin.qtplugin
+
+#endif // __AUTOLOCK_IBY__
--- a/securitydialogs/Autolock/rom/AutolockResources.iby	Thu Aug 19 10:45:23 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:
-*
-*/
-
-
-#ifndef __AUTOLOCK_RESOURCES_IBY__
-#define __AUTOLOCK_RESOURCES_IBY__
-
-//Resource file(s) for AUTOLOCK application
-
-S60_APP_RESOURCE(Autolock)
-
-#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/rom/AutolockSrv.iby	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,22 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef __AUTOLOCKSRV_IBY__
+#define __AUTOLOCKSRV_IBY__
+
+// this exists just to delete the old AutolockSrv.iby file, which contains some duplicated files
+
+#endif // __AUTOLOCKSRV_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/service_conf.xml	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<service>
+  <name>com.nokia.services.Autolock</name>
+  <filepath>No path really</filepath>
+  <description>Autolock</description>
+  <interface>
+     <name>Autolock</name>
+     <version>2.0</version>
+     <description>Interface to Autolock</description>
+   </interface>
+</service>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/service_conf_new.xml	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<service>
+  <name>com.nokia.services.Autolock</name>
+  <filepath>No path</filepath>
+  <description>Autolock service</description>
+  <interface>
+     <name>Autolock</name>
+     <version>2.0</version>
+     <description>Interface to Autolock</description>
+     <customproperty key="txt_aiw_action_text">Dial now</customproperty>
+   </interface>
+</service>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/service_conf_old_format.xml	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<service name="com.nokia.services.Autolock"  filepath="must-not-be-empty" >
+  <description>Autolock</description>
+  <interface name="Autolock" version="1.0" capabilities="">
+    <description>Dial interface</description>
+  </interface>
+</service>
\ No newline at end of file
--- a/securitydialogs/Autolock/src/AutoKeyGuardCenRepI.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,154 +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:
-*
-*/
-
-
-#include <centralrepository.h> 
-#include <settingsinternalcrkeys.h>
-#include "AutoKeyguardObserver.h"
-#include "AutoKeyguardCenRepI.h"
- 
-
-
-// ================= MEMBER FUNCTIONS =======================
-//
-// ----------------------------------------------------------
-// CAutoKeyguardCenRepI::NewLC()
-// Two-phased constructor.
-// ----------------------------------------------------------
-//
-CAutoKeyguardCenRepI* CAutoKeyguardCenRepI::NewLC(CAutoKeyguardObserver* aObserver)
-	{
-	CAutoKeyguardCenRepI* self = new (ELeave) CAutoKeyguardCenRepI(aObserver);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	return self;
-	}
-
-//
-// ----------------------------------------------------------
-// CAutoKeyguardCenRepI::NewL()
-// Two-phased constructor.
-// ----------------------------------------------------------
-//
-CAutoKeyguardCenRepI* CAutoKeyguardCenRepI::NewL(CAutoKeyguardObserver* aObserver)
-	{
-	CAutoKeyguardCenRepI* self = NewLC(aObserver);
-	CleanupStack::Pop(); //self
-	return self;
-	}
-
-//
-// ----------------------------------------------------------
-// CAutoKeyguardCenRepI::~CAutoKeyguardCenRepI()
-// Destructor
-// ----------------------------------------------------------
-//
-CAutoKeyguardCenRepI::~CAutoKeyguardCenRepI()
-	{
-	if(iNotifyHandler)
-	{
-		iNotifyHandler->StopListening();
-		delete iNotifyHandler;	
-	}
-    if(iSession)
-		delete iSession;
-	}
-//
-// ----------------------------------------------------------
-// CAutoKeyguardCenRepI::CAutoKeyguardCenRepI()
-// C++ default constructor
-// ----------------------------------------------------------
-//	
-CAutoKeyguardCenRepI::CAutoKeyguardCenRepI(CAutoKeyguardObserver* aObserver):iObserver(aObserver)
-	{
-	}
-
-//
-// ----------------------------------------------------------
-// CAutoKeyguardCenRepI::ConstructL()
-// Symbian OS default constructor
-// ----------------------------------------------------------
-//	
-void CAutoKeyguardCenRepI::ConstructL()
-	{
-	// init cenrep connection	
-	iSession = CRepository::NewL(KCRUidSecuritySettings);
-
-    iNotifyHandler = CCenRepNotifyHandler::NewL(*this, *iSession, CCenRepNotifyHandler::EIntKey, KSettingsAutomaticKeyguardTime);
-    iNotifyHandler->StartListeningL();
-	}
-
-//
-// ----------------------------------------------------------
-// CAutoKeyguardCenRepI::HandleNotifyInt()
-// Handles autoKeyguard period changes. Called by CenRep.
-// ----------------------------------------------------------
-//	
-void CAutoKeyguardCenRepI::HandleNotifyInt(TUint32 aId, TInt /*aNewValue*/)
-	{
-    if(aId == KSettingsAutomaticKeyguardTime)
-    {
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutoKeyguardCenRepI::HandleNotifyInt() Reset timeout"));
-    #endif
-	    ResetInactivityTimeout();
-    }
-	return;
-	}
-
-void CAutoKeyguardCenRepI::HandleNotifyError(TUint32 /*aId*/, TInt /*error*/, CCenRepNotifyHandler* /*aHandler*/)
-    {
-    return;
-    }
-
-void CAutoKeyguardCenRepI::HandleNotifyGeneric(TUint32 aId)
-    {
-        if ( aId == NCentralRepositoryConstants::KInvalidNotificationId )
-        {//Repository wide reset caused generic notification
-        #if defined(_DEBUG)
-    	RDebug::Print(_L("(AUTOLOCK)CAutoKeyguardCenRepI::HandleNotifyGeneric() Reset timeout"));
-    	#endif
-            ResetInactivityTimeout();
-        }
-    return;
-    }
-
-//
-// ----------------------------------------------------------
-// CAutoKeyguardCenRepI::ResetInactivityTimeoutL()
-// Resets autoKeyguard timer
-// ----------------------------------------------------------
-//	
-void CAutoKeyguardCenRepI::ResetInactivityTimeout()
-	{
-	iObserver->ResetInactivityTimeout();
-	}
-
-//
-// ----------------------------------------------------------
-// CAutoKeyguardCenRepI::Timeout()
-// Returns currents autoKeyguard period (in seconds)
-// ----------------------------------------------------------
-//	
-TInt CAutoKeyguardCenRepI::Timeout()
-	{
-    TInt period = 0;
-    iSession->Get(KSettingsAutomaticKeyguardTime, period);
-	return period;
-	}
-
-// END OF FILE
--- a/securitydialogs/Autolock/src/AutoKeyguardObserver.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,468 +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:
-*
-*/
-
-
-#include <aknappui.h>
-#include <aknkeylock.h>
-#include <AknUtils.h>
-#include <activitymanager.h>
-#include <AknNotifierController.h>
-#include <centralrepository.h> 
-#include <avkondomainpskeys.h>
-#include <e32property.h>
-#include <PSVariables.h>
-#include <startupdomainpskeys.h>
-#include <ctsydomainpskeys.h>
-#include <activeidle2domainpskeys.h>
-#include <coreapplicationuisdomainpskeys.h>
-#include <ScreensaverInternalPSKeys.h>
-#include <hwrmdomainpskeys.h>
-#include "AutoKeyguardCenRepI.h"
-#include "AutoKeyguardObserver.h"
-#include "AutolockPrivateCRKeys.h"
-#include "AutolockAppUiInterface.h"
-
-const TInt AutoKeyguardOff(60000);
-// Screensaver "On" status value
-const TInt KSsOn = 1;
-// Screensaver started fron idle status value
-const TInt KSsStartedFromIdle = 1;
-//Flip open
-const TInt KFlipOpen = 1;
-
-// ================= MEMBER FUNCTIONS =======================
-//
-// ----------------------------------------------------------
-// CAutoKeyguardObserver::NewL()
-// ----------------------------------------------------------
-//
-
-CAutoKeyguardObserver* CAutoKeyguardObserver::NewL( MAutolockAppUiInterface* aAppUiI )
-	{
-	#ifdef RD_AUTO_KEYGUARD
-	#if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutoKeyguardObserver::NewL() BEGIN"));
-    #endif
-	CAutoKeyguardObserver* self = new (ELeave) CAutoKeyguardObserver( aAppUiI );
-	CleanupStack::PushL(self);
-	self->ConstructL(self);
-	CleanupStack::Pop(); //self
-	#if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutoKeyguardObserver::NewL() END"));
-    #endif
-	return self;
-	#else
-	return NULL;
-	#endif //RD_AUTO_KEYGUARD
-	}
-//
-// ----------------------------------------------------------
-// CAutoKeyguardObserver::CAutoKeyguardObserver()
-// C++ default constructor
-// ----------------------------------------------------------
-// 
-CAutoKeyguardObserver::CAutoKeyguardObserver( MAutolockAppUiInterface* aAppUiI ):
-    iAppUiI( aAppUiI )
-	{
-	}
-
-//
-// ----------------------------------------------------------
-// CAutoKeyguardObserver::ConstructL()
-// Symbian OS default constructor
-// ----------------------------------------------------------
-//
-void CAutoKeyguardObserver::ConstructL(CAutoKeyguardObserver* aObserver)
-	{
-	#ifdef RD_AUTO_KEYGUARD
-	#if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutoKeyguardObserver::ConstructL() BEGIN"));
-    #endif	
-	//Central Repository handler
-    iCenRepI = CAutoKeyguardCenRepI::NewL(aObserver);
-	// Activitymanager
-	iActivityManager = CUserActivityManager::NewL(CActive::EPriorityStandard);
-	StartActivityMonitoringL();
-	#if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutoKeyguardObserver::ConstructL() END"));
-    #endif
-    #else // !RD_AUTO_KEYGUARD
-    iCenRepI = NULL;
-	iActivityManager = NULL;
-    #endif //RD_AUTO_KEYGUARD
-	}
-//
-// ----------------------------------------------------------
-// CAutoKeyguardObserver::StartActivityMonitoringL()
-// Start monitoring user activity
-// ----------------------------------------------------------
-//
-void CAutoKeyguardObserver::StartActivityMonitoringL()
-	{
-	#ifdef RD_AUTO_KEYGUARD	
-	SetActivityManagerL();
-	#endif //RD_AUTO_KEYGUARD
-	}
-
-//
-// ----------------------------------------------------------
-// CAutoKeyguardObserver::StopActivityMonitoring()
-// Stop monitoring user activity
-// ----------------------------------------------------------
-//
-void CAutoKeyguardObserver::StopActivityMonitoring()
-	{
-	#ifdef RD_AUTO_KEYGUARD
-	CancelActivityManager();
-	#endif // RD_AUTO_KEYGUARD
-	}
-
-//
-// ----------------------------------------------------------
-// CAutoKeyguardObserver::SetActivityManagerL()
-// Initializes activymanager   
-// ----------------------------------------------------------
-//
-void CAutoKeyguardObserver::SetActivityManagerL()
-	{
-	#ifdef RD_AUTO_KEYGUARD
-	#if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutoKeyguardObserver::SetActivityManagerL() BEGIN"));
-    #endif
-	if (AutoKeyguardTimeout() )
-		{
-		#if defined(_DEBUG)
-    	RDebug::Print(_L("(AUTOLOCK)CAutoKeyguardObserver::SetActivityManagerL() ON: Start manager"));
-    	#endif
-		iActivityManager->Start(AutoKeyguardTimeout(), TCallBack(HandleInactiveEventL,this), 
-								TCallBack(HandleActiveEventL,this));
-		}
-	else
-		{
-		#if defined(_DEBUG)
-    	RDebug::Print(_L("(AUTOLOCK)CAutoKeyguardObserver::SetActivityManagerL() OFF: Start manager"));
-    	#endif
-		iActivityManager->Start(AutoKeyguardOff, TCallBack(HandleInactiveEventL,this), 
-								TCallBack(HandleActiveEventL,this));
-		}
-
-	#if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutoKeyguardObserver::SetActivityManagerL() END"));
-    #endif
-    #endif //RD_AUTO_KEYGUARD
-	}
-//
-// ----------------------------------------------------------
-// CAutoKeyguardObserver::CancelActivityManager()
-// UnInitializes activymanager   
-// ----------------------------------------------------------
-//
-void CAutoKeyguardObserver::CancelActivityManager()
-	{
-	#ifdef RD_AUTO_KEYGUARD
-    if ( iActivityManager )
-        {
-	    iActivityManager->Cancel();
-        }
-    #endif //RD_AUTO_KEYGUARD
-	}
-//
-// ----------------------------------------------------------
-// CAutoKeyguardObserver::~CAutoKeyguardObserver()
-// Destructor   
-// ----------------------------------------------------------
-//
-CAutoKeyguardObserver::~CAutoKeyguardObserver()
-	{
-	#ifdef RD_AUTO_KEYGUARD
-	if(iCenRepI)
-    	delete iCenRepI;
-	if(iActivityManager)
-		{
-		StopActivityMonitoring();
-		delete iActivityManager;
-		iActivityManager = NULL;
-		}
-	#endif //RD_AUTO_KEYGUARD
-	}
-//
-// ----------------------------------------------------------
-// CAutoKeyguardObserver::AutoKeyguardTimeout()
-// Returns current AutoKeyguard period
-// ----------------------------------------------------------
-//
-TInt CAutoKeyguardObserver::AutoKeyguardTimeout()
-	{
-	#ifdef RD_AUTO_KEYGUARD
-    return iCenRepI->Timeout();
-    #else
-    return 0;
-    #endif //RD_AUTO_KEYGUARD
-	}
-//
-// ----------------------------------------------------------
-// CAutoKeyguardObserver::ResetInactivityTimeoutL()
-// Gets AutoKeyguard period and starts monitoring user activity 
-// ----------------------------------------------------------
-//
-void CAutoKeyguardObserver::ResetInactivityTimeout()
-	{
-	#ifdef RD_AUTO_KEYGUARD	
-	if (AutoKeyguardTimeout() )
-		{
-		#if defined(_DEBUG)
-    	RDebug::Print(_L("(AUTOLOCK)CAutoKeyguardObserver::ResetInactivityTimeoutL() ON"));
-    	#endif
-		iActivityManager->SetInactivityTimeout(AutoKeyguardTimeout());
-		}
-	else
-		{
-		#if defined(_DEBUG)
-    	RDebug::Print(_L("(AUTOLOCK)CAutoKeyguardObserver::ResetInactivityTimeoutL() OFF"));
-    	#endif
-		iActivityManager->SetInactivityTimeout(AutoKeyguardOff);
-		}
-	#endif //RD_AUTO_KEYGUARD
-	}
-//
-// ----------------------------------------------------------
-// CAutoKeyguardObserver::HandleActiveEventL()
-// Handles Active event. Called by ActivityManager
-// ----------------------------------------------------------
-//
-TInt CAutoKeyguardObserver::HandleActiveEventL(TAny* /*aPtr*/)
-	{
-	return KErrNone;
-	}
-
-//
-// ----------------------------------------------------------
-// CAutoKeyguardObserver::HandleInactiveEventL()
-// Handles InActive event. Called by ActivityManager
-// ----------------------------------------------------------
-//
-TInt CAutoKeyguardObserver::HandleInactiveEventL(TAny* aPtr)
-	{
-	#ifdef RD_AUTO_KEYGUARD
-	#if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutoKeyguardObserver::HandleInactiveEventL() BEGIN"));
-    #endif
-	if ( STATIC_CAST(CAutoKeyguardObserver*, aPtr)->AutoKeyguardTimeout() )
-		{
-		#if defined(_DEBUG)
-    	RDebug::Print(_L("(AUTOLOCK)CAutoKeyguardObserver::HandleInactiveEventL() Lock"));
-    	#endif
-		STATIC_CAST(CAutoKeyguardObserver*, aPtr)->LockKeysL();
-		}
-	#if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutoKeyguardObserver::HandleInactiveEventL() END"));
-    #endif
-    #endif //RD_AUTO_KEYGUARD
-	return KErrNone;
-	}
-
-//
-// ----------------------------------------------------------
-// CAutoKeyguardObserver::LockKeysL()
-// Locks system
-// ----------------------------------------------------------
-//
-void CAutoKeyguardObserver::LockKeysL()
-	{
-	#ifdef RD_AUTO_KEYGUARD
-	#if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutoKeyguardObserver::LockKeysL() BEGIN"));
-    #endif
-    CRepository* repository = CRepository::NewL(KCRUidAutolockConf);
-    TInt keyguardConf(0);
-    //Check local keyguard variation key 
-    repository->Get(KAutoKeyLockConf, keyguardConf);
-    delete repository;
-    if(keyguardConf & KAutoKeylockFeatureIdFlipOpenDisabled)
-    {
-    	#if defined(_DEBUG)
-    	RDebug::Print(_L("(AUTOLOCK)CAutoKeyguardObserver::LockKeysL() Flip variation"));
-    	#endif
-    	TInt flipState(KFlipOpen);
-    	RProperty::Get(KPSUidHWRM, KHWRMFlipStatus, flipState);
-	TInt lightStatus=EForcedLightsUninitialized; 
-	RProperty::Get(KPSUidCoreApplicationUIs,KLightsVTForcedLightsOn,lightStatus ); 
-
-	//If flip is open and feature flag is on. don't lock
-	if(flipState == KFlipOpen || lightStatus == EForcedLightsOn)
-    	{
-    		#if defined(_DEBUG)
-    		RDebug::Print(_L("(AUTOLOCK)CAutoKeyguardObserver::LockKeysL() Flip open"));
-    		#endif
-    		return;
-    	}
-    		
-    }
-    
-	{	// REQ 414-5466 Prevention of device lock in context of Hands Free Voice UI
-	TInt vuiValue = 0;
-	TUid KHFVuiModePSUid = { 0x102818E7 };
-	enum THFVuiModePSKeys
-	    {
-	    EHFVuiPSModeId = 1000
-	    };
-	TInt tRet = RProperty::Get(KHFVuiModePSUid, EHFVuiPSModeId, vuiValue);	// also 0 if can't get because permissions or because doesn't exists
-	#if defined(_DEBUG)
-		RDebug::Printf( "%s %s (%u) gatting KHFVuiModePSUid+EHFVuiPSModeId=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, tRet );
-		RDebug::Printf( "%s %s (%u) vuiValue=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, vuiValue );
-	#endif
-	if(vuiValue)
-		{
-		#if defined(_DEBUG)
-		RDebug::Print(_L("(AUTOLOCK)CAutoKeyguardObserver::LockKeysL() Voice functions active. No locking possible."));
-		#endif
-		return;
-		}
-	}
-
-	TInt value = 0;
-	TBool keylockOn = EFalse;
-	TBool autolockOn = EFalse;
-	TBool idle = EFalse;
-	TInt callState = EPSCTsyCallStateNone;
-	TBool okToLock = EFalse;
-	TBool screenSaverOn = EFalse;
-	TBool screenSaverStertedFromIdle = EFalse;
-        TBool startupOver = EFalse;
-	TBool codeQueryOpen = EFalse;
-    //Get keyguard status
-    RProperty::Get(KPSUidAvkonDomain, KAknKeyguardStatus, value);
-    keylockOn = (value == EKeyguardLocked);
-    //Get call state
-    RProperty::Get(KPSUidCtsyCallInformation, KCTsyCallState, callState);
-    
-    //See whether we are in idle
- 		value = 0;   
-    RProperty::Get(KPSUidAiInformation, KActiveIdleState, value);
-    idle = (value == EPSAiForeground);
-    idle = ETrue; // don't care about idle state. Phone should autolock on any UI, not only HomeSreeen.
-    
-    value = 0;
-    RProperty::Get(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, value);
-    autolockOn = (value > EAutolockOff);
-	
-		value = 0;
-	  RProperty::Get(KPSUidScreenSaver, KScreenSaverOn, value);
-    screenSaverOn = (value == KSsOn);
-    
-    value = 0;
-    RProperty::Get(KPSUidScreenSaver, KScreenSaverActivatedFromIdle, value);
-    screenSaverStertedFromIdle = (value == KSsStartedFromIdle);
-    
-    // See if SIM is accepted
-    if(idle)
-    	{
-	    value = 0;
-	    RProperty::Get(KPSUidStartup, KPSSimStatus, value);
-	    // automatic lock can't get enabled if SIM-locked.
-	    if(value == ESimNotReady)
-	    	idle = EFalse;
-	    #if defined(_DEBUG)
-	    RDebug::Print(_L("(AUTOLOCK)CAutoKeyguardObserver::LockKeysL() KPSSimStatus state: %d"), value);
-	    RDebug::Print(_L("(AUTOLOCK)CAutoKeyguardObserver::LockKeysL() ESimUsable: %d"), ESimUsable);
-	    #endif
-	  	}
-
-    //See if all the startup related queries and graphics has been displayed
-    value = 0;
-    RProperty::Get(KPSUidStartup, KPSStartupUiPhase, value);
-    startupOver = (value == EStartupUiPhaseAllDone);
-        
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutoKeyguardObserver::LockKeysL() startupOver: %d"), startupOver);
-    RDebug::Print(_L("(AUTOLOCK)CAutoKeyguardObserver::LockKeysL() Startup state: %d"), value);
-    #endif
-	//See if the lock code query is open
-    codeQueryOpen = iAppUiI->DeviceLockQueryStatus();
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutoKeyguardObserver::LockKeysL() codeQueryOpen: %d"), codeQueryOpen);
-    RDebug::Print(_L("(AUTOLOCK)CAutoKeyguardObserver::LockKeysL() autolockOn: %d"), autolockOn);
-    #endif
-    if (startupOver)
-        {
-		// If lock code query is open and device lock is on, cancel the query.
-        // AppUi will enable keylock when the query is cancelled
-        if (autolockOn && codeQueryOpen)
-            {
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(AUTOLOCK)CAutoKeyguardObserver::LockKeysL() Query open, cancel it"));
-            #endif
-            iAppUiI->CancelDeviceLockQuery();
-            return;
-            }
-        // If keylock is already ON, there is a ongoing call, 
-        // autolock is already ON or phone is not in idle, don't lock.
-        if (keylockOn || (callState > EPSCTsyCallStateNone) || autolockOn || !idle)
-            {
-        	    #if defined(_DEBUG)
-    		    RDebug::Print(_L("(AUTOLOCK)CAutoKeyguardObserver::LockKeysL() Don't lock"));
-    		    RDebug::Print(_L("(AUTOLOCK)keylockstatus: %d"), keylockOn);
-    		    RDebug::Print(_L("(AUTOLOCK)callstate: %d"), callState);
-    		    RDebug::Print(_L("(AUTOLOCK)autolockstate: %d"), autolockOn);
-    		    RDebug::Print(_L("(AUTOLOCK)idlestate: %d"), idle);
-    		    RDebug::Print(_L("(AUTOLOCK)screenSaverOn: %d"), screenSaverOn);
-    		    RDebug::Print(_L("(AUTOLOCK)screenSaverStertedFromIdle: %d"), screenSaverStertedFromIdle);
-    		    #endif
-    		    //If screensaver is on, idle does not have foreground. If Screensaver was started from Idle, lock keys.
-    		    if(!idle && screenSaverOn && screenSaverStertedFromIdle && (callState <= EPSCTsyCallStateNone))
-    			    okToLock = ETrue;
-    		    else
-    		        okToLock = EFalse;
-            }
-         else //Otherwise there's no problem...
-         		okToLock = ETrue;
-        }
-    
-    
-    if (okToLock)
-        {
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(AUTOLOCK)CAutoKeyguardObserver::LockKeysL() Lock"));
-            RDebug::Print(_L("(AUTOLOCK)keylockstatus: %d"), keylockOn);
-            RDebug::Print(_L("(AUTOLOCK)callstate: %d"), callState);
-            RDebug::Print(_L("(AUTOLOCK)autolockstate: %d"), autolockOn);
-            RDebug::Print(_L("(AUTOLOCK)idlestate: %d"), idle);
-            RDebug::Print(_L("(AUTOLOCK)screenSaverOn: %d"), screenSaverOn);
-            RDebug::Print(_L("(AUTOLOCK)screenSaverStertedFromIdle: %d"), screenSaverStertedFromIdle);
-            #endif
-		//Tell keylock to lock itself.
-		RAknKeyLock keylock;
-        if ( keylock.Connect() == KErrNone )
-          {
-          	#if defined(_DEBUG)
-    		RDebug::Print(_L("(AUTOLOCK)CAutoKeyguardObserver::LockKeysL() Connect OK"));
-    		#endif
-    			 if(AknLayoutUtils::PenEnabled())
-    			     keylock.EnableWithoutNote(); //Enable without note
-    			 else
-    			     keylock.EnableKeyLock();
-           keylock.Close();
-          }
-		}
-	#if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutoKeyguardObserver::LockKeysL() END"));
-    #endif
-    #endif //RD_AUTO_KEYGUARD
-} 
-	
-
-// END OF FILE
--- a/securitydialogs/Autolock/src/AutoLockCenRepI.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,165 +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:
-*
-*/
-
-
-#include <centralrepository.h> 
-#include <settingsinternalcrkeys.h>
-#include "AutoLockModelPS.h"
-#include "AutolockAppUiPS.h"
-#include "AutoLockCenRepI.h"
- 
-
-
-// ================= MEMBER FUNCTIONS =======================
-//
-// ----------------------------------------------------------
-// CAutolockCenRepI::NewLC()
-// Two-phased constructor.
-// ----------------------------------------------------------
-//
-CAutolockCenRepI* CAutolockCenRepI::NewLC(CAutolockAppUi* aAppUi)
-	{
-	CAutolockCenRepI* self = new (ELeave) CAutolockCenRepI(aAppUi);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	return self;
-	}
-
-//
-// ----------------------------------------------------------
-// CAutolockCenRepI::NewL()
-// Two-phased constructor.
-// ----------------------------------------------------------
-//
-CAutolockCenRepI* CAutolockCenRepI::NewL(CAutolockAppUi* aAppUi)
-	{
-	CAutolockCenRepI* self = NewLC(aAppUi);
-	CleanupStack::Pop(); //self
-	return self;
-	}
-
-//
-// ----------------------------------------------------------
-// CAutolockCenRepI::~CAutolockCenRepI()
-// Destructor
-// ----------------------------------------------------------
-//
-CAutolockCenRepI::~CAutolockCenRepI()
-	{
-	if(iNotifyHandler)
-	{
-		iNotifyHandler->StopListening();
-		delete iNotifyHandler;	
-	}
-    if(iSession)
-		delete iSession;
-	}
-//
-// ----------------------------------------------------------
-// CAutolockCenRepI::CAutolockCenRepI()
-// C++ default constructor
-// ----------------------------------------------------------
-//	
-CAutolockCenRepI::CAutolockCenRepI(CAutolockAppUi* aAppUi):iAppUi(aAppUi)
-	{
-	}
-
-//
-// ----------------------------------------------------------
-// CAutolockCenRepI::ConstructL()
-// Symbian OS default constructor
-// ----------------------------------------------------------
-//	
-void CAutolockCenRepI::ConstructL()
-	{
-	// init cenrep connection	
-	iSession = CRepository::NewL(KCRUidSecuritySettings);
-
-    iNotifyHandler = CCenRepNotifyHandler::NewL(*this, *iSession, CCenRepNotifyHandler::EIntKey, KSettingsAutoLockTime);
-    iNotifyHandler->StartListeningL();
-	}
-
-//
-// ----------------------------------------------------------
-// CAutolockCenRepI::HandleNotifyInt()
-// Handles autolock period changes. Called by CenRep.
-// ----------------------------------------------------------
-//	
-void CAutolockCenRepI::HandleNotifyInt(TUint32 aId, TInt /*aNewValue*/)
-	{
-    if(aId == KSettingsAutoLockTime)
-    {
-	    ResetInactivityTimeout();
-    }
-	return;
-	}
-
-void CAutolockCenRepI::HandleNotifyError(TUint32 /*aId*/, TInt /*error*/, CCenRepNotifyHandler* /*aHandler*/)
-    {
-    return;
-    }
-
-void CAutolockCenRepI::HandleNotifyGeneric(TUint32 aId)
-    {
-        if ( aId == NCentralRepositoryConstants::KInvalidNotificationId )
-        {//Repository wide reset caused generic notification
-            ResetInactivityTimeout();
-        }
-    return;
-    }
-
-//
-// ----------------------------------------------------------
-// CAutolockCenRepI::ResetInactivityTimeoutL()
-// Resets autolock timer
-// ----------------------------------------------------------
-//	
-void CAutolockCenRepI::ResetInactivityTimeout()
-	{
-	iAppUi->Model()->ResetInactivityTimeout();
-	}
-
-//
-// ----------------------------------------------------------
-// CAutolockCenRepI::Timeout()
-// Returns currents autolock period (in seconds)
-// ----------------------------------------------------------
-//	
-TInt CAutolockCenRepI::Timeout()
-	{
-    TInt period = 0;
-    iSession->Get(KSettingsAutoLockTime, period);
-	return period * 60;
-	}
-//
-// ----------------------------------------------------------
-// CAutolockCenRepI::SetLocked ()
-// Sets lock on/off in CenRep
-// ----------------------------------------------------------
-//	
-void CAutolockCenRepI::SetLockedL(TBool aLockValue)
-	{
-	TInt lockValue = 0;
-	if (aLockValue)
-		{
-		lockValue = 1;
-		}
-    CRepository* repository = CRepository::NewL(KCRUidSecuritySettings);
-    repository->Set(KSettingsAutolockStatus, lockValue);
-    delete repository;
-	}
-// END OF FILE
--- a/securitydialogs/Autolock/src/AutoLockLockObserver.cpp	Thu Aug 19 10:45:23 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: 
-*		Obsererver for Set System Locked event	
-*
-*
-*/
-
-#include		<bldvariant.hrh>
-#include		<e32property.h>
-#include	<PSVariables.h>
-#include		<coreapplicationuisdomainpskeys.h>
-
-#include	"AutoLockLockObserverPS.h"
-#include	"AutolockAppUiPS.h"
-#include	"AutoLockModelPS.h"
-
-
-// ================= MEMBER	FUNCTIONS	=======================
-//
-// ----------------------------------------------------------
-// CLockObserver::NewL()
-// Constructs	a	new	entry	with given values.
-// ----------------------------------------------------------
-//
-CLockObserver* CLockObserver::NewL(CAutolockAppUi* aAppUi)
-		{
-		CLockObserver* self	=	new	(ELeave) CLockObserver(aAppUi);
-		CleanupStack::PushL(self);
-		self->ConstructL();
-		CleanupStack::Pop();
-		return self;
-		}
-//
-// ----------------------------------------------------------
-// CLockObserver::CLockObserver()
-// Destructor
-// ----------------------------------------------------------
-//
-CLockObserver::~CLockObserver()
-		{
-		Cancel();
-		iProperty.Close();
-		}
-//
-// ----------------------------------------------------------
-// CNoSimCard::Start()
-// Starts	listening	KUidAutolockStatus event 
-// ----------------------------------------------------------
-//
-TInt CLockObserver::Start()
-		{
-		if (IsActive())
-				return KErrInUse;
-		iStatus	=	KRequestPending;
-		iProperty.Attach(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus);		 
-		iProperty.Subscribe(iStatus);
-		SetActive();
-		return KErrNone;
-		}
-//
-// ----------------------------------------------------------
-// CLockObserver::CLockObserver()
-// C++ constructor
-// ----------------------------------------------------------
-// 
-CLockObserver::CLockObserver(CAutolockAppUi* aAppUi) : CActive(0), iAppUi(aAppUi)
-	{														 
-		}
-//
-// ----------------------------------------------------------
-// CLockObserver::ConstructL()
-// Symbian OS	default	constructor
-// ----------------------------------------------------------
-// 
-void CLockObserver::ConstructL()
-		{
-	    
-	#if	defined(_DEBUG)	
-    RDebug::Print(_L("(AUTOLOCK)CLockObserver::ConstructL()"));
-    #endif
-        
-		// Add this	active object	to the scheduler.
-	CActiveScheduler::Add(this);
-	    
-	TInt ret;
-	_LIT_SECURITY_POLICY_PASS(KReadPolicy);	
-	_LIT_SECURITY_POLICY_C1(KWritePolicy,	ECapabilityWriteDeviceData);
-	
-	ret	=	RProperty::Define(KPSUidCoreApplicationUIs,	KCoreAppUIsAutolockStatus, RProperty::EInt,	KReadPolicy, KWritePolicy);
-		if(ret !=	KErrAlreadyExists)
-				User::LeaveIfError(ret);
-				    
-	// Begin obsering	PubSub event	
-	Start();	
-		}
-//
-// ----------------------------------------------------------
-// CLockObserver::RunL()
-// Called	when device	(autolock) is	activated	from menu.
-// ----------------------------------------------------------
-// 
-void CLockObserver::RunL()
-	{
-	// set ui	locked.
-		TInt autolockState;
-		iProperty.Get( autolockState );
-		if (autolockState	>	EAutolockOff)
-				{
-		iAppUi->Model()->LockSystemL(autolockState);
-		}
-	// Continue	observing	PubSub event	
-	Start();	
-	}
-//
-// ----------------------------------------------------------
-// CLockObserver::DoCancel()
-// Cancels event listening
-// ----------------------------------------------------------
-// 
-void CLockObserver::DoCancel()
-		{
-		iProperty.Cancel();
-		}
-// End of	file
--- a/securitydialogs/Autolock/src/AutoLockModel.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,444 +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:
-*
-*/
-
-#include <aknappui.h>
-#include <activitymanager.h>
-#include <bldvariant.hrh>
-#include <featmgr.h>
-#include <AknNotifierController.h>
-#include <featmgr.h>
-#include <e32property.h>
-#include <PSVariables.h>
-#include <startupdomainpskeys.h>
-#include <coreapplicationuisdomainpskeys.h>
-#include <ctsydomainpskeys.h>
-
-#include <SCPClient.h>
-
-#include "AutoLockModelPS.h"  
-#include "AutolockAppUiPS.h"
-#include "AutoLockLockObserverPS.h"
-#include "AutoLockCenRepI.h"
-
-
-const TInt AutoLockOff(60000);
-
-
-
-// ================= MEMBER FUNCTIONS =======================
-//
-// ----------------------------------------------------------
-// CAutoLockModel::NewL()
-// ----------------------------------------------------------
-//
-
-CAutoLockModel* CAutoLockModel::NewL(CAutolockAppUi* aAppUi, TBool aLocked)
-  {
-  CAutoLockModel* self = new (ELeave) CAutoLockModel(aAppUi);
-  CleanupStack::PushL(self);
-  self->ConstructL( aLocked );
-  CleanupStack::Pop(); //self
-  return self;
-  }
-//
-// ----------------------------------------------------------
-// CAutoLockModel::CAutoLockModel()
-// C++ default constructor
-// ----------------------------------------------------------
-// 
-CAutoLockModel::CAutoLockModel(CAutolockAppUi* aAppUi) : 
- iAppUi( aAppUi ), iMonitoring(EFalse)  
-  {
-  }
-
-//
-// ----------------------------------------------------------
-// CAutoLockModel::ConstructL()
-// Symbian OS default constructor
-// ----------------------------------------------------------
-//
-void CAutoLockModel::ConstructL( TBool aLocked )
-  {
-    FeatureManager::InitializeLibL();
-  #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutoLockModel::ConstructL() BEGIN"));
-  #endif  
-    iCenRepI = CAutolockCenRepI::NewL(iAppUi);
-  // lock status observer
-  iLockObserver = CLockObserver::NewL(iAppUi);
-  // Activitymanager
-  iActivityManager = CUserActivityManager::NewL(CActive::EPriorityStandard);
-  StartActivityMonitoringL();
-    // In GSM the device is always unlocked.
-    // In CDMA, SecClientUi will lock the device on boot-up if needed.
-    if ( aLocked == EFalse ) {       
-       SetLockedL(EAutolockOff);
-       #if defined(_DEBUG)
-       RDebug::Print(_L("(AUTOLOCK)CAutoLockModel::ConstructL() EAutolockOff"));
-       #endif       
-    }     
-       
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutoLockModel::ConstructL() END"));
-    #endif
-  }
-  //
-// ----------------------------------------------------------
-// CAutoLockModel::StartActivityMonitoringL()
-// Start monitoring user activity
-// ----------------------------------------------------------
-//
-void CAutoLockModel::StartActivityMonitoringL()
-  { 
-  SetActivityManagerL();
-  }
-
-//
-// ----------------------------------------------------------
-// CAutoLockModel::StopActivityMonitoring()
-// Stop monitoring user activity
-// ----------------------------------------------------------
-//
-void CAutoLockModel::StopActivityMonitoring()
-  {
-  CancelActivityManager();
-  }
-
-//
-// ----------------------------------------------------------
-// CAutoLockModel::SetActivityManagerL()
-// Initializes activymanager   
-// ----------------------------------------------------------
-//
-void CAutoLockModel::SetActivityManagerL()
-  {
-  if (AutoLockTimeout() )
-    {
-    iActivityManager->Start(AutoLockTimeout(), TCallBack(HandleInactiveEventL,this), 
-                TCallBack(HandleActiveEventL,this));
-    }
-  else
-    {
-    iActivityManager->Start(AutoLockOff, TCallBack(HandleInactiveEventL,this), 
-                TCallBack(HandleActiveEventL,this));
-    }
-
-  }
-//
-// ----------------------------------------------------------
-// CAutoLockModel::CancelActivityManager()
-// UnInitializes activymanager   
-// ----------------------------------------------------------
-//
-void CAutoLockModel::CancelActivityManager()
-  {
-    if ( iActivityManager )
-        {
-      iActivityManager->Cancel();
-        }
-  delete iActivityManager;
-  iActivityManager = NULL;
-  }
-//
-// ----------------------------------------------------------
-// CAutoLockModel::~CAutoLockModel()
-// Destructor   
-// ----------------------------------------------------------
-//
-CAutoLockModel::~CAutoLockModel()
-  {
-    delete iCenRepI;
-  delete iLockObserver;
-  StopActivityMonitoring();
-  FeatureManager::UnInitializeLib();
-    // close custom phone
-  }
-//
-// ----------------------------------------------------------
-// CAutoLockModel::AutoLockTimeout()
-// Returns current autolock period
-// ----------------------------------------------------------
-//
-TInt CAutoLockModel::AutoLockTimeout()
-  {
-    return iCenRepI->Timeout();
-  }
-//
-// ----------------------------------------------------------
-// CAutoLockModel::ResetInactivityTimeoutL()
-// Gets autolock period and starts monitoring user activity 
-// ----------------------------------------------------------
-//
-void CAutoLockModel::ResetInactivityTimeout()
-  { 
-  if (AutoLockTimeout() )
-    {
-    iActivityManager->SetInactivityTimeout(AutoLockTimeout());
-    }
-  else
-    {
-    iActivityManager->SetInactivityTimeout(AutoLockOff);
-    }
-  }
-//
-// ----------------------------------------------------------
-// CAutoLockModel::HandleActiveEventL()
-// Handles Active event. Called by ActivityManager
-// ----------------------------------------------------------
-//
-TInt CAutoLockModel::HandleActiveEventL(TAny* /*aPtr*/)
-  {
-  return KErrNone;
-  }
-
-//
-// ----------------------------------------------------------
-// CAutoLockModel::HandleInactiveEventL()
-// Handles InActive event. Called by ActivityManager
-// ----------------------------------------------------------
-//
-TInt CAutoLockModel::HandleInactiveEventL(TAny* aPtr)
-  {
-  if ( STATIC_CAST(CAutoLockModel*, aPtr)->AutoLockTimeout() )
-    {
-      TInt value(EStartupUiPhaseUninitialized);
-      RProperty::Get(KPSUidStartup, KPSStartupUiPhase, value);
-      //Don't lock unless boot is over.
-      if(value == EStartupUiPhaseAllDone)
-        {
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(AUTOLOCK)CAutoLockModel::HandleInactiveEventL() Boot over"));
-        #endif
-        #ifdef RD_REMOTELOCK
-        STATIC_CAST(CAutoLockModel*, aPtr)->LockSystemL(ETimerLocked);
-        #else
-        STATIC_CAST(CAutoLockModel*, aPtr)->LockSystemL(EAutolockOn);
-        #endif //RD_REMOTELOCK
-        }
-      else
-      {
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(AUTOLOCK)CAutoLockModel::HandleInactiveEventL() In boot; don't lock"));
-        #endif
-      }
-    }
-  return KErrNone;
-  }
-
-//
-// ----------------------------------------------------------
-// CAutoLockModel::LockSystemL()
-// Locks system
-// ----------------------------------------------------------
-//
-void CAutoLockModel::LockSystemL(TInt aAutolockState)
-  {
-  #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutoLockModel::LockSystemL() BEGIN"));
-    #endif
-    // If already locked, do nothing. Otherwise we'll end up
-    // on top of Screensaver
-    // Check if iSideKey2 is zero or not (locked if nonzero)
-    // Also, phone should not be locked if PUK1 code query is up.
-#ifdef FF_STARTUP_OMA_DM_SUPPORT  // New booting order  Start ID:  MVKS-7PZDZ5
-    TInt autolock_value = 0;
-    RProperty::Get(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, autolock_value);  
-    if (autolock_value == EAutolockStatusUninitialized)
-    {
-        return;         
-    }   
-#endif  //End ID:  MVKS-7PZDZ5
-    if (iAppUi->Locked() || iAppUi->IsPinBlocked())
-        {
-        return;
-        }
-  
-  TInt lightStatus=EForcedLightsUninitialized; 
-  RProperty::Get(KPSUidCoreApplicationUIs,KLightsVTForcedLightsOn,lightStatus ); 
-  //If display is forced on. don't lock 
-  if(lightStatus == EForcedLightsOn ) 
-    {
-    #if defined(_DEBUG) 
-    RDebug::Print(_L("(AUTOLOCK)CAutoLockModel::LockSystemL() Display is forced on. Device not locked")); 
-    #endif 
-    return;
-    }
-
-    //Check which state we are in to see if it's OK to lock the phone
-    //In CDMA when there is no SIM (RUIM) support we should be able to lock
-    //the phone after reboot. In this case ESWStateNormal is too late to lock the phone
-    //and other states below are needed.
-    TBool okToLock = EFalse;
-    TInt sysState = 0;
-    iProperty.Get(KPSUidStartup, KPSGlobalSystemState, sysState);    
-    //If NOT in CDMA the Autolock should come up only after the phone has booted up.
-    if ( FeatureManager::FeatureSupported( KFeatureIdProtocolCdma ) || iAppUi->HiddenReset())
-        {
-        if( (sysState == ESwStateNormalRfOn       ||
-            sysState == ESwStateNormalRfOff       ||
-             sysState == ESwStateCriticalPhaseOK) &&
-            (aAutolockState > EAutolockOff) ) // EMKK-7N3G7R
-            {
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(AUTOLOCK)CAutoLockModel::LockSystemL() LOCKED AFTER HIDDEN RESET"));
-            #endif
-            okToLock = ETrue;
-            }
-        }
-    else //Feature Manager
-        {
-        if( (sysState == ESwStateNormalRfOn       ||
-             sysState == ESwStateNormalRfOff)      &&
-            (aAutolockState > EAutolockOff) ) // EMKK-7N3G7R
-            {
-            okToLock = ETrue;
-            }
-        }
-   TInt tarmFlag=0;
-if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw ))    
-{
-    // Get the TARM admin flag value
-  TInt tRet = RProperty::Get( KSCPSIDAutolock, SCP_TARM_ADMIN_FLAG_UID, tarmFlag );
-    
-    if ( tRet != KErrNone )
-        {
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::BringAppToForegroundL():\
-            Warning: failed to get TARM Admin Flag state"));
-        #endif
-        }
-    else
-        {
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::BringAppToForegroundL(): TARM flag: %d"),
-            tarmFlag );
-        #endif
-        }
-}
-    
-    TInt callState=0;
-    iProperty.Get(KPSUidCtsyCallInformation, KCTsyCallState, callState);
-TBool isConditionSatisfied = EFalse;
-if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw ))
-{        
-    if ( ( callState != EPSCTsyCallStateNone ) && (!( tarmFlag & KSCPFlagAdminLock )) )    
-          isConditionSatisfied = ETrue;
-}
-else
-{
-    if ( callState != EPSCTsyCallStateNone )
-        isConditionSatisfied = ETrue;
-}
-    if (isConditionSatisfied)
-        {
-        TBool remoteLocked(EFalse);
-        #ifdef RD_REMOTELOCK
-        remoteLocked = (aAutolockState == ERemoteLocked);
-        #endif //RD_REMOTELOCK
-         if(remoteLocked) 
-         {
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(AUTOLOCK)CAutoLockModel::LockSystemL() REMOTE LOCKED"));
-            #endif
-            okToLock = ETrue;
-            
-         }
-         else
-            okToLock = EFalse;        
-        }
-       
-    if (!iAppUi->IsForeground() && okToLock)
-        {
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(AUTOLOCK)CAutoLockModel::LockSystemL() LOCK PHONE"));
-        #endif   
-    // close fast-swap window
-    CEikonEnv::Static()->DismissTaskList();
-    // inform Avokon & Other app that system is locked
-    // unless the value has already been set in secuisystemlock
-    #ifdef RD_REMOTELOCK
-    if(aAutolockState != EManualLocked)
-        {
-            #if defined(_DEBUG)
-                RDebug::Print(_L("(AUTOLOCK)CAutoLockModel::LockSystemL() Timer/Remote locked: %d"), aAutolockState);
-                #endif
-            SetLockedL(aAutolockState);       
-        }
-    else if((aAutolockState == EManualLocked)  && !iAppUi->Locked() && iAppUi->HiddenReset())
-         {   //set the PubSub key if we are to be locked after a hidden reset has occurred.
-             #if defined(_DEBUG)
-                 RDebug::Print(_L("(AUTOLOCK)CAutoLockModel::LockSystemL() HIDDEN RESET LOCK"));
-                 #endif
-             SetLockedL(aAutolockState);     
-         }
-    else
-        {   //Normal manual lock from power key. Just set the CenRep key.
-            iCenRepI->SetLockedL(okToLock);
-        }
-    #else //! RD_REMOTELOCK
-    SetLockedL(aAutolockState);
-    #endif//RD_REMOTELOCK
-    // lock keys
-    iAppUi->LockKeysL();
-    // iAppUi->EnableWGListChangeEventListening();	// this was in previous versions. It's not needed because it will come on top of bigClock
-    // app to foreground
-    iAppUi->BringAppToForegroundL();
-         // Reset inactivity time so that Screensaver gets to
-        // run again after its timeout. We'll ignore the new
-        // inactivity timeout, if already locked
-        // RDebug::Printf( "%s %s (%u) CR 428-469 avoid User::ResetInactivityTime=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-        // User::ResetInactivityTime();
-    }
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutoLockModel::LockSystemL() END"));
-    #endif
-} 
-  
-//
-// ----------------------------------------------------------
-// CAutoLockModel::SetLocked
-// Sets lockvalue in Publish & Subscribe and Central Repository
-// ----------------------------------------------------------
-//
-void CAutoLockModel::SetLockedL(TInt aAutolockState)
-  {
-  #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutoLockModel::SetLockedL() begin"));
-    #endif
-  TBool locked = (aAutolockState > EAutolockOff);
-  if (locked)
-    {
-        iProperty.Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, aAutolockState);
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(AUTOLOCK)CAutoLockModel::SetLockedL() LOCK"));
-        #endif
-    }   
-  else
-    {       
-        iProperty.Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, EAutolockOff);
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(AUTOLOCK)CAutoLockModel::SetLockedL() UNLOCK"));         
-        #endif
-    }
-
-    iCenRepI->SetLockedL(locked);
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutoLockModel::SetLockedL() end"));
-    #endif
-  }
-
-// END OF FILE
--- a/securitydialogs/Autolock/src/AutoLockValueObserver.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,211 +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: 
-*		Observer for phone events. Used to deactive/active the side-key
-*
-*
-*/
-
-
-#include    <e32property.h>
-#include	<PSVariables.h>
-#include <ctsydomainpskeys.h>
-#include	"AutolockAppUiPS.h"
-#include	"AutoLockValueObserverPS.h"
-#include <coreapplicationuisdomainpskeys.h>
-#include <startupdomainpskeys.h>
-
-// ================= MEMBER FUNCTIONS =======================
-//
-// ----------------------------------------------------------
-// CValueObserver::NewL()
-// Constructs a new entry with given values.
-// ----------------------------------------------------------
-//
-CValueObserver* CValueObserver::NewL(CAutolockAppUi* aAppUi)
-    {
-    CValueObserver* self = new (ELeave) CValueObserver(aAppUi);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop();
-    return self;
-    }
-//
-// ----------------------------------------------------------
-// CValueObserver::CValueObserver()
-// Destructor
-// ----------------------------------------------------------
-//
-CValueObserver::~CValueObserver()
-    {
-    Cancel();
-    }
-//
-// ----------------------------------------------------------
-// CValueObserver::Start()
-// Starts listening KUidCurrentCall event  
-// ----------------------------------------------------------
-//
-TInt CValueObserver::Start()
-    {
-    if (IsActive())
-        return KErrInUse;
-    iStatus = KRequestPending;
-    iProperty.Attach(KPSUidCtsyCallInformation, KCTsyCallState); 
-    iProperty.Subscribe(iStatus);
-    SetActive();
-    #if defined(_DEBUG)
-    RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-		#endif
-    return KErrNone;
-    }
-//
-// ----------------------------------------------------------
-// CValueObserver::Stop()
-// Stops listening KUidCurrentCall event 
-// ----------------------------------------------------------
-//
-void CValueObserver::Stop()
-	{
-	#if defined(_DEBUG)
-	RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-	#endif
-	Cancel();
-	}
-//
-// ----------------------------------------------------------
-// CLockObserver::CLockObserver()
-// C++ constructor
-// ----------------------------------------------------------
-// 
-CValueObserver::CValueObserver(CAutolockAppUi* aAppUi) : CActive(0), iAppUi(aAppUi)
-	{               
-		#if defined(_DEBUG)     
-		RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-    #endif
-    }
-//
-// ----------------------------------------------------------
-// CLockObserver::ConstructL()
-// Symbian OS default constructor
-// ----------------------------------------------------------
-// 
-void CValueObserver::ConstructL()
-    {
-    // Add this active object to the scheduler.
-    #if defined(_DEBUG)
-    RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-		#endif
-	CActiveScheduler::Add(this);	
-    }
-//
-// ----------------------------------------------------------
-// CValueObserver::RunL()
-// 
-// ----------------------------------------------------------
-// 
-void CValueObserver::RunL()
-	{
-		#if defined(_DEBUG)
-		RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-		#endif
-    TInt atForeground = iAppUi->IsForeground();
-		TInt value(EStartupUiPhaseUninitialized);
-		RProperty::Get(KPSUidStartup, KPSStartupUiPhase, value);
-    TInt callState;
-    iProperty.Get( callState );
-    #if defined(_DEBUG)
-		RDebug::Printf( "%s %s (%u) callState=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, callState );
-		RDebug::Printf( "%s %s (%u) EPSCTsyCallStateNone=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, EPSCTsyCallStateNone );
-		RDebug::Printf( "%s %s (%u) EPSCTsyCallStateUninitialized=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, EPSCTsyCallStateUninitialized );
-		RDebug::Printf( "%s %s (%u) atForeground=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, atForeground );
-		RDebug::Printf( "%s %s (%u) KPSStartupUiPhase value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, value );
-		RDebug::Printf( "%s %s (%u) EStartupUiPhaseSystemWelcomeDone=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, EStartupUiPhaseSystemWelcomeDone );
-		#endif
-
-
-    if (callState == EPSCTsyCallStateNone && !atForeground)
-        {
-			if( value<EStartupUiPhaseSystemWelcomeDone )
-					{
-					#if defined(_DEBUG)
-					RDebug::Printf( "%s %s (%u) re-start=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 );
-					#endif
-					Start();
-					}
-			else
-				{
-						// app back to foreground
-				TInt iAppUi_Locked = iAppUi->Locked();
-				TInt alocked = RProperty::Get(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, value);
-				#if defined(_DEBUG)
-				RDebug::Printf( "%s %s (%u) alocked=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, alocked );
-				RDebug::Printf( "%s %s (%u) iAppUi_Locked=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iAppUi_Locked );
-				#endif
-				if(iAppUi_Locked)
-					{
-					#if defined(_DEBUG)
-					RDebug::Printf( "%s %s (%u) BringAppToForegroundL=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 );
-					#endif
-					iAppUi->BringAppToForegroundL();
-					}
-			}
-		}
-    else
-		{
-				{
-				if( value<EStartupUiPhaseSystemWelcomeDone )
-					{
-					#if defined(_DEBUG)
-					RDebug::Printf( "%s %s (%u) 1=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 );
-					#endif
-					if( callState != EPSCTsyCallStateNone && callState != EPSCTsyCallStateUninitialized && !atForeground)
-						{
-						#if defined(_DEBUG)
-						RDebug::Printf( "%s %s (%u) 2=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 2 );
-						#endif
-						iAppUi->BringAppToForegroundL();
-						}
-					else if( (callState == EPSCTsyCallStateNone || callState == EPSCTsyCallStateUninitialized) && atForeground)
-						{
-						#if defined(_DEBUG)
-						RDebug::Printf( "%s %s (%u) calling BringAppToForegroundL=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 );
-						#endif
-						iAppUi->BringAppToForegroundL();
-						#if defined(_DEBUG)
-						RDebug::Printf( "%s %s (%u) calling SwitchToPreviousAppL=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 2 );
-						#endif
-						iAppUi->SwitchToPreviousAppL();
-						#if defined(_DEBUG)
-						RDebug::Printf( "%s %s (%u) done=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 3 );
-						#endif
-						}
-					}
-				}
-		Start();
-		}
-	
-	}
-//
-// ----------------------------------------------------------
-// CValueObserver::DoCancel()
-// Cancels event listening
-// ----------------------------------------------------------
-// 
-void CValueObserver::DoCancel()
-    {
-    iProperty.Cancel();
-    }
-
-// End of file
--- a/securitydialogs/Autolock/src/AutoLockView.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,269 +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:
-*
-*/
-
-#include <e32std.h>
-#include <eiklabel.h>
-#include <eikfutil.h>
-#include <aknconsts.h>
-#include <akntitle.h>
-#include <avkon.mbg>
-#include <aknview.h>
-#include <aknViewAppUi.h>
-#include <Autolock.rsg>
-#include "autolock.hrh"
-#include <aknlayoutscalable_avkon.cdl.h>
-#include <layoutmetadata.cdl.h>
-#include <AknUtils.h>
-#include "AutolockAppUiPS.h"
-#include "AutoLockModelPS.h"
-#include "AutolockView.h"
-#include "AutolockContainer.h"
-
-
-
-
-// CONSTANTS
-
-const TUid KUidStartUp = { 0x100058F4 };
-const TInt KPhoneAppOrdinalPosition = 1; // used to pull phone app closer to foreground
-
-// ================= MEMBER FUNCTIONS =======================
-//
-// ----------------------------------------------------
-// CAutolockView::ConstructL()
-// Symbian OS default constructor can leave..
-// ----------------------------------------------------
-//
-void CAutolockView::ConstructL()
-	{
-	#if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockView::ConstructL()"));
-    #endif
-    BaseConstructL();
-	}
-// ----------------------------------------------------
-// CAutolockView::~CAutolockView()
-// Destructor
-// ----------------------------------------------------
-//
-CAutolockView::~CAutolockView()
-	{
-	#if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockView::~CAutolockView()"));
-    #endif
-    CAutolockContainer* view = iView;
-    iView = NULL;
-	if (view)
-        {
-		AppUi()->RemoveFromStack(view);
-        }
-	delete view;
-	}
-// ----------------------------------------------------
-// CAutolockView::Id()
-// Returns view Id
-// ----------------------------------------------------
-//
-TUid CAutolockView::Id() const
-    {
-    return KAutoLockViewId;
-    }
-// ----------------------------------------------------
-// CAutolockView::HandleCommandL()
-// Handles user inputs
-// ----------------------------------------------------
-//
-void CAutolockView::HandleCommandL(TInt aCommand)
-    {
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockView::HandleCommandL()"));
-    #endif   
-    AppUi()->HandleCommandL(aCommand);
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockView::HandleCommandL END()"));
-    #endif
-    }
-void CAutolockView::HandleCall(TInt aCommand, TRect &aRect)
-    {
-    	// RDebug::Printf( "%s %s (%u) aCommand=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aCommand );
-    if (iView)
-    	{
-        TRect cr = ClientRect();
-        iView->SetRect( cr );
-    		// RDebug::Printf( "%s %s (%u) got 2 cr=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aCommand );
-        iView->DrawNow( );
-        iView->GiveCoords( aRect );
-			}
-    else
-			{
-			// RDebug::Printf( "%s %s (%u) !iView ???=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iView );
-			}
-    }
-void CAutolockView::MakeVisible(TBool aVisibility)
-    {
-    #if defined(_DEBUG)
-    RDebug::Printf( "%s %s (%u) aVisibility=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aVisibility );
-    #endif   
-    if (iView)
-	iView->MakeVisible( aVisibility );
-    else
-	{
-	#if defined(_DEBUG)
-	RDebug::Printf( "%s %s (%u) !iView ???=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iView );
-	#endif   
-	}
-    #if defined(_DEBUG)
-    RDebug::Printf( "%s %s (%u) aVisibility=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aVisibility );
-    #endif
-    }
-// ----------------------------------------------------
-// CAutolockView::HandleStatusPaneSizeChange()
-// Handles StatusPane Size Change
-// ----------------------------------------------------
-//
-void CAutolockView::HandleStatusPaneSizeChange()
-	{
-	#if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockView::HandleStatusPaneSizeChange()"));
-    #endif
-    if (iView)
-        {
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(AUTOLOCK)CAutolockView::HandleStatusPaneSizeChange() SET RECT"));
-        #endif
-        TRect cr = ClientRect();
-        iView->SetRect( cr );
-        }
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockView::HandleStatusPaneSizeChange() END"));
-    #endif
-	}
-// ----------------------------------------------------
-// CAutolockView::DoActivateL
-// Activates the view
-// ----------------------------------------------------
-//
-void CAutolockView::DoActivateL(const TVwsViewId& /*aPrevViewId*/,TUid aCustomMessageId,const TDesC8& /*aCustomMessage*/)
-	{
-	#if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockView::DoActivateL"));
-    #endif	
-	iView = new(ELeave) CAutolockContainer;
-
-    TRect screen( iAvkonAppUi->ApplicationRect() );
-    TAknLayoutRect applicationWindow;
-    applicationWindow.LayoutRect(screen, AknLayoutScalable_Avkon::application_window(0));
-    TInt mainPaneVariety = 0;
-    if((AknLayoutUtils::PenEnabled()) && !(Layout_Meta_Data::IsLandscapeOrientation()))
-        {//Use main pane without softkey area
-            mainPaneVariety = 5;
-        }
-    else if (Layout_Meta_Data::IsLandscapeOrientation())
-        {
-            mainPaneVariety = 4;
-        }
-    else
-        {
-            mainPaneVariety = 3;
-        }
-
-    
-    
-    TAknLayoutRect mainPane;
-    mainPane.LayoutRect(applicationWindow.Rect(), AknLayoutScalable_Avkon::main_pane(mainPaneVariety));     	
-	iView->ConstructL( mainPane.Rect() );
-    AppUi()->AddToStackL(*this,iView);
-
-    // Message comes from start-up. We need to lock the device.
-    if ( aCustomMessageId == KUidStartUp )
-        {
-        static_cast<CAutolockAppUi*>(AppUi())->Model()->LockSystemL();
-
-        // Set phone app window group to position 2. This is the same position 
-        // as the phone app set is self when it goes to background.
-        TVwsViewId phoneAppId;
-        TApaTaskList taskList( iEikonEnv->WsSession() );
-        User::LeaveIfError( AknDef::GetPhoneIdleViewId(phoneAppId) );
-        const TInt phoneWgId = taskList.FindApp( phoneAppId.iAppUid ).WgId();
-        User::LeaveIfError( iCoeEnv->WsSession().SetWindowGroupOrdinalPosition( phoneWgId, KPhoneAppOrdinalPosition ) );
-        }
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockView::DoActivateL END"));
-    #endif
-    }
-// ----------------------------------------------------
-// CAutolockView::DoDeActivateL
-// Deactivates the view
-// ----------------------------------------------------
-//
-void CAutolockView::DoDeactivate()
-	{
-	#if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockView::DoDeActivateL"));
-    #endif
-    CAutolockContainer* view = iView;
-    iView = NULL;
-	if (view)
-        {
-		AppUi()->RemoveFromStack(view);
-        }
-	delete view;
-    }
-// ----------------------------------------------------
-// CAutolockView::ScreenDeviceChanged()
-// Handles screen layout changes
-// ----------------------------------------------------
-//
-void CAutolockView::ScreenDeviceChanged()
-{
- if (Layout_Meta_Data::IsLandscapeOrientation() && AknLayoutUtils::PenEnabled())
-        {//do not change layout in touch device to conserve battery
-        #if defined(_DEBUG)
-    		RDebug::Print(_L("(AUTOLOCK)CAutolockView::ScreenDeviceChanged(): Do Nothing"));
-    		#endif
-        return;
-        }
-        
- if (iView)
-    {
-    TRect screen( iAvkonAppUi->ApplicationRect() );
-    TAknLayoutRect applicationWindow;
-    applicationWindow.LayoutRect(screen, AknLayoutScalable_Avkon::application_window(0));
-
-    TInt mainPaneVariety = 0;
-    if((AknLayoutUtils::PenEnabled()) && !(Layout_Meta_Data::IsLandscapeOrientation()))
-        {//Use main pane without softkey area
-            mainPaneVariety = 5;
-        }
-    else if (Layout_Meta_Data::IsLandscapeOrientation())
-        {
-            mainPaneVariety = 4;
-        }
-    else
-        {
-            mainPaneVariety = 3;
-        }
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockView::ScreenDeviceChanged() variety: %d"), mainPaneVariety);
-    #endif
-    TAknLayoutRect mainPane;
-    mainPane.LayoutRect(applicationWindow.Rect(), AknLayoutScalable_Avkon::main_pane(mainPaneVariety));     
-    iView->SetRect(mainPane.Rect());        
-    }
-}
-// end of file
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/src/Autolock.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,1767 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 2.1 of the License.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program.  If not, 
+ * see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
+ *
+ * Description:
+ *
+ */
+
+#include <QCoreApplication>
+#include <QKeyEvent>
+#include <QEvent>
+#include <QTimer>
+#include <QMessageBox>
+#include <QSymbianEvent>
+#include <QMainWindow>
+#include <qvaluespacesubscriber.h>
+#include <qvaluespacepublisher.h>
+
+QTM_USE_NAMESPACE
+
+#include <HbIndicator>
+#include <hbdevicemessagebox.h>
+
+#include <lockappclientserver.h>
+
+#include "Autolock.h"
+#include <xqserviceutil.h>
+#include "autolockuseractivityservice.h"
+#include <settingsinternalcrkeys.h>     // CenRep keys
+#include <w32std.h>
+#include <eikenv.h>
+#include <aknsoundsystem.h>
+
+#include <secuisecuritysettings.h>
+#include <secui.h>
+#include <secuisecurityhandler.h>
+#include <etelmm.h>
+#include <rmmcustomapi.h>
+#include <keylockpolicyapi.h>
+#include <qvaluespacesubscriber.h>
+
+#include <hwrmlightdomaincrkeys.h>
+#include <ProfileEngineSDKCRKeys.h>
+#include <e32property.h>
+#include <coreapplicationuisdomainpskeys.h>
+#include "../PubSub/securityuisprivatepskeys.h"
+#include <avkondomainpskeys.h>
+#include <hwrmdomainpskeys.h>
+#include <ctsydomainpskeys.h>
+
+#include <hbdevicedialog.h>
+#include <power_save_display_mode.h>
+
+const TInt KPhoneIndex(0);
+const TInt KTriesToConnectServer(2);
+const TInt KTimeBeforeRetryingServerConnection(50000);
+#define ESecUiTypeLock                  0x00100000
+_LIT( KMmTsyModuleName, "PhoneTsy");
+
+// Constant definitions to control screensaver view types
+static const char *KSnsrViewTypeKey = "view_type";
+enum TSnsrViewType
+    {
+    ESnsrViewTypeInitial = 0, // default initial state, depends on the configuration
+    ESnsrViewTypeActive,
+    ESnsrViewTypeStandby,
+    ESnsrViewTypeDisabled,
+    };
+static const char *KSnsrCmdUnlock = "unlock";
+static const char *KSnsrCmdSwitchLights = "switch_lights";
+static const char *KSnsrCmdSwitchLowPower = "switch_low_power";
+
+Autolock::Autolock(QWidget *parent, Qt::WFlags f) :
+    QWidget(parent, f), mService(NULL)
+    {
+    RDEBUG("start autolock", 0);
+
+    // The very first thing is to define the properties, so that others can use them.
+    TSecurityPolicy readPolicy(ECapabilityReadDeviceData);
+    TSecurityPolicy writePolicy(ECapabilityWriteDeviceData);
+    TInt ret = RProperty::Define(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, RProperty::EInt, readPolicy, writePolicy);
+    RDEBUG("defined KSecurityUIsSecUIOriginatedQuery", ret);
+    ret = RProperty::Define(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, RProperty::EInt, readPolicy, writePolicy);
+    RDEBUG("defined KSecurityUIsQueryRequestCancel", ret);
+    _LIT_SECURITY_POLICY_PASS( KReadPolicy);
+    _LIT_SECURITY_POLICY_C1(KWritePolicy, ECapabilityWriteDeviceData);
+    ret = RProperty::Define(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, RProperty::EInt, KReadPolicy, KWritePolicy);
+    RDEBUG("defined KCoreAppUIsAutolockStatus", ret);
+
+    // This is important: we set the status through a property
+    TInt autolockState;
+    ret = RProperty::Get(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, autolockState);
+    RDEBUG("Get KCoreAppUIsAutolockStatus", ret);
+    RDEBUG("autolockState", autolockState);
+    if (autolockState == EAutolockStatusUninitialized)
+        {
+        autolockState = EAutolockOff; // not-initialized means taht the unlock-query hasn't been displayed. Therefore the device should not stay locked.
+        }
+    ret = RProperty::Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, autolockState); // this might re-set it. That's not bad. It will re-notify all listeners.
+    RDEBUG("Set KCoreAppUIsAutolockStatus", ret);
+
+    ret = RProperty::Define(KPSUidAvkonDomain, KAknKeyguardStatus, RProperty::EInt, TSecurityPolicy(TSecurityPolicy::EAlwaysPass), KWritePolicy);
+    RDEBUG("defined KAknKeyguardStatus", ret);
+
+    ret = RProperty::Define(KPSUidSecurityUIs, KSecurityUIsLockInitiatorUID, RProperty::EInt, TSecurityPolicy(TSecurityPolicy::EAlwaysPass), writePolicy);
+    RDEBUG("defined KSecurityUIsLockInitiatorUID", ret);
+
+    ret = RProperty::Define(KPSUidSecurityUIs, KSecurityUIsLockInitiatorTimeHigh, RProperty::EInt, readPolicy, writePolicy);
+    RDEBUG("defined KSecurityUIsLockInitiatorTimeHigh", ret);
+    ret = RProperty::Define(KPSUidSecurityUIs, KSecurityUIsLockInitiatorTimeLow, RProperty::EInt, readPolicy, writePolicy);
+    RDEBUG("defined KSecurityUIsLockInitiatorTimeLow", ret);
+
+    ret = RProperty::Define(KPSUidSecurityUIs, KSecurityUIsLights, RProperty::EInt, TSecurityPolicy(TSecurityPolicy::EAlwaysPass), TSecurityPolicy(TSecurityPolicy::EAlwaysPass));
+    RDEBUG("defined KAknKeyguardStatus", ret);
+
+    ret = RProperty::Define(KPSUidSecurityUIs, KSecurityUIsDismissDialog, RProperty::EInt, TSecurityPolicy(TSecurityPolicy::EAlwaysPass), TSecurityPolicy(
+            TSecurityPolicy::EAlwaysPass));
+    RDEBUG("defined KSecurityUIsDismissDialog", ret);
+
+    mService = new AutolockService(this);
+
+    /* Adjust the palette */
+#if defined(Q_WS_S60)
+    // this is defined.
+    RDEBUG( "Q_WS_S60", 1 );
+    QPalette p = qApp->palette();
+    QColor color(192,192,192);
+    QColor bg(201,250,250);
+    p.setColor(QPalette::Highlight, color.lighter(200));
+    p.setColor(QPalette::Text, Qt::black);
+    p.setColor(QPalette::Base, bg);
+    p.setColor(QPalette::WindowText, Qt::black);
+    p.setColor(QPalette::Window, bg);
+    p.setColor(QPalette::ButtonText, Qt::black);
+    p.setColor(QPalette::Button, color.lighter(150));
+    p.setColor(QPalette::Link, QColor(240,40,40));
+
+    qApp->setPalette(p);
+#endif
+
+    RDEBUG("connect", 1);
+
+#if defined(Q_WS_X11) || defined(Q_WS_WIN)
+    setFixedSize(QSize(360,640)); // nHD
+#elif defined(Q_WS_S60)
+    // this doesn't work well
+    // showMaximized();
+    showFullScreen();
+#endif
+
+    serviceKeyguard = new AutolockUserActivityService();
+    serviceDevicelock = new AutolockUserActivityService();
+
+    TInt lockValue = 0;
+    TInt lightsTimeout = 0;
+    CRepository* repository = NULL;
+    TInt cRresult = 0;
+    iLockCodeQueryInDisplay = EFalse;
+    Q_UNUSED(cRresult);
+
+		iProcessingEvent = -1;
+    iLockStatusPrev = ELockNotActive;
+    iLockStatus = ELockNotActive;
+    QT_TRAP_THROWING(repository = CRepository::NewL(KCRUidSecuritySettings));
+    cRresult = repository->Get(KSettingsAutolockStatus, lockValue);
+    RDEBUG("KSettingsAutolockStatus", KSettingsAutolockStatus);
+    RDEBUG("cRresult", cRresult);
+    RDEBUG("lockValue", lockValue);
+    iLockStatus = lockValue;
+    // the settings says to lock
+    delete repository;
+
+    adjustInactivityTimers(0);
+
+    QT_TRAP_THROWING(repository = CRepository::NewL(KCRUidProfileEngine));
+    cRresult = repository->Get(KProEngActiveProfile, lightsTimeout);
+    // this value is not used for now
+    delete repository;
+
+    QT_TRAP_THROWING(repository = CRepository::NewL(KCRUidLightSettings));
+    cRresult = repository->Get(KDisplayLightsTimeout, lightsTimeout);
+    // this value is not used for now
+    delete repository;
+
+    // subscribe to settings changes
+    subscriberKSettingsAutolockStatus = new QValueSpaceSubscriber("/KCRUidSecuritySettings/KSettingsAutolockStatus", this);
+    connect(subscriberKSettingsAutolockStatus, SIGNAL(contentsChanged()), this, SLOT(subscriberKSettingsAutolockStatusChanged()));
+    subscriberKSettingsAutoLockTime = new QValueSpaceSubscriber("/KCRUidSecuritySettings/KSettingsAutoLockTime", this);
+    connect(subscriberKSettingsAutoLockTime, SIGNAL(contentsChanged()), this, SLOT(subscriberKSettingsAutoLockTimeChanged()));
+    subscriberKSettingsAutomaticKeyguardTime = new QValueSpaceSubscriber("/KCRUidSecuritySettings/KSettingsAutomaticKeyguardTime", this);
+    connect(subscriberKSettingsAutomaticKeyguardTime, SIGNAL(contentsChanged()), this, SLOT(subscriberKSettingsAutomaticKeyguardTimeChanged()));
+    subscriberKDisplayLightsTimeout = new QValueSpaceSubscriber("/KCRUidLightSettings/KDisplayLightsTimeout", this);
+    connect(subscriberKDisplayLightsTimeout, SIGNAL(contentsChanged()), this, SLOT(subscriberKDisplayLightsTimeoutChanged()));
+    subscriberKProEngActiveProfile = new QValueSpaceSubscriber("/KCRUidProfileEngine/KProEngActiveProfile", this);
+    connect(subscriberKProEngActiveProfile, SIGNAL(contentsChanged()), this, SLOT(subscriberKProEngActiveProfileChanged()));
+
+    subscriberKSecurityUIsDismissDialog = new QValueSpaceSubscriber("/KPSUidSecurityUIs/KSecurityUIsDismissDialog", this);
+    connect(subscriberKSecurityUIsDismissDialog, SIGNAL(contentsChanged()), this, SLOT(subscriberKSecurityUIsDismissDialogChanged()));
+
+    // subscribe to environment changes
+    subscriberKHWRMGripStatus = new QValueSpaceSubscriber("/KPSUidHWRM/KHWRMGripStatus");
+    connect(subscriberKHWRMGripStatus, SIGNAL(contentsChanged()), this, SLOT(subscriberKHWRMGripStatusChanged()));
+
+    subscriberKAknKeyguardStatus = new QValueSpaceSubscriber("/KPSUidAvkonDomain/KAknKeyguardStatus");
+    connect(subscriberKAknKeyguardStatus, SIGNAL(contentsChanged()), this, SLOT(subscriberKAknKeyguardStatusChanged()));
+
+    subscriberKCoreAppUIsAutolockStatus = new QValueSpaceSubscriber("/KPSUidCoreApplicationUIs/KCoreAppUIsAutolockStatus");
+    connect(subscriberKCoreAppUIsAutolockStatus, SIGNAL(contentsChanged()), this, SLOT(subscriberKCoreAppUIsAutolockStatusChanged()));
+
+    subscriberKCTsyCallState = new QValueSpaceSubscriber("/KPSUidCtsyCallInformation/KCTsyCallState");
+    connect(subscriberKCTsyCallState, SIGNAL(contentsChanged()), this, SLOT(subscriberKCTsyCallStateChanged()));
+
+    // inactivity
+    connect(serviceKeyguard, SIGNAL(active()), this, SLOT(activeKeyguard()));
+    connect(serviceKeyguard, SIGNAL(notActive()), this, SLOT(notActiveKeyguard()));
+    connect(serviceDevicelock, SIGNAL(active()), this, SLOT(activeDevicelock()));
+    connect(serviceDevicelock, SIGNAL(notActive()), this, SLOT(notActiveDevicelock()));
+
+    RWindowGroup& groupWin = CEikonEnv::Static()->RootWin();
+    RDEBUG("got groupWin", 1);
+    // if I want to release, I should do:   mKeyCaptureHandle = env->RootWin().CaptureKey(EKeyBackspace, 0, 0);
+    mEKeyDeviceFCaptureHandle = groupWin.CaptureKey(EKeyDeviceF, 0, 0);
+    RDEBUG("mEKeyDeviceFCaptureHandle", mEKeyDeviceFCaptureHandle);
+    mEKeyBellCaptureHandle = groupWin.CaptureKey(EKeyBell, 0, 0);
+    RDEBUG("mEKeyBellCaptureHandle", mEKeyBellCaptureHandle);
+    RDEBUG("got mKeyCaptureHandle", 1);
+
+    iSecQueryUiCreated = -1;
+    iDeviceDialogCreated = EDeviceDialogUninitialized;
+    RDEBUG("new iDeviceDialogCreated", iDeviceDialogCreated);
+    iDeviceDialog = NULL;
+    // for now, always starts unlocked. This is correct because if locked, the unlock-query (from starter) is on top
+    // TryChangeStatus(iLockStatus);
+    TryChangeStatus( ELockNotActive);
+    lower();
+    hide();
+
+    iDeviceDialog = new HbDeviceDialog(HbDeviceDialog::NoFlags, this);
+    connect(iDeviceDialog, SIGNAL(dataReceived(QVariantMap)), SLOT(handleMessageFromScreensaver(QVariantMap)));
+    connect(iDeviceDialog, SIGNAL(deviceDialogClosed()), SLOT(handleScreensaverClosed()));
+
+    // screensaver standby mode timer
+    mScreensaverModeTimer = new QTimer(this);
+    mScreensaverModeTimer->setInterval(5 * 1000); // milliseconds, TODO: read from cenrep
+    connect(mScreensaverModeTimer, SIGNAL(timeout()), SLOT(switchScreensaverToPowerSaveMode()));
+    // screensaver AMOLED low power mode support
+    mScreensaverPowerSave = CPowerSaveDisplayMode::NewL();
+    mScreensaverPowerSavePixelBuffer = HBufC16::NewL(360 * 640);
+    mScreensaverPowerSavePixelBuffer->Des().Fill(0);
+    }
+
+Autolock::~Autolock()
+    {
+    RDEBUG("0", 0);
+    delete mService;
+    delete mScreensaverPowerSave;
+    delete mScreensaverPowerSavePixelBuffer;
+    RDEBUG("1", 1);
+    }
+
+void Autolock::adjustInactivityTimers(int aReason)
+    {
+    RDEBUG("aReason", aReason);
+    TInt keyguardTime = 0;
+    TInt lockTime = 0;
+    CRepository* repository = NULL;
+    TInt cRresult = 0;
+    Q_UNUSED(cRresult);
+
+    QT_TRAP_THROWING(repository = CRepository::NewL(KCRUidSecuritySettings));
+    cRresult = repository->Get(KSettingsAutomaticKeyguardTime, keyguardTime); // in seconds
+    RDEBUG("KSettingsAutomaticKeyguardTime", KSettingsAutomaticKeyguardTime);
+    RDEBUG("cRresult", cRresult);
+    RDEBUG("keyguardTime", keyguardTime);
+    if (keyguardTime > 0 && keyguardTime < 1000)
+        {
+        serviceKeyguard->setInactivityPeriod(keyguardTime);
+        }
+    else
+        {
+        serviceKeyguard->setInactivityPeriod(12 * 31 * 24 * 60 * 60);
+        }
+
+    cRresult = repository->Get(KSettingsAutoLockTime, lockTime); // in minutes, handled internally as seconds
+    lockTime *= 60;
+    RDEBUG("KSettingsAutoLockTime", KSettingsAutoLockTime);
+    RDEBUG("cRresult", cRresult);
+    RDEBUG("lockTime", lockTime);
+    if (lockTime == 65535 * 60) // Special setting "lock at same time as keyguard" at CpDeviceLockPluginView::GetAutoLockIndex which uses this magic number
+        lockTime = keyguardTime - 2; // lock 2 seconds before before, to avoid keyguard->devicelock sequence
+    if (lockTime > 60 && lockTime < 24 * 60 * 60) // lock timer can't be bigger than 1 day
+        {
+        serviceDevicelock->setInactivityPeriod(lockTime);
+        }
+    else
+        {
+        serviceDevicelock->setInactivityPeriod(12 * 31 * 24 * 60 * 60); // 0x1ea6e00
+        }
+
+    delete repository;
+    }
+void Autolock::quit()
+    {
+    RDEBUG("0", 0);
+    qApp->quit();
+    }
+
+int Autolock::AskValidSecCode(int aReason)
+    {
+    RDEBUG("aReason", aReason);
+    RMobilePhone iPhone; // NULL in emulator
+
+#ifdef __WINS__1
+    return KErrNone;
+#endif
+
+    TInt err(KErrGeneral);
+    Q_UNUSED(err);
+    TBool validCode(EFalse);
+    TInt thisTry(0);
+    RTelServer iTelServer;
+
+    err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsLights, ESecurityUIsLightsQueryOnRequest);
+    RDEBUG("KSecurityUIsLights err", err);
+
+    RMmCustomAPI iCustomPhone;
+    while ((err = iTelServer.Connect()) != KErrNone && (thisTry++) <= KTriesToConnectServer)
+        {
+        User::After( KTimeBeforeRetryingServerConnection);
+        }
+    err = iTelServer.LoadPhoneModule(KMmTsyModuleName);
+    RTelServer::TPhoneInfo PhoneInfo;
+    RDEBUG("LoadPhoneModule err", err);
+    err = iTelServer.SetExtendedErrorGranularity(RTelServer::EErrorExtended);
+    RDEBUG("SetExtendedErrorGranularity err", err);
+    err = iTelServer.GetPhoneInfo(KPhoneIndex, PhoneInfo);
+    RDEBUG("GetPhoneInfo err", err);
+    err = iPhone.Open(iTelServer, PhoneInfo.iName);
+    RDEBUG("Open err", err);
+    err = iCustomPhone.Open(iPhone);
+    RDEBUG("Open2 err", err);
+
+    RDEBUG("CSecurityHandler", 0);
+    CSecurityHandler* handler = new (ELeave) CSecurityHandler(iPhone);
+    if (aReason == ELockAppDisableDevicelock)
+        {
+        RDEBUG("calling AskSecCodeInAutoLockL", 0);
+        iLockCodeQueryInDisplay = ETrue;
+        QT_TRAP_THROWING(validCode = handler->AskSecCodeInAutoLockL()); // this returns true/false
+        iLockCodeQueryInDisplay = EFalse;
+        // TODO should this also do iPhone.SetLockSetting(status, lockType, lockChange); ???
+        }
+    else if (aReason == ELockAppEnableDevicelock)
+        {
+        // check whether code is really needed
+        RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockPhoneDevice;
+        RMobilePhone::TMobilePhoneLockInfoV1 lockInfo;
+        RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo);
+        RMobilePhone::TMobilePhoneLockSetting lockChange(RMobilePhone::ELockSetDisabled);
+        TRequestStatus status = KRequestPending;
+        TInt ret = KErrNone;
+        RDEBUG("GetLockInfo", 0);
+        iPhone.GetLockInfo(status, lockType, lockInfoPkg);
+        RDEBUG("WaitForRequest", 0);
+        User::WaitForRequest(status);
+        ret = status.Int();
+        RDEBUG("WaitForRequest ret", ret);
+#ifdef __WINS__
+        if (ret == KErrTimedOut)
+            {
+            ret = KErrNone;
+            lockInfo.iSetting = RMobilePhone::ELockSetDisabled; // ask password only if there's no timeout.
+            }
+#endif
+        if (ret == KErrNone)
+            {
+            RDEBUG("lockInfo.iSetting", lockInfo.iSetting);
+            RDEBUG("RMobilePhone::ELockSetDisabled",
+                    RMobilePhone::ELockSetDisabled);
+            if (lockInfo.iSetting == RMobilePhone::ELockSetDisabled) // ask password only if there's no timeout
+                {
+                lockChange = RMobilePhone::ELockSetEnabled;
+                RDEBUG("SetLockSetting lockChange", lockChange);
+#define OLD_METHODx
+#ifdef OLD_METHOD
+                status = KRequestPending;
+                RDEBUG( "SetLockSetting", 0 );
+                iPhone.SetLockSetting(status, lockType, lockChange); // ask for PassPhraseRequiredL
+                RDEBUG( "WaitForRequestL", 0 );
+                User::WaitForRequest( status ); // TODO this waits 33 seconds in WINS and returns ffffffdf = KErrTimedOut
+                ret = status.Int();
+                RDEBUG( "WaitForRequestL ret", ret );
+#else
+                RDEBUG("! OLD_METHOD", 0);
+                CWait *iWait = NULL;
+                QT_TRAP_THROWING(iWait = CWait::NewL());
+                iWait->SetRequestType(EMobilePhoneSetLockSetting);
+                iPhone.SetLockSetting(iWait->iStatus, lockType, lockChange); // ask for PassPhraseRequiredL
+                RDEBUG("WaitForRequestL", 0);
+                QT_TRAP_THROWING(ret = iWait->WaitForRequestL());
+                RDEBUG("WaitForRequestL ret", ret);
+                if (iWait)
+                    {
+                    RDEBUG("IsActive", 0);
+                    if (iWait->IsActive())
+                        {
+                        RDEBUG("CancelAsyncRequest", 0);
+                        iPhone.CancelAsyncRequest(iWait->GetRequestType());
+                        RDEBUG("cancelled", 0);
+                        }
+                    }
+                delete iWait;
+#endif
+
+                RDEBUG("WaitForRequestL ret", ret);
+#ifdef __WINS__
+                if (ret == KErrTimedOut)
+                    ret = KErrNone;
+#endif
+                if (ret == KErrNone)
+                    validCode = 1;
+                else
+                    validCode = 0;
+                }
+            else
+                {
+                RDEBUG("RMobilePhone::ELockSetEnabled", RMobilePhone::ELockSetEnabled);
+                RDEBUG("lockInfo.iSetting = RMobilePhone::ELockSetEnabled", RMobilePhone::ELockSetEnabled);
+                validCode = 0x20;
+                }
+            }
+        else
+            {
+            RDEBUG("Error: ret", ret);
+            validCode = 0x21;
+            }
+
+        /* Alternative way to ask for password
+         RMobilePhone::TMobilePhoneSecurityEvent iEvent;
+         TInt result = KErrNone;
+         iEvent = RMobilePhone::EPhonePasswordRequired;
+         RDEBUG( "calling HandleEventL", 0 );
+         handler->HandleEventL(iEvent, result); // this is supposed to wait
+         validCode = false;
+         if(result)
+         validCode = true;
+         RDEBUG( "result", result );
+         */
+        }
+    RDEBUG("validCode", validCode);
+    if (validCode > 0)
+        return KErrNone;
+
+    // no valid code -> switch off the lights
+    err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsLights, ESecurityUIsLightsLockOffRequest);
+    RDEBUG("KSecurityUIsLights err", err);
+    return KErrCancel;
+    }
+
+void Autolock::handleAnswerDelivered()
+    {
+    RDEBUG("0", 0);
+    // quit();
+
+    }
+
+void Autolock::setLabelNumber(QString label, QString number)
+    {
+    RDEBUG("0", 0);
+    }
+
+void Autolock::DebugRequest(int aReason)
+    {
+    switch (aReason)
+        {
+        case ELockAppEnableKeyguard:
+            RDEBUG("ELockAppEnableKeyguard", aReason)
+            ;
+            break;
+        case ELockAppDisableKeyguard:
+            RDEBUG("ELockAppDisableKeyguard", aReason)
+            ;
+            break;
+        case ELockAppEnableDevicelock:
+            RDEBUG("ELockAppEnableDevicelock", aReason)
+            ;
+            break;
+        case ELockAppDisableDevicelock:
+            RDEBUG("ELockAppDisableDevicelock", aReason)
+            ;
+            break;
+        case ELockAppOfferKeyguard:
+            RDEBUG("ELockAppOfferKeyguard", aReason)
+            ;
+            break;
+        case ELockAppOfferDevicelock:
+            RDEBUG("ELockAppOfferDevicelock", aReason)
+            ;
+            break;
+        case ELockAppShowKeysLockedNote:
+            RDEBUG("ELockAppShowKeysLockedNote", aReason)
+            ;
+            break;
+        default:
+            RDEBUG("default", aReason)
+            ;
+            break;
+        }
+    }
+void Autolock::DebugStatus(int aReason)
+    {
+    switch (aReason)
+        {
+        case ELockNotActive:
+            RDEBUG("ELockNotActive", aReason)
+            ;
+            break;
+        case EKeyguardActive:
+            RDEBUG("EKeyguardActive", aReason)
+            ;
+            break;
+        case EDevicelockActive:
+            RDEBUG("EDevicelockActive", aReason)
+            ;
+            break;
+        default:
+            RDEBUG("default", aReason)
+            ;
+            break;
+        }
+    }
+void Autolock::DebugError(int aReason)
+    {
+    switch (aReason)
+        {
+        case KErrNone:
+            RDEBUG("KErrNone", aReason)
+            ;
+            break;
+        case KErrPermissionDenied: // caller doesn't have enough capabilities
+            RDEBUG("KErrPermissionDenied", aReason)
+            ;
+            break;
+        case KErrAlreadyExists: // this particular lock is already enabled
+            RDEBUG("KErrAlreadyExists", aReason)
+            ;
+            break;
+        case KErrInUse: // the dialog is already shown
+            RDEBUG("KErrInUse", aReason)
+            ;
+            break;
+        default:
+            RDEBUG("default", aReason)
+            ;
+            break;
+        }
+    }
+
+int Autolock::CheckIfLegal(int aReason)
+    {
+    RDEBUG("aReason", aReason);
+    // check whether a dialog is already displayed. This is to prevent timeout-lock and timeout-keyguard activated on top of a PIN query, in particular at boot-up (TODO check for Starter)
+    TInt secUiOriginatedQuery(ESecurityUIsSecUIOriginatedUninitialized);
+    TInt err = RProperty::Get(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, secUiOriginatedQuery);
+    RDEBUG("err", err);
+    RDEBUG("secUiOriginatedQuery", secUiOriginatedQuery);
+    switch (aReason)
+        {
+        case ELockAppEnableKeyguard:
+            {
+            RDEBUG("ELockAppEnableKeyguard iLockStatus", iLockStatus);
+            if (secUiOriginatedQuery != ESecurityUIsSecUIOriginatedUninitialized)
+                return KErrInUse; // PIN on top. Don't keyguard
+            switch (iLockStatus)
+                {
+                case ELockNotActive:
+                    if (!CKeyLockPolicyApi::KeyguardAllowed())
+                        return KErrPermissionDenied;
+                    else
+                        return KErrNone;
+                case EKeyguardActive:
+                    return KErrAlreadyExists;
+                case EDevicelockActive:
+                    return KErrPermissionDenied;
+                }
+            }
+            break;
+        case ELockAppDisableKeyguard:
+            {
+            RDEBUG("ELockAppDisableKeyguard iLockStatus", iLockStatus);
+            // no matter whether PIN is displayed
+            switch (iLockStatus)
+                {
+                case ELockNotActive:
+                    return KErrAlreadyExists;
+                case EKeyguardActive:
+                    return KErrNone;
+                case EDevicelockActive:
+                    return KErrPermissionDenied;
+                }
+            }
+            break;
+        case ELockAppEnableDevicelock:
+            {
+            RDEBUG("ELockAppEnableDevicelock iLockStatus", iLockStatus);
+            if (secUiOriginatedQuery != ESecurityUIsSecUIOriginatedUninitialized && secUiOriginatedQuery != ESecurityUIsSystemLockOriginated)
+                return KErrInUse; // PIN on top. Don't devicelock
+            switch (iLockStatus)
+                {
+                case ELockNotActive:
+                    return KErrNone;
+                case EKeyguardActive:
+                    return KErrNone;
+                case EDevicelockActive:
+                    return KErrAlreadyExists;
+                }
+            }
+            break;
+        case ELockAppDisableDevicelock:
+            {
+            RDEBUG("ELockAppDisableDevicelock iLockStatus", iLockStatus);
+            if (iLockCodeQueryInDisplay)
+                {
+                // PIN on top and trying to display unlock-code. This is valid
+                return KErrAlreadyExists;
+                }
+            switch (iLockStatus)
+                {
+                case ELockNotActive:
+                    return KErrAlreadyExists;
+                case EKeyguardActive:
+                    return KErrPermissionDenied;
+                case EDevicelockActive:
+                    return KErrNone;
+                }
+            }
+            break;
+        case ELockAppOfferKeyguard:
+            {
+            RDEBUG("ELockAppOfferKeyguard iLockStatus", iLockStatus);
+            if (secUiOriginatedQuery != ESecurityUIsSecUIOriginatedUninitialized && secUiOriginatedQuery != ESecurityUIsSystemLockOriginated)
+                return KErrInUse; // PIN on top. Don't offer
+            switch (iLockStatus)
+                {
+                case ELockNotActive:
+                    return KErrNone;
+                case EKeyguardActive:
+                    return KErrPermissionDenied;
+                case EDevicelockActive:
+                    return KErrPermissionDenied;
+                }
+            }
+            break;
+        case ELockAppOfferDevicelock:
+            {
+            RDEBUG("ELockAppOfferDevicelock iLockStatus", iLockStatus);
+            if (secUiOriginatedQuery != ESecurityUIsSecUIOriginatedUninitialized && secUiOriginatedQuery != ESecurityUIsSystemLockOriginated)
+                return KErrInUse; // PIN on top. Don't offer
+            switch (iLockStatus)
+                {
+                case ELockNotActive:
+                    return KErrNone;
+                case EKeyguardActive:
+                    return KErrNone;
+                case EDevicelockActive:
+                    return KErrAlreadyExists;
+                }
+            }
+            break;
+        case ELockAppShowKeysLockedNote:
+            {
+            RDEBUG("ELockAppShowKeysLockedNote iLockStatus", iLockStatus);
+            if (secUiOriginatedQuery != ESecurityUIsSecUIOriginatedUninitialized && secUiOriginatedQuery != ESecurityUIsSystemLockOriginated)
+                return KErrInUse; // PIN on top. Don't display
+            switch (iLockStatus)
+                {
+                case ELockNotActive:
+                    return KErrPermissionDenied;
+                case EKeyguardActive:
+                    return KErrNone;
+                case EDevicelockActive: // TODO confirm this. CMMKeyBearer::ReceivedKeyEvent expects KErrNone if keypad is locked
+                    return KErrPermissionDenied;
+                }
+            }
+            break;
+        default:
+            {
+            RDEBUG("default iLockStatus", iLockStatus);
+            return KErrPermissionDenied;
+            }
+            // break;
+        } // switch
+    return KErrPermissionDenied;
+    }
+
+int Autolock::publishStatus(int aReason)
+    {
+    RDEBUG("aReason", aReason);
+    Q_UNUSED(aReason);
+    TInt err = KErrNone;
+    Q_UNUSED(err);
+    // can't use include file because it's private file. However it gives permissions
+    const TUid KCRUidCoreApplicationUIsSysAp =
+        {
+        0x101F8765
+        };
+    const TUint32 KSysApKeyguardActive = 0x00000001;
+    CRepository* repositoryDevicelock = NULL;
+    CRepository* repositoryKeyguard = NULL;
+    QT_TRAP_THROWING(repositoryDevicelock = CRepository::NewL(KCRUidSecuritySettings));
+    QT_TRAP_THROWING(repositoryKeyguard = CRepository::NewL(KCRUidCoreApplicationUIsSysAp));
+    TInt cRresult = KErrNone;
+    Q_UNUSED(cRresult);
+    if (1 == 1) // this is a quick way to disable this functionality, for testing
+        {
+        RDEBUG("publishing", aReason);
+        if (aReason == ELockNotActive)
+            {
+            err = RProperty::Set(KPSUidAvkonDomain, KAknKeyguardStatus, EKeyguardNotActive);
+            RDEBUG("err", err);
+            err = RProperty::Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, EAutolockOff);
+            RDEBUG("err", err);
+            err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsLights, ESecurityUIsLightsLockOnRequest); // lights are required
+            RDEBUG("KSecurityUIsLights err", err);
+
+            // cRresult = repositoryDevicelock->Set(KSettingsAutolockStatus, 0);    // the settings remains. Only ISA changes, as well as the P&S
+            cRresult = repositoryKeyguard->Set(KSysApKeyguardActive, 0);
+            RDEBUG("cRresult", cRresult);
+            }
+        if (1 == 1) // this is a quick way to disable this functionality, for testing
+            {
+            if (aReason == EKeyguardActive)
+                {
+                err = RProperty::Set(KPSUidAvkonDomain, KAknKeyguardStatus, EKeyguardLocked);
+                RDEBUG("KAknKeyguardStatus err", err);
+                err = RProperty::Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, EAutolockOff);
+                RDEBUG("KCoreAppUIsAutolockStatus err", err);
+                err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsLights, ESecurityUIsLightsLockOffRequest); // same for keyguard and devicelock
+                RDEBUG("KSecurityUIsLights err", err);
+                // cRresult = repositoryDevicelock->Set(KSettingsAutolockStatus, 0);
+                cRresult = repositoryKeyguard->Set(KSysApKeyguardActive, 1);
+                RDEBUG("cRresult", cRresult);
+                }
+            else if (aReason >= EDevicelockActive)
+                {
+                err = RProperty::Set(KPSUidAvkonDomain, KAknKeyguardStatus, EKeyguardAutolockEmulation); // Other candidates might be: EKeyguardLocked and EKeyguardNotActive
+                RDEBUG("KAknKeyguardStatus err", err);
+                err = RProperty::Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, EManualLocked);
+                RDEBUG("KCoreAppUIsAutolockStatus err", err);
+                err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsLights, ESecurityUIsLightsLockOffRequest);
+                RDEBUG(" KSecurityUIsLights err", err);
+                // cRresult = repositoryDevicelock->Set(KSettingsAutolockStatus, 1);
+                cRresult = repositoryKeyguard->Set(KSysApKeyguardActive, 0); // keyguard disabled, so that user can type and DeviceF can be captured
+                RDEBUG("cRresult", cRresult);
+                }
+            }
+        }
+    delete repositoryDevicelock;
+    delete repositoryKeyguard;
+    // this is the real point where everything is done.
+    iLockStatusPrev = iLockStatus;
+    iLockStatus = aReason;
+    RDEBUG("setting iLockStatus", iLockStatus);
+    return KErrNone;
+    }
+/********************/
+int Autolock::showNoteIfRequested(int aReason)
+    {
+    RDEBUG("aReason", aReason);
+    // The notes are displayed. This is useful only for the API withNote, and ELockAppShowKeysLockedNote
+    // However, it has some inconvenients:
+    // - the screensaver already displays/hides
+    // - the notes are shown behing the icon because they have lower priorities
+    // - they are annoying
+    // TODO translate
+    if (aReason == ELockNotActive)
+        {
+        if (iShowKeyguardNote == 1)
+            {
+            HbDeviceMessageBox::information("Keyguard deactivated");
+            }
+        }
+    else if (aReason == EKeyguardActive)
+        {
+        if (iShowKeyguardNote == 1)
+            {
+            HbDeviceMessageBox::information("Keyguard activated");
+            // this already waits a bit because the lock-icon takes some time to display. So the note is visible before the lock-icon.
+            }
+        }
+    else if (aReason >= EDevicelockActive) // this doesn't happen, but we are prepared nevertheless
+        {
+        if (iShowKeyguardNote == 1)
+            {
+            HbDeviceMessageBox::information("Devicelock activated");
+            }
+        }
+    return KErrNone;
+    }
+/***********************/
+int Autolock::TryChangeStatus(int aReason)
+    {
+    RDEBUG("aReason", aReason);
+    int ret = aReason;
+    int errorInProcess = KErrNone;
+    DebugRequest(ret);
+
+    // this will cancel any previous dialog, i.e. PIN query, or any previous code-request.
+    // not sure about the screensaver, but nevertheless will be cancelled when the status is changed.
+    TInt err = KErrNone;
+    Q_UNUSED(err);
+    RDEBUG("Not setting KSecurityUIsDismissDialog ESecurityUIsDismissDialogOn", ESecurityUIsDismissDialogOn);
+    //// err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsDismissDialog, ESecurityUIsDismissDialogOn);
+    RDEBUG("err", err);
+    switch (ret)
+        {
+        case ELockAppEnableKeyguard: // 1
+            {
+            errorInProcess = CheckIfLegal(ret);
+            DebugError(errorInProcess);
+            if (errorInProcess == KErrNone)
+                {
+                showNoteIfRequested( EKeyguardActive);
+                setLabelIcon(EKeyguardActive);
+                updateIndicator(EKeyguardActive);
+                publishStatus(EKeyguardActive);
+                setLockDialog(aReason, 1);
+                }
+            }
+            break;
+        case ELockAppDisableKeyguard: // 2
+            {
+            errorInProcess = CheckIfLegal(ret);
+            DebugError(errorInProcess);
+            if (errorInProcess == KErrNone)
+                {
+                showNoteIfRequested( ELockNotActive);
+                setLabelIcon(ELockNotActive);
+                updateIndicator(ELockNotActive);
+                publishStatus(ELockNotActive);
+                setLockDialog(aReason, 0);
+                }
+            }
+            break;
+        case ELockAppEnableDevicelock: // 3
+            {
+            errorInProcess = CheckIfLegal(ret);
+            DebugError(errorInProcess);
+            if (errorInProcess == KErrNone)
+                {
+                if (!callerHasECapabilityWriteDeviceData) // check permissions for calling process, because doesn't AskValidSecCode
+                    errorInProcess = KErrPermissionDenied;
+                DebugError(errorInProcess);
+                }
+            if (errorInProcess == KErrNone)
+                {
+                updateIndicator( EDevicelockActive);
+                publishStatus(EDevicelockActive);
+                setLabelIcon(EDevicelockActive);
+                setLockDialog(aReason, 1);
+                }
+            // aParam1 is aReason : EDevicelockManual, EDevicelockRemote
+            // this never shows a note
+            }
+            break;
+        case ELockAppDisableDevicelock: // 4
+            {
+            errorInProcess = CheckIfLegal(ret);
+            DebugError(errorInProcess);
+            if (errorInProcess == KErrNone)
+                {
+                if (!callerHasECapabilityWriteDeviceData) // check permissions for calling process, because doesn't AskValidSecCode
+                    errorInProcess = KErrPermissionDenied;
+                DebugError(errorInProcess);
+                }
+            if (errorInProcess == KErrNone)
+                {
+                setLockDialog(aReason, 0); // hide temporarilly because HbDeviceMessageBox doesn't get in top of the Lock-icon. Thus, dismiss it.
+                // do I need to enable touch? it seems to work without it
+                // in any case, lights are needed
+                err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsLights, ESecurityUIsLightsQueryOnRequest);
+                RDEBUG("calling HbDeviceMessageBox::question", 0);
+                bool value = true;
+                // not sure whether this question is really needed. The UI doesn't say anything, so I remove it for now.
+                // HbDeviceMessageBox::question("Disable Lock?");   // this doesn't block other events, so after return everything might be messed up.
+                RDEBUG("value", value);
+                if (!value)
+                    errorInProcess = KErrCancel;
+                }
+            if (errorInProcess == KErrNone)
+                {
+                setLockDialog(aReason, 0); // hide temporarilly because AskValidSecCode doesn't get in top of the Lock-icon. Thus, dismiss it.
+                RDEBUG("calling AskValidSecCode", 0);
+                errorInProcess = AskValidSecCode(ELockAppDisableDevicelock);
+                RDEBUG("errorInProcess", errorInProcess);
+                }
+            if (errorInProcess == KErrNone)
+                {
+                setLabelIcon( ELockNotActive);
+                updateIndicator(ELockNotActive);
+                setLockDialog(aReason, 0);
+                publishStatus(ELockNotActive);
+                }
+            if (errorInProcess != KErrNone)
+                { // re-lock. For example, if password is wrong
+                if (iLockStatus >= EDevicelockActive) // this skips the case "unlocking although it wasn't locked"
+                    setLockDialog(ELockAppEnableDevicelock, 1);
+                }
+            // this never shows a note
+            }
+            break;
+        case ELockAppOfferKeyguard: // 5
+            {
+            errorInProcess = CheckIfLegal(ret);
+            DebugError(errorInProcess);
+            if (errorInProcess == KErrNone)
+                {
+                // no need to dismiss screensaver, because it's not active
+                // what about any PIN-query, i.e. from settings ? In this case, the query will show after the PIN query is finished. somehow this is good because PIN is more important
+                bool value = HbDeviceMessageBox::question("Enable Keyguard?"); // this doesn't block other events, so after return everything might be messed up.
+                // what about a nice icon?
+                RDEBUG("value", value);
+                if (!value)
+                    errorInProcess = KErrCancel;
+                }
+            if (errorInProcess == KErrNone)
+                {
+                errorInProcess = TryChangeStatus(ELockAppEnableKeyguard);
+                }
+            // this never shows a note
+            }
+            break;
+        case ELockAppOfferDevicelock: // 6
+            {
+            errorInProcess = CheckIfLegal(ret);
+            DebugError(errorInProcess);
+            if (errorInProcess == KErrNone)
+                {
+                setLockDialog(aReason, 0); // hide temporarilly because AskValidSecCode doesn't get in top of the Lock-icon. Thus, dismiss it.
+                errorInProcess = AskValidSecCode(ELockAppEnableDevicelock);
+                }
+            if (errorInProcess == KErrNone)
+                {
+                RDEBUG("ELockAppOfferDevicelock calling ELockAppEnableDevicelock", ELockAppEnableDevicelock);
+                errorInProcess = TryChangeStatus(ELockAppEnableDevicelock);
+                }
+            // this never shows a note. Perhaps ELockAppEnableDevicelock does.
+            }
+            break;
+        case ELockAppShowKeysLockedNote: // 7
+            {
+            errorInProcess = CheckIfLegal(ret); // it will not be legal if the keyguard is not enabled and the devicelock is not enabled.
+            DebugError(errorInProcess);
+            if (errorInProcess == KErrNone)
+                {
+                iShowKeyguardNote = 1; // this is not sent as parameter, so we need to fake it: ON
+                showNoteIfRequested( EKeyguardActive);
+                }
+            }
+            break;
+        default:
+            {
+            RDEBUG("default", ret);
+            errorInProcess = KErrNotSupported;
+            }
+            break;
+
+        }
+    return errorInProcess;
+    }
+/**************************/
+int Autolock::setLockDialog(int aReason, int status)
+    {
+    RDEBUG("aReason", aReason);
+    RDEBUG("status", status);
+    RDEBUG("iDeviceDialogCreated", iDeviceDialogCreated);
+    TInt secUiOriginatedQuery(ESecurityUIsSecUIOriginatedUninitialized);
+    TInt err = RProperty::Get(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, secUiOriginatedQuery);
+    RDEBUG("err", err);
+    RDEBUG("secUiOriginatedQuery", secUiOriginatedQuery);
+
+    RWindowGroup& groupWin = CEikonEnv::Static()->RootWin();
+
+    if (status == 0) // hide
+        {
+        // aReason is not important here, but let's check nevertheless
+        RDEBUG("ReleaseContext", R_AVKON_DEFAULT_SKEY_LIST);
+        static_cast<CAknAppUi*>(CEikonEnv::Static()->EikAppUi())->KeySounds()->ReleaseContext();
+        RDEBUG("PopContext", 0x90);
+        static_cast<CAknAppUi*>(CEikonEnv::Static()->EikAppUi())->KeySounds()->PopContext();
+        RDEBUG("ReleaseContext done", 0x92);
+
+        if (aReason != ELockAppDisableKeyguard && aReason != ELockAppDisableDevicelock)
+            {
+            RDEBUG("!!!!****!!!!! error. status=0 but aReason", aReason);
+            }
+        // secUiOriginatedQuery should be ESecurityUIsSystemLockOriginated . If not, this is not correctly setting it
+        if (iDeviceDialogCreated >= EDeviceDialogCreated)
+            {
+            iDeviceDialogCreated = EDeviceDialogDestroyed;
+            RDEBUG("new iDeviceDialogCreated", iDeviceDialogCreated);
+
+            RDEBUG("calling switchScreensaverMode", ESnsrViewTypeDisabled);
+            switchScreensaverMode( ESnsrViewTypeDisabled);
+
+            disconnect(iDeviceDialog, SIGNAL(dataReceived(QVariantMap)), this, SLOT(handleMessageFromScreensaver(QVariantMap)));
+            disconnect(iDeviceDialog, SIGNAL(deviceDialogClosed()), this, SLOT(handleScreensaverClosed()));
+            RDEBUG("signal disconnected", err);
+            // TODO this crashes for EDeviceDialogScreenSaver
+            err = iDeviceDialog->cancel();
+            RDEBUG("cancel (bool: 1= wellCancelled) err", err);
+            err = iDeviceDialog->error();
+            RDEBUG("err", err);
+            RDEBUG("calling iDeviceDialog->waitForClosed()", 0);
+            err = iDeviceDialog->waitForClosed();
+            RDEBUG("cancel (bool: 1= well waitForClosed) err", err);
+            err = iDeviceDialog->error();
+            RDEBUG("err", err);
+
+            TInt err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsSecUIOriginatedUninitialized);
+            RDEBUG("reset KSecurityUIsSecUIOriginatedQuery. err", err);
+            // Cancel power key and application key capturing
+            groupWin.CancelCaptureKey(mPowerKeyCaptureHandle);
+            groupWin.CancelCaptureKey(mApplicationKeyCaptureHandle);
+            groupWin.CancelCaptureLongKey(mApplicationLongKeyCaptureHandle);
+            RDEBUG("done CancelCaptureKey", 1);
+            if (mEKeyYesCaptureHandle)
+                {
+                RDEBUG("mEKeyYesCaptureHandle", mEKeyYesCaptureHandle);
+                groupWin.CancelCaptureKey(mEKeyYesCaptureHandle);
+                mEKeyYesCaptureHandle = NULL;
+                }
+            if (mEKeyNoCaptureHandle)
+                {
+                RDEBUG("mEKeyNoCaptureHandle", mEKeyNoCaptureHandle);
+                groupWin.CancelCaptureKey(mEKeyNoCaptureHandle);
+                mEKeyNoCaptureHandle = NULL;
+                }
+
+            RDEBUG("deleting iDeviceDialog", 0);
+            delete iDeviceDialog;
+            RDEBUG("deleted iDeviceDialog", 1);
+            iDeviceDialog = NULL;
+            }
+        }
+    else if (status == 1) // show
+        {
+        RDEBUG("PushContextL", R_AVKON_DEFAULT_SKEY_LIST);
+        static_cast<CAknAppUi*>(CEikonEnv::Static()->EikAppUi())->KeySounds()->PushContextL(R_AVKON_SILENT_SKEY_LIST);
+        RDEBUG("BringToForeground", 0x90);
+        static_cast<CAknAppUi*>(CEikonEnv::Static()->EikAppUi())->KeySounds()->BringToForeground();
+        RDEBUG("LockContext", 0x91);
+        static_cast<CAknAppUi*>(CEikonEnv::Static()->EikAppUi())->KeySounds()->LockContext();
+        RDEBUG("PushContextL Done", 0x92);
+
+        // secUiOriginatedQuery should be ESecurityUIsSecUIOriginatedUninitialized . If not, the validation is not correctly filtering it
+        QVariantMap params;
+        TBool err;
+#define ESecUiTypeDeviceLock        0x00100000
+#define ESecUiTypeKeyguard          0x00200000
+
+        if (aReason == ELockAppEnableKeyguard)
+            params.insert("type", ESecUiTypeKeyguard);
+        else if (aReason == ELockAppEnableDevicelock)
+            params.insert("type", ESecUiTypeDeviceLock);
+        else
+            {
+            RDEBUG("error. status=1 but aReason", aReason);
+            }
+        // no need for title. Icon should be explicit enough
+        // params.insert("title", "Locked");
+        if (iDeviceDialogCreated < EDeviceDialogCreated)
+            {
+            if (iDeviceDialog != NULL)
+                {
+                RDEBUG("!!!!!!*********!!!!!!!! error: iDeviceDialog != NULL", 0);
+                }
+            RDEBUG("creating iDeviceDialog", 0);
+            iDeviceDialog = new HbDeviceDialog(HbDeviceDialog::NoFlags, this);
+            // in theory this is needed only for screensaver, not for LockIcon. But it doesn't harm
+            connect(iDeviceDialog, SIGNAL(dataReceived(QVariantMap)), SLOT(handleMessageFromScreensaver(QVariantMap)));
+            connect(iDeviceDialog, SIGNAL(deviceDialogClosed()), SLOT(handleScreensaverClosed()));
+            iDeviceDialogCreated = EDeviceDialogCreated;
+            RDEBUG("new iDeviceDialogCreated", iDeviceDialogCreated);
+            }
+        else
+            {
+            RDEBUG("raising iDeviceDialog", 0);
+            // confirm that dialog is present
+            err = iDeviceDialog->error();
+            RDEBUG("err", err);
+            iDeviceDialogCreated = EDeviceDialogRaised;
+            RDEBUG("new iDeviceDialogCreated", iDeviceDialogCreated);
+            }
+        const QString KScreensaverDeviceDialog("com.nokia.screensaver.snsrdevicedialogplugin/1.0");
+        RDEBUG("pre show", aReason);
+        bool launchSuccesful = iDeviceDialog->show(KScreensaverDeviceDialog, params); // and continue processing
+        RDEBUG("post show. bool launchSuccesful", launchSuccesful);
+        err = iDeviceDialog->error();
+        RDEBUG("iDeviceDialog->error", err);
+        if (launchSuccesful) // TODO && !error ???
+            {
+            iDeviceDialogCreated = EDeviceDialogScreenSaver;
+            RDEBUG("new iDeviceDialogCreated", iDeviceDialogCreated);
+            // TODO this is needed if creating dialog for first time? switchScreensaverToActiveMode(); // this is needed in case the dialog was existing.
+            // Start standy mode timer. The initial state may already be the standby
+            // mode but setting screensaver again to standby doesn't hurt.
+            mScreensaverModeTimer->start();
+            }
+        else // some err. Usually 3 (not existing)
+            {
+            // screensaver has failed. Probably because it's not installed. Then, try the standard lock-icon
+            iDeviceDialogCreated = EDeviceDialogLockIcon;
+            RDEBUG("new iDeviceDialogCreated", iDeviceDialogCreated);
+            const QString KSecQueryUiDeviceDialog("com.nokia.secuinotificationdialog/1.0");
+            err = iDeviceDialog->show(KSecQueryUiDeviceDialog, params); // and continue processing
+            RDEBUG("post show. err", err);
+            }
+        err = iDeviceDialog->error();
+        RDEBUG("err", err);
+        // This won't be needed when screensaver is in place, as the dialogs will be different, and therefore both can be present
+        // Somehow this should be handled by Orbit, but unfortunatelly they don't allow the same dialog twice
+        err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsSecUIOriginatedUninitialized); // this could also be ESecurityUIsSystemLockOriginated
+        RDEBUG("err", err);
+        // Capture power and application keys while screen saver is open. Also works for LockIcon
+        mPowerKeyCaptureHandle = groupWin.CaptureKey(EKeyDevice2, 0, 0);
+        mApplicationKeyCaptureHandle = groupWin.CaptureKey(EKeyApplication0, 0, 0);
+        mApplicationLongKeyCaptureHandle = groupWin.CaptureLongKey(EKeyApplication0, EKeyApplication0, 0, 0, 0, ELongCaptureShortEventImmediately | ELongCaptureRepeatEvents);
+        mEKeyYesCaptureHandle = groupWin.CaptureKey(EKeyYes, 0, 0);
+        mEKeyNoCaptureHandle = groupWin.CaptureKey(EKeyNo, 0, 0);
+        RDEBUG("keys captured", err);
+        }
+    else
+        {
+        RDEBUG("unknown status", status);
+        return KErrNotSupported;
+        }
+    return KErrNone;
+    }
+
+void Autolock::setLabelIcon(int aReason)
+    {
+    RDEBUG("aReason", aReason);
+
+    if (aReason == ELockNotActive)
+        {
+        // setLockDialog(aReason, 0); // This is done already at TryChangeStatus
+        lower();
+        hide();
+        }
+    else if (aReason == EKeyguardActive)
+        {
+        // setLockDialog(aReason, 1); // This is done already at TryChangeStatus
+        // this shows the Autolock Application. not needed
+        }
+    else if (aReason == EDevicelockActive)
+        {
+        }
+    else
+        {
+        RDEBUG("error: aReason", aReason);
+        }
+    }
+
+int Autolock::updateIndicator(int aReason)
+    {
+    RDEBUG("aReason", aReason);
+    QList<QVariant> list;
+    list.insert(0, 1);
+    list.insert(1, "dummy");
+    list.insert(2, 2);
+
+    HbIndicator indicator;
+    bool success;
+    if (aReason == ELockNotActive)
+        success = indicator.deactivate("com.nokia.hb.indicator.autolock.autolock_8/1.0"); // maybe it's already deactivated. Not a problem
+    else if (aReason == EKeyguardActive)
+        success = indicator.activate("com.nokia.hb.indicator.autolock.autolock_8/1.0");
+    else if (aReason == EDevicelockActive)
+        success = indicator.activate("com.nokia.hb.indicator.autolock.autolock_8/1.0"); // same. We have just 1 indicator
+    else
+        success = 0;
+    RDEBUG("success", success);
+    return success;
+    }
+
+void Autolock::activeKeyguard()
+    {
+    // activity while keyguarded. Nothing to do
+    RDEBUG("0", 0);
+    }
+
+void Autolock::notActiveKeyguard()
+    {
+    // inactivity. Keyguard should be activated
+    RDEBUG("0", 0);
+    int ret = KErrNone;
+    DebugStatus( iLockStatus);
+    if (iLockStatus == ELockNotActive) // not possible if it's keyguarded, or locked
+        {
+        TInt callState = EPSCTsyCallStateNone;
+        int err = RProperty::Get(KPSUidCtsyCallInformation, KCTsyCallState, callState);
+        RDEBUG("err", err);
+        RDEBUG("callState", callState);
+        // if there's an active call, don't auto-keyguard (manual is still possible)
+        if (callState <= EPSCTsyCallStateNone)
+            {
+            ret = TryChangeStatus(ELockAppEnableKeyguard);
+            RDEBUG("ret", ret);
+            }
+        else
+            {
+            RDEBUG("not ELockAppEnableKeyguard because callState", callState);
+            }
+        }
+    else
+        {
+        // restart screensaver. The scenario is: keyguard->screensaver->CriticalNote->lightsOn . Therefore we need lightsOff
+        // this is done when keyguard can't be enabled because it's already enabled
+        // Note that this happens only once, so it's fine to show the screensaver in full light.
+        if (ret == KErrAlreadyExists)
+            switchScreensaverMode( ESnsrViewTypeInitial);
+        }
+    RDEBUG("ret", ret);
+    }
+/* Some activity detected while the deviceLock is enabled */
+void Autolock::activeDevicelock()
+    {
+    // nothing to do
+    RDEBUG("0", 0);
+    }
+
+void Autolock::notActiveDevicelock()
+    {
+    // inactivity. Devicelock should be activated
+    RDEBUG("0", 0);
+    int ret = KErrNone;
+    Q_UNUSED(ret);
+    DebugStatus( iLockStatus);
+    if (iLockStatus == ELockNotActive || iLockStatus == EKeyguardActive) // not possible if it's locked
+        {
+        // this is independent of the call status
+        ret = TryChangeStatus(ELockAppEnableDevicelock);
+        }
+    RDEBUG("ret", ret);
+
+    }
+
+void Autolock::switchScreensaverMode(int mode)
+    {
+    RDEBUG("mode", mode);
+    if (iDeviceDialog)
+        {
+        // maybe this can be used to tell the dialog to dismiss itself?
+        RDEBUG("got iDeviceDialog. iDeviceDialogCreated", iDeviceDialogCreated);
+        QVariantMap params;
+        // this is for LockIcon. Doesn't harm screensaver
+        // need to send again so that the existing dialog still knows what is its type
+        if (iLockStatus == EKeyguardActive)
+            params.insert("type", ESecUiTypeKeyguard);
+        else if (iLockStatus >= EDevicelockActive)
+            params.insert("type", ESecUiTypeDeviceLock);
+
+        // this is for screensaver. Doesn't harm LockIcon
+        params.insert(KSnsrViewTypeKey, mode);
+        iDeviceDialog->update(params);
+
+        if (mScreensaverModeTimer)
+            {
+            if (mode == ESnsrViewTypeStandby || mode == ESnsrViewTypeDisabled)
+                {
+                RDEBUG("stop mScreensaverModeTimer", 0);
+                mScreensaverModeTimer->stop();
+                }
+            else
+            		{
+                RDEBUG("start mScreensaverModeTimer", 0);
+            		mScreensaverModeTimer->start();
+            		}
+            }
+        }
+    RDEBUG("1", 1);
+    }
+
+void Autolock::switchScreensaverToPowerSaveMode()
+    {
+    RDEBUG("0", 0);
+    switchScreensaverMode( ESnsrViewTypeStandby);
+    RDEBUG("1", 1);
+    }
+
+void Autolock::handleMessageFromScreensaver(const QVariantMap &data)
+    {
+    RDEBUG("0", 0);
+    RDEBUG("iLockStatus", iLockStatus);
+    QVariantMap::const_iterator it = data.find(KSnsrCmdUnlock);
+    if (it != data.end() && iLockStatus != ELockNotActive)
+        {
+        RDEBUG("calling handleLockSwitch", 0);
+        handleLockSwitch();
+        }
+
+    it = data.find(KSnsrCmdSwitchLights);
+    if (it != data.end())
+        {
+        int lightStatus = it.value().toInt();
+        RDEBUG("switching screen lights . lightStatus", lightStatus);
+        int err = RProperty::Set(KPSUidCoreApplicationUIs, KLightsSSForcedLightsOn, lightStatus);
+        RDEBUG("err", err);
+        }
+
+    it = data.find(KSnsrCmdSwitchLowPower);
+    if (it != data.end())
+        {
+        QVariantList lowPowerLimits = it.value().toList();
+        if (lowPowerLimits.count() == 2)
+            {
+            // switch on screen power save mode when start and end lines are given
+            int startRow = lowPowerLimits.at(0).toInt();
+            int endRow = lowPowerLimits.at(1).toInt();
+            // TODO: The pixel buffer passed to CPowerSaveDisplayMode is supposed to
+            // contain the pixels shown in the active area of the screen. Currently, we
+            // pass a buffer filled with 0s, and this works fine on the reference
+            // hardware. However, according to display driver people, this doesn't
+            // work if the display component of the device doesn't have internal memory
+            // which may be the case in some of our target devices.
+            TUint16 *ptr = const_cast<TUint16 *> (mScreensaverPowerSavePixelBuffer->Ptr());
+            RDEBUG("switching screen power save on, number of visible rows", endRow-startRow);
+            int err = mScreensaverPowerSave->Set(startRow, endRow, ptr);
+            RDEBUG("err", err);
+            }
+        else
+            {
+            // any other case is interpreted as an order to switch off the power save and
+            // return to the normal mode
+            RDEBUG("switching screen power save off 0", 0);
+            int err = mScreensaverPowerSave->Exit();
+            RDEBUG("err", err);
+            }
+        }
+    }
+
+void Autolock::handleScreensaverClosed()
+    {
+    RDEBUG("0", 0);
+    int err(0);
+    // Screensaver (usually) cannot send anymore any commands when
+    // it's being closed. Thus, we need to ensure here that screen has lights and
+    // full-power mode once screensaver is closed.
+    if (mScreensaverPowerSave)
+        {
+        RDEBUG("switching screen power save off", 0);
+        err = mScreensaverPowerSave->Exit();
+        RDEBUG("error=", err);
+        }
+    RDEBUG("switching screen lights on", 1);
+    err = RProperty::Set(KPSUidCoreApplicationUIs, KLightsSSForcedLightsOn, 30);
+    RDEBUG("err", err);
+    }
+
+// some key is pressed
+// TODO perhaps need a way to stop switch-key while asking unlock-code?
+// Not clear what to do here. dismiss query? 
+bool Autolock::event(QEvent *ev)
+    {
+    if (ev)
+        {
+        int isSwitchKey = 0;
+        if (ev->type() == QEvent::KeyPress)
+            {
+            QKeyEvent *keyEvent = static_cast<QKeyEvent *> (ev);
+            RDEBUG("KeyPress", keyEvent->key());
+            RDEBUG("KeyPress nativeScanCode", keyEvent->nativeScanCode());
+            RDEBUG("EStdKeyDeviceF", EStdKeyDeviceF);
+            RDEBUG("EKeyDeviceF", EKeyDeviceF);
+            RDEBUG("keyEvent->isAutoRepeat()", keyEvent->isAutoRepeat());
+            // note that the key was EKeyApplication0 and EKeyDevice2
+            // yes=0xc4 app=0xb4 no=0xa6
+            if (keyEvent->nativeScanCode() == EStdKeyApplication0 || keyEvent->nativeScanCode() == EStdKeyDevice2 || keyEvent->nativeScanCode() == EStdKeyYes
+                    || keyEvent->nativeScanCode() == EStdKeyNo)
+                {
+                // switch to active screensaver if application key or power key pressed while screensaver active
+                // This key can be repeated, so that the screensaver remains as long as key is pushed
+                // TODO what happens when holding Power key ?
+                switchScreensaverMode( ESnsrViewTypeActive);
+                }
+            else if (!keyEvent->isAutoRepeat())
+                {
+                if (keyEvent->key() == EKeyInsert)
+                    {
+                    // on WINS, this is handled with the "Ins" key in the numeric keypad
+                    RDEBUG("EKeyInsert", EKeyInsert);
+                    // only reacts on release, not on press
+                    isSwitchKey = 1;
+                    }
+                else if (keyEvent->key() == EKeyDeviceF)
+                    {
+                    // this never seem to happen. Nevertheless we are not doing anything
+                    RDEBUG("EKeyDeviceF", EKeyDeviceF);
+                    }
+                else if (keyEvent->nativeScanCode() == EStdKeyDeviceF)
+                    {
+                    RDEBUG("got EStdKeyDeviceF", EStdKeyDeviceF);
+                    isSwitchKey = 1;
+                    }
+                else if (keyEvent->nativeScanCode() == EKeyBell) // this might be sent by others, i.e. PCFW
+                    {
+                    RDEBUG("got EKeyBell", EKeyBell);
+                    isSwitchKey = 1;
+                    }
+                else if (keyEvent->key() == 0x1ffffff)
+                    {
+                    RDEBUG("0x1ffffff", 0x1ffffff); // some unknown key is received. Nothing to do
+                    }
+                }
+            }
+        else if (ev->type() == QEvent::KeyRelease)
+            {
+            QKeyEvent *keyEvent = static_cast<QKeyEvent *> (ev);
+            RDEBUG("KeyRelease", keyEvent->key());
+            RDEBUG("KeyRelease native", keyEvent->nativeScanCode());
+            if (keyEvent->nativeScanCode() == EStdKeyDeviceF && !keyEvent->isAutoRepeat())
+                {
+                RDEBUG("released EStdKeyDeviceF", 1);
+                // isSwitchKey=1; this should happen is   pressed  was not processed (hint: if it is/was in background)
+                }
+            }
+        RDEBUG("isSwitchKey", isSwitchKey);
+        if (isSwitchKey)
+            {
+            handleLockSwitch();
+            RDEBUG("0", 0);
+            } // isSwitchKey
+        } // ev
+    // Process if not done before. For example, redraw or quit
+    TBool widgetEventSuccesful = QWidget::event(ev);
+    RDEBUG("9", 9);
+    return widgetEventSuccesful;
+    }
+
+int Autolock::handleLockSwitch()
+    {
+    RDEBUG("0", 0);
+    int ret = KErrNone;
+   	RDEBUG("iProcessingEvent", iProcessingEvent);
+   	// iProcessingEvent is used to avoid concurrent processing, i.e. 2 side-switch presses; because it needs time to create (and dismiss) the dialog
+   	// However this disallows keyguard during unlock-quey.
+   	if(iProcessingEvent < 1)
+   		{
+	    iProcessingEvent = 1;
+	    Q_UNUSED(ret);
+	    DebugStatus( iLockStatus);
+	    if (iLockStatus == ELockNotActive)
+	        {
+	        iShowKeyguardNote = 0; // no note on enable keyguard
+	        callerHasECapabilityWriteDeviceData = 1;
+	        ret = TryChangeStatus(ELockAppEnableKeyguard); // this should not ask confirmation
+	        }
+	    else if (iLockStatus == EKeyguardActive)
+	        {
+	        iShowKeyguardNote = 0; // no note on disable keyguard
+	        callerHasECapabilityWriteDeviceData = 1;
+	        ret = TryChangeStatus(ELockAppDisableKeyguard);
+	        }
+	    else if (iLockStatus == EDevicelockActive)
+	        {
+	        callerHasECapabilityWriteDeviceData = 1;
+	        ret = TryChangeStatus(ELockAppDisableDevicelock);
+	        }
+	    else
+	        {
+	        RDEBUG("unknown iLockStatus", iLockStatus);
+	        }
+    	iProcessingEvent = 0;
+	    }
+    RDEBUG("ret", ret);
+    return ret;
+    }
+
+bool Autolock::eventFilter(QObject *o, QEvent *ev)
+    {
+    // this never happens
+    RDEBUG("0", 0);
+    return QWidget::eventFilter(o, ev);
+    }
+// some setting changed
+void Autolock::subscriberKSettingsAutolockStatusChanged()
+    {
+    RDEBUG("0", 0);
+    QVariant v = subscriberKSettingsAutolockStatus->value("/KCRUidSecuritySettings/KSettingsAutolockStatus");
+    adjustInactivityTimers( KSettingsAutolockStatus);
+    }
+void Autolock::subscriberKSettingsAutoLockTimeChanged()
+    {
+    RDEBUG("0", 0);
+    QVariant v = subscriberKSettingsAutoLockTime->value("/KCRUidSecuritySettings/KSettingsAutoLockTime");
+    adjustInactivityTimers( KSettingsAutoLockTime);
+    }
+void Autolock::subscriberKSettingsAutomaticKeyguardTimeChanged()
+    {
+    RDEBUG("0", 0);
+    QVariant v = subscriberKSettingsAutomaticKeyguardTime->value("/KCRUidSecuritySettings/KSettingsAutomaticKeyguardTime");
+    adjustInactivityTimers( KSettingsAutoLockTime);
+    }
+void Autolock::subscriberKDisplayLightsTimeoutChanged()
+    {
+    RDEBUG("0", 0);
+    QVariant v = subscriberKDisplayLightsTimeout->value("/KCRUidLightSettings/KDisplayLightsTimeout");
+    // nothing to do
+    }
+void Autolock::subscriberKProEngActiveProfileChanged()
+    {
+    RDEBUG("0", 0);
+    QVariant v = subscriberKProEngActiveProfile->value("/KCRUidProfileEngine/KProEngActiveProfile");
+    // nothing to do
+    }
+// some environment changed
+void Autolock::subscriberKAknKeyguardStatusChanged()
+    {
+    RDEBUG("Error only Autolock should be able to change it", 0);
+    }
+void Autolock::subscriberKCoreAppUIsAutolockStatusChanged()
+    {
+    RDEBUG("Error only Autolock should be able to change it", 0);
+    }
+void Autolock::subscriberKHWRMGripStatusChanged()
+    {
+    TInt ret = KErrNone;
+    Q_UNUSED(ret);
+    RDEBUG("0", 0);
+    TInt aGripStatus;
+    TInt err = RProperty::Get(KPSUidHWRM, KHWRMGripStatus, aGripStatus);
+    RDEBUG("err", err);
+    RDEBUG("value", aGripStatus);
+    if (aGripStatus == EPSHWRMGripOpen)
+        {
+        if (iLockStatus == EKeyguardActive)
+            {
+            iShowKeyguardNote = 0; // no note on disable keyguard
+            callerHasECapabilityWriteDeviceData = 1;
+            ret = TryChangeStatus(ELockAppDisableKeyguard);
+            }
+        else if (iLockStatus == EDevicelockActive)
+            {
+            callerHasECapabilityWriteDeviceData = 1;
+            ret = TryChangeStatus(ELockAppDisableDevicelock);
+            }
+        }
+    else if (aGripStatus == EPSHWRMGripClosed)
+        {
+        if (iLockStatus == ELockNotActive)
+            {
+            iShowKeyguardNote = 0; // no note on enable keyguard
+            callerHasECapabilityWriteDeviceData = 1;
+            ret = TryChangeStatus(ELockAppEnableKeyguard);
+            }
+        }
+    RDEBUG("ret", ret);
+    }
+/**************/
+void Autolock::subscriberKCTsyCallStateChanged()
+    {
+    RDEBUG("0", 0);
+    TInt aCallStatus;
+    TInt err = RProperty::Get(KPSUidCtsyCallInformation, KCTsyCallState, aCallStatus);
+    RDEBUG("err", err);
+    RDEBUG("aCallStatus", aCallStatus);
+    RWindowGroup& groupWin = CEikonEnv::Static()->RootWin();
+    if (aCallStatus == EPSCTsyCallStateUninitialized || aCallStatus == EPSCTsyCallStateNone)
+        {
+        RDEBUG("call is inactive", aCallStatus);
+        RDEBUG("iLockStatus", iLockStatus);
+        if (iLockStatus == EKeyguardActive || iLockStatus == EDevicelockActive)
+            {
+            if (!mEKeyYesCaptureHandle)
+                mEKeyYesCaptureHandle = groupWin.CaptureKey(EKeyYes, 0, 0);
+            if (!mEKeyNoCaptureHandle)
+                mEKeyNoCaptureHandle = groupWin.CaptureKey(EKeyNo, 0, 0);
+            }
+        }
+    else
+        {
+        RDEBUG("call is active", aCallStatus);
+        // Telephone should be on top, but nevertheless we give End/Send to them
+        // This should be done only if locked, but it doesn't harm
+        if (mEKeyYesCaptureHandle)
+            {
+            RDEBUG("mEKeyYesCaptureHandle", mEKeyYesCaptureHandle);
+            groupWin.CancelCaptureKey(mEKeyYesCaptureHandle);
+            mEKeyYesCaptureHandle = NULL;
+            }
+        if (mEKeyNoCaptureHandle)
+            {
+            RDEBUG("mEKeyNoCaptureHandle", mEKeyNoCaptureHandle);
+            groupWin.CancelCaptureKey(mEKeyNoCaptureHandle);
+            mEKeyNoCaptureHandle = NULL;
+            }
+        }
+    RDEBUG("9", 9);
+    }
+// SecUiNotificationDialog::subscriberKSecurityUIsDismissDialogChanged()
+// A way for Autolock to dismiss any possible PIN dialog
+// ----------------------------------------------------------------------------
+//
+void Autolock::subscriberKSecurityUIsDismissDialogChanged()
+    {
+    RDEBUG("0", 0);
+    TInt aDismissDialog = ESecurityUIsDismissDialogUninitialized;
+    TInt err = RProperty::Get(KPSUidSecurityUIs, KSecurityUIsDismissDialog, aDismissDialog);
+    RDEBUG("err", err);
+    RDEBUG("aDismissDialog", aDismissDialog);
+    }
+// ----------AutolockService---------------
+
+AutolockService::AutolockService(Autolock* parent) :
+    XQServiceProvider(QLatin1String("com.nokia.services.Autolock.Autolock"), parent), mAutolock(parent), mAsyncReqId(-1), mAsyncAnswer(false)
+    {
+    RDEBUG("0", 0);
+    publishAll();
+    connect(this, SIGNAL(returnValueDelivered()), parent, SLOT(handleAnswerDelivered()));
+    }
+
+AutolockService::~AutolockService()
+    {
+    RDEBUG("0", 0);
+    }
+
+void AutolockService::complete(QString number)
+    {
+    RDEBUG("0", 0);
+    if (mAsyncReqId == -1)
+        return;
+    completeRequest(mAsyncReqId, number.toInt());
+    }
+
+// got API request from lockaccessextension
+int AutolockService::service(const QString& number, const QString& aParam1, const QString& aParam2)
+    {
+    RDEBUG("0", 0);
+    TInt err = KErrNone;
+    RDEBUG("number", number.toInt());
+    RDEBUG("aParam1", aParam1.toInt());
+    RDEBUG("aParam2", aParam2.toInt());
+    mAsyncAnswer = false;
+    XQRequestInfo info = requestInfo();
+    QSet<int> caps = info.clientCapabilities();
+
+    mAutolock->callerHasECapabilityWriteDeviceData = 0;
+    if (caps.contains(ECapabilityWriteDeviceData))
+        {
+        RDEBUG("callerHasECapabilityWriteDeviceData",
+                ECapabilityWriteDeviceData);
+        mAutolock->callerHasECapabilityWriteDeviceData = 1;
+        }
+
+    QString label = "Autolock::service:\n";
+    label += QString("number=%1\n").arg(number);
+
+    mNumber = number;
+    mAutolock->setLabelNumber(label, number);
+    int ret = 0;
+    ret = number.toInt();
+
+    mAutolock->mParam1 = aParam1.toInt();
+    mAutolock->iShowKeyguardNote = aParam1.toInt();
+    mAutolock->mParam2 = aParam2.toInt();
+    TTime myTime;
+    myTime.HomeTime();
+    TInt myTimeHigh = 0;
+    TInt myTimeLow = 0;
+    err = RProperty::Get(KPSUidSecurityUIs, KSecurityUIsLockInitiatorTimeHigh, myTimeHigh);
+    RDEBUG("err", err);
+    RDEBUG("myTimeHigh", myTimeHigh);
+    err = RProperty::Get(KPSUidSecurityUIs, KSecurityUIsLockInitiatorTimeLow, myTimeLow);
+    RDEBUG("err", err);
+    RDEBUG("myTimeLow", myTimeLow);
+
+    myTimeHigh = I64HIGH( myTime.Int64() );
+    myTimeLow = I64LOW( myTime.Int64() );
+    RDEBUG("myTimeHigh", myTimeHigh);
+    RDEBUG("myTimeLow", myTimeLow);
+    err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsLockInitiatorTimeHigh, myTimeHigh);
+    err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsLockInitiatorTimeLow, myTimeLow);
+
+    ret = mAutolock->TryChangeStatus(ret);
+    RDEBUG("ret", ret);
+
+    TInt myInitiatorUID = 0;
+    err = RProperty::Get(KPSUidSecurityUIs, KSecurityUIsLockInitiatorUID, myInitiatorUID);
+    RDEBUG("ret", ret);
+    RDEBUG("myInitiatorUID", myInitiatorUID);
+    myInitiatorUID = info.clientSecureId();
+    err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsLockInitiatorUID, myInitiatorUID);
+    RDEBUG("ret", ret);
+    RDEBUG("myInitiatorUID", myInitiatorUID);
+
+    return ret;
+    }
+
+void AutolockService::handleClientDisconnect()
+    {
+    RDEBUG("0", 0);
+    // Just quit service application if client ends
+    mAsyncAnswer = false;
+    RDEBUG("0", 0);
+    // mAutolock->quit();
+    }
+
+/****************/
+CWait* CWait::NewL()
+    {
+    CWait* self = new (ELeave) CWait();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+void CWait::ConstructL()
+    {
+    CActiveScheduler::Add(this);
+    }
+CWait::CWait() :
+    CActive(0)
+    {
+    }
+CWait::~CWait()
+    {
+    Cancel();
+    }
+TInt CWait::WaitForRequestL()
+    {
+    SetActive();
+    iWait.Start();
+    return iStatus.Int();
+    }
+void CWait::RunL()
+    {
+    if (iWait.IsStarted())
+        iWait.AsyncStop();
+    }
+void CWait::DoCancel()
+    {
+    if (iWait.IsStarted())
+        iWait.AsyncStop();
+    }
+void CWait::SetRequestType(TInt aRequestType)
+    {
+    iRequestType = aRequestType;
+    }
+TInt CWait::GetRequestType()
+    {
+    return iRequestType;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/src/Autolock.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,249 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, version 2.1 of the License.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program.  If not, 
+* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
+*
+* Description:
+*
+*/
+
+#ifndef AUTOLOCK_H
+#define AUTOLOCK_H
+
+#ifdef _DEBUG
+		#define RDEBUG( x, y ) RDebug::Printf( "%s %s (%u) %s=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, x, y );
+#else
+    #define RDEBUG( x, y )
+#endif
+
+#include <QWidget>
+#include <QEvent>
+#include <QModelIndex>
+#include <QMap>
+#include <QStringList>
+#include <xqserviceprovider.h>
+#include <QToolButton>
+#include <qmobilityglobal.h>
+
+#include "autolockuseractivityservice.h"
+#include "../../SecUi/Inc/SecQueryUi.h"
+
+QTM_BEGIN_NAMESPACE
+    class QValueSpacePublisher;
+    class QValueSpaceSubscriber;
+QTM_END_NAMESPACE
+QTM_USE_NAMESPACE
+
+#include <hbwidget.h>
+#include <qapplication.h>
+#include <hbdevicedialog.h>
+
+enum TLockStatus
+	{
+	ELockNotActive = 0,
+	EKeyguardActive,
+	EDevicelockActive
+	};
+
+enum TDevicelockReason
+	{
+	EDevicelockManual = 1,
+	EDevicelockRemote,
+	EDevicelockTimer
+	};
+
+enum TDeviceDialogCreated
+	{
+	EDeviceDialogUninitialized = -1,
+	EDeviceDialogDestroyed = 0,
+	EDeviceDialogCreated = 1,
+	EDeviceDialogRaised = 2,
+	EDeviceDialogScreenSaver = 0x10,
+	EDeviceDialogLockIcon= 0x11,
+	EDeviceDialogLastValue
+	};
+
+class QTimer;
+
+class AutolockService;
+class CPowerSaveDisplayMode;
+
+class Autolock : public QWidget
+{
+    Q_OBJECT
+
+public:
+    Autolock( QWidget *parent = 0, Qt::WFlags f = 0 );
+    ~Autolock();
+
+    void setLabelNumber(QString label,QString number);
+    void setLabelIcon(int value);
+    int CheckIfLegal(int value);
+    void DebugRequest(int value);
+    void DebugError(int value);
+    void DebugStatus(int value);
+    void adjustInactivityTimers(int aReason);
+    int updateIndicator(int aReason);
+    int AskValidSecCode(int aReason);
+    int publishStatus(int aReason);
+    int TryChangeStatus(int aReason);
+    int setLockDialog(int aReason, int status);
+    int showNoteIfRequested(int aReason);
+
+    bool event(QEvent *event);    
+    bool eventFilter(QObject *, QEvent *);
+
+		int callerHasECapabilityWriteDeviceData;
+		int iShowKeyguardNote;
+    int mParam1;
+    int mParam2;
+
+public slots:    
+    void quit();
+    void handleAnswerDelivered();
+    void subscriberKSettingsAutolockStatusChanged();
+    void subscriberKSettingsAutoLockTimeChanged();
+    void subscriberKSettingsAutomaticKeyguardTimeChanged();
+    void subscriberKDisplayLightsTimeoutChanged();
+    void subscriberKProEngActiveProfileChanged();
+    void subscriberKAknKeyguardStatusChanged();
+    void subscriberKCoreAppUIsAutolockStatusChanged();
+    void subscriberKHWRMGripStatusChanged();
+    void subscriberKCTsyCallStateChanged();
+    void subscriberKSecurityUIsDismissDialogChanged();
+
+private slots:
+    void activeKeyguard();
+    void notActiveKeyguard();
+    void activeDevicelock();
+    void notActiveDevicelock();
+    void switchScreensaverMode( int mode );
+    void switchScreensaverToPowerSaveMode();
+    void handleMessageFromScreensaver( const QVariantMap &data );
+    void handleScreensaverClosed();
+private:
+    int handleLockSwitch();
+
+private:
+    AutolockService* mService;
+    // int mKeyCode;
+    // int mKeyCaptureHandle;
+    QValueSpaceSubscriber *subscriberKSettingsAutolockStatus;
+    QValueSpaceSubscriber *subscriberKSettingsAutoLockTime;
+    QValueSpaceSubscriber *subscriberKSettingsAutomaticKeyguardTime;
+    QValueSpaceSubscriber *subscriberKDisplayLightsTimeout;
+    QValueSpaceSubscriber *subscriberKProEngActiveProfile;
+    QValueSpaceSubscriber *subscriberKAknKeyguardStatus;
+    QValueSpaceSubscriber *subscriberKCoreAppUIsAutolockStatus;
+    QValueSpaceSubscriber *subscriberKHWRMGripStatus;
+    QValueSpaceSubscriber *subscriberKCTsyCallState;
+    QValueSpaceSubscriber *subscriberKSecurityUIsDismissDialog;
+
+		AutolockUserActivityService* serviceKeyguard;
+		AutolockUserActivityService* serviceDevicelock;
+		
+		int iLockStatus;
+		int iLockStatusPrev;
+		CSecQueryUi *iSecQueryUi;
+		int iSecQueryUiCreated;
+		HbDeviceDialog *iDeviceDialog;
+		int iDeviceDialogCreated;
+    TInt32 mPowerKeyCaptureHandle;
+    TInt32 mApplicationKeyCaptureHandle;
+    TInt32 mApplicationLongKeyCaptureHandle;
+    TInt32 mEKeyDeviceFCaptureHandle;
+    TInt32 mEKeyBellCaptureHandle;
+    TInt32 mEKeyYesCaptureHandle;
+    TInt32 mEKeyNoCaptureHandle;
+    TBool iLockCodeQueryInDisplay;
+    QTimer *mScreensaverModeTimer;
+    CPowerSaveDisplayMode *mScreensaverPowerSave;
+    HBufC16 *mScreensaverPowerSavePixelBuffer;
+    TInt32 iProcessingEvent;
+};
+
+class AutolockService : public XQServiceProvider
+{
+    Q_OBJECT
+public:
+    AutolockService( Autolock *parent = 0 );
+    ~AutolockService();
+    
+    void complete(QString number);
+    bool asyncAnswer() {return mAsyncAnswer;}
+public slots:
+    int service(const QString& number, const QString& aParam1, const QString& aParam2 );
+
+private slots:
+   void handleClientDisconnect();
+
+private:
+    Autolock* mAutolock;
+    QString mNumber;
+    bool mAsyncAnswer;
+    int mAsyncReqId;
+};
+
+class  CWait : public CActive
+    {
+     public:
+       /**
+        * Creates instance of the CWait class.
+        *
+		* @return Returns the instance just created.
+        */
+		static CWait* NewL();
+		/**
+        * Destructor.
+        */
+        ~CWait();
+    public:
+        /**
+		* Starts waiting for aReqStatus. 
+		*/
+		TInt WaitForRequestL();
+    public:
+        /**
+        * Sets active request type. 
+        */
+        void SetRequestType(TInt aRequestType);
+        /**
+        * Gets active request type. 
+        */
+        TInt GetRequestType();
+	private:
+		/**
+		* C++ default constructor.
+		*/
+		CWait();
+		/**
+		* Symbian OS constructor.
+		*/
+		void ConstructL();
+	private: // from CActive
+        /** @see CActive::RunL() */
+		void RunL();
+		/** @see CActive::DoCancel() */
+        void DoCancel();
+		RTimer iTimer;
+		CActiveSchedulerWait iWait;
+		// Used if there is a need to cancel an active request;
+        // namely in situations where destructor is called when Wait
+        // is active.
+        TInt iRequestType;
+	};
+
+
+#endif // AUTOLOCK_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/src/Autolock.pri	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,32 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+# All rights reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, version 2.1 of the License.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program.  If not, 
+# see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
+#
+# Description:
+#
+
+INCLUDEPATH += . \
+               inc \
+               autolockuseractivityservice \
+               autolockuseractivityservice/inc
+
+SOURCES=\
+    src/main.cpp\
+    src/Autolock.cpp
+
+HEADERS=\
+    src/Autolock.h
+
--- a/securitydialogs/Autolock/src/AutolockApp.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +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:
-*
-*/
-
-
-// INCLUDE FILES
-#include    "AutolockApp.h"
-#include    "AutolockDocument.h"
-#include <eikstart.h>
-
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ---------------------------------------------------------
-// CAutolockApp::AppDllUid()
-// Returns application UID
-// ---------------------------------------------------------
-//
-TUid CAutolockApp::AppDllUid() const
-    {
-    return KUidAutolock;
-    }
-
-// ---------------------------------------------------------
-// CAutolockApp::CreateDocumentL()
-// Creates CAutolockDocument object
-// ---------------------------------------------------------
-//
-CApaDocument* CAutolockApp::CreateDocumentL()
-    {
-    return CAutolockDocument::NewL( *this );
-    }
-
-// ================= OTHER EXPORTED FUNCTIONS ==============
-//
-
-LOCAL_C CApaApplication* NewApplication()
-    {
-    return new CAutolockApp;
-    }
-
-GLDEF_C TInt E32Main()
-    {
-    return EikStart::RunApplication(NewApplication);
-    }
-
-// End of File  
-
--- a/securitydialogs/Autolock/src/AutolockAppUi.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1782 +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:
-*
-*/
-
-#include <apgtask.h>
-#include <etelmm.h>
-#include <AknEcs.h>
-#include <aknnotedialog.h>
-#include <aknkeylock.h>
-#include <AknLayoutDef.h>
-#include <AknLayout.lag>
-#include <bldvariant.hrh>
-#include <aknappui.h> 
-#include <centralrepository.h>
-#include <settingsinternalcrkeys.h>
-#include <secuisecurityhandler.h>
-#include <secui.h>
-#include <featmgr.h>
-#include <Autolock.rsg>
-#include <mmtsy_names.h>
-#include <e32property.h>
-#include <PSVariables.h>   // Property values
-#include <coreapplicationuisdomainpskeys.h>
-#include <startupdomainpskeys.h>
-#include <ctsydomainpskeys.h>
-#include <securityuisprivatepskeys.h>
-#include <AknSgcc.h>
-
-#include "AutolockAppUiPS.h"
-#include "AutoLockValueObserverPS.h"
-#include "AutoLockModelPS.h"
-#include "AutolockApp.h"
-#include "autolock.hrh"
-#include "AutolockView.h"
-
-#include <SCPClient.h>
-#include <AknSoftNotifier.h>
-
-// sysap uid and message enums defined in eikon.hrh
-// for sending messages to sysap
-#include <eikon.hrh>
-#include <apgwgnam.h>
-#include <aknlayoutscalable_avkon.cdl.h>
-
-#include <AknCapServerDefs.h>
-#include <apgtask.h>
-
-#include <keylockpolicyapi.h>
-
-//  LOCAL CONSTANTS AND MACROS  
-#define KSysApUid TUid::Uid(0x100058F3)
-#define KPhoneAppUid TUid::Uid(0x100058B3)
-
-const TInt KTriesToConnectServer( 2 );
-const TInt KTimeBeforeRetryingServerConnection( 50000 );
-const TInt PhoneIndex( 0 );
-const TInt KCancelKeyScanCode( EStdKeyDevice1 ); // 165
-
-
-// ================= MEMBER FUNCTIONS =======================
-//
-// ----------------------------------------------------------
-// CAutolockAppUi::ConstructL()
-// ?implementation_description
-// ----------------------------------------------------------
-//
-void CAutolockAppUi::ConstructL()
-    {
-  #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::ConstructL"));
-    #endif
-    
-    BaseConstructL( EAknEnableSkin | EAknEnableMSK | EAknDisableAnimationBackground );
-    
-    //Disable priority control so that Autolock process priority isn't set to "background" by 
-  //window server when it is not active.
-  iEikonEnv->WsSession().ComputeMode( RWsSession::EPriorityControlDisabled ); 
-  RThread().SetProcessPriority( EPriorityHigh );
-
-    FeatureManager::InitializeLibL();
-
-  RTelServer::TPhoneInfo PhoneInfo;
-  // prevent autolock shutdown
-  iEikonEnv->SetSystem( ETrue ); 
-
-	CKeyLockPolicyApi* iCKeyLockPolicyApi = CKeyLockPolicyApi::NewL( EPolicyActivateKeyguard );
-	TBool keyguardAllowed = iCKeyLockPolicyApi->KeyguardAllowed();
-  #if defined(_DEBUG)
-	RDebug::Printf( "%s %s (%u) keyguardAllowed=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, keyguardAllowed );
-  #endif
-	keyguardAllowed = iCKeyLockPolicyApi->EnableKeyguardFeature();
-  #if defined(_DEBUG)
-	RDebug::Printf( "%s %s (%u) new keyguardAllowed=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, keyguardAllowed );
-  #endif
-  delete iCKeyLockPolicyApi;
-
-  iSideKey1 = 0;
-  iSideKey2 = 0;
-  iAppKey = 0;
-
-  aCallButtonRect = TRect (0,0,0,0);
-  iGotEventDownDuringCall = -1;
-  //connect to ETel
-
-  TInt err( KErrGeneral );
-    TInt thisTry( 0 );
-    
-  /*All server connections are tried to be made KTiesToConnectServer times because occasional
-    fails on connections are possible at least on some servers*/
-  #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::ConstructL() connect to etel server"));
-    #endif
-  // connect etel server
-  while ( ( err = iServer.Connect() ) != KErrNone && ( thisTry++ ) <= KTriesToConnectServer )
-        {
-        User::After( KTimeBeforeRetryingServerConnection );
-        }
-    User::LeaveIfError( err );
-
-  #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::ConstructL() load tsy"));
-    #endif
-    // load tsy
-    err = iServer.LoadPhoneModule( KMmTsyModuleName );
-  #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::ConstructL() load tsy ERROR: %d"), err);
-    #endif
-    if ( err != KErrAlreadyExists )
-        {
-        // may return also KErrAlreadyExists if some other
-        // is already loaded the tsy module. And that is
-        // not an error.
-        User::LeaveIfError( err );
-        }
-  
-  thisTry = 0;
-  #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::ConstructL() open phone"));
-    #endif
-  //open phone
-  User::LeaveIfError(iServer.SetExtendedErrorGranularity(RTelServer::EErrorExtended));
-  User::LeaveIfError(iServer.GetPhoneInfo(PhoneIndex, PhoneInfo));
-  User::LeaveIfError(iPhone.Open(iServer,PhoneInfo.iName));
-    User::LeaveIfError(iCustomPhone.Open(iPhone));
-  #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::ConstructL() phone opened"));
-    #endif
-
-  TBool systemLocked = EFalse;
-  TBool phoneLocked = EFalse;
-
-    iWait = NULL;
-    iWait = CWait::NewL();
-
-	RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockPhoneDevice;
-	RMobilePhone::TMobilePhoneLockInfoV1 lockInfo;
-	RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo);
-	TInt cRresult = KErrNone;
-
-  #ifndef __WINS__
-
-
-  /*****************************************************
-  * Series 60 Customer / ETEL
-  * Series 60 ETEL API
-  *****************************************************/
-
-  // set autolock period to 0, if lock is disabled in DOS side
-  #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::ConstructL() set autolock period to 0"));
-    #endif
-    
-  iWait->SetRequestType(EMobilePhoneGetLockInfo);
-  iPhone.GetLockInfo(iWait->iStatus, lockType, lockInfoPkg);
-  TInt res = iWait->WaitForRequestL();
-  User::LeaveIfError(res);
-      
-  // Eventhough we might lock the device on boot-up (systemLocked == ETrue), we
-  // want to hide the app until the handshake is done. StartUp application will
-  // active the app when it is finished.   
-  TApaTask self(iCoeEnv->WsSession());
-  self.SetWgId(iCoeEnv->RootWin().Identifier());
-  self.SendToBackground();
-  // flush
-  iCoeEnv->WsSession().Flush();     
-        
-    TInt lockValue = 0;
-    CRepository* repository = CRepository::NewL(KCRUidSecuritySettings);
-    cRresult = repository->Get(KSettingsAutolockStatus, lockValue);
-    TBool hiddenReset = HiddenReset();
-    #if defined(_DEBUG)
-    if(hiddenReset)
-        RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::ConstructL() Hidden reset"));
-    RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::ConstructL() CR get result: %d"), cRresult);
-    RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::ConstructL() CR lock value: %d"), lockValue);
-    RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::ConstructL() CR lockInfo.iSetting: %d"), lockInfo.iSetting);    
-    RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::ConstructL() RMobilePhone::ELockSetEnabled: %d"), RMobilePhone::ELockSetEnabled);    
-    RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::ConstructL() RMobilePhone::ELockSetDisabled: %d"), RMobilePhone::ELockSetDisabled);    
-    #endif
-    if (lockInfo.iSetting == RMobilePhone::ELockSetDisabled)
-    {
-        repository->Set(KSettingsAutoLockTime, 0);
-        if ( FeatureManager::FeatureSupported( KFeatureIdProtocolCdma ) )
-            {
-            repository->Set(KSettingsLockOnPowerUp, 0);
-            }
-        }
-    // In CDMA, the system can stay locked on after the boot-up sequence.
-    else if ( FeatureManager::FeatureSupported( KFeatureIdProtocolCdma ) || (hiddenReset && (lockValue == 1)))
-        {
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::ConstructL() Hidden reset when locked"));
-        #endif
-        phoneLocked = systemLocked = ETrue;
-        }
-    else if (lockInfo.iSetting == RMobilePhone::ELockSetEnabled && !hiddenReset) {       
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::ConstructL() Set phone locked"));
-        #endif
-        phoneLocked = ETrue;
-        }             
-  
-     
-    delete repository;
-  #endif   //__WINS__
-
-  #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::ConstructL() Enable emergency call support"));
-    #endif
-  
-  #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::ConstructL() Autolock view"));
-    #endif
-    
-
-
-    // -------------------------------------------------------------------------------------------------------------
-    // part of emergency call handling when telephony+devicelock is active
-    // this solution is meant only for 3.1 and 3.2
-
-    iEcsNote = new (ELeave) CEcsNote();
-    iEcsNote->ConstructSleepingNoteL(R_AVKON_EMERGENCY_CALL_NOTE);
-    iEcsNote->ButtonGroupContainer().ButtonGroup()->AsControl()->DrawableWindow()->SetOrdinalPosition(0,2);
-    
-    if (AknLayoutUtils::PenEnabled()) // on touch devices, if Autolock is activated from IdleScreen in landscape, the buttons need to be drawn.
-  {
-  iEcsNote->ButtonGroupContainer().SetCommandL( 0, _L("") );  // as keyboard is locked, these buttons do nothing. Better to hide their labels.
-    iEcsNote->ButtonGroupContainer().SetCommandL( EAknSoftkeyCancel, _L("") );
-  iEcsNote->ButtonGroupContainer().ButtonGroup()->AsControl()->MakeVisible(ETrue);
-    }
-
-  // Emergency call support
-    iEcsDetector = CAknEcsDetector::NewL();
-    iEcsDetector->SetObserver( this );
-  iEmergencySupportReady = ETrue;
-    // -------------------------------------------------------------------------------------------------------------
-        
-
-  // Autolock view  
-  CAutolockView* lockView = new(ELeave) CAutolockView;
-    CleanupStack::PushL(lockView);
-    lockView->ConstructL();
-    CleanupStack::Pop();  // lockView
-    AddViewL(lockView);    // transfer ownership to CAknViewAppUi
-  SetDefaultViewL(*lockView);
-
-  // start autolock timer
-  iModel = CAutoLockModel::NewL(this, phoneLocked); 
-
-  // phone event observer
-  iPhoneObserver = CValueObserver::NewL(this);
-  //call bubble
-  iIncallBubble = CAknIncallBubble::NewL();
-
-  //Autokeyguard Period observer
-  #ifdef RD_AUTO_KEYGUARD
-  iKeyguardObserver = CAutoKeyguardObserver::NewL(this);
-  #else //!RD_AUTO_KEYGUARD
-  iKeyguardObserver = NULL;
-  #endif //RD_AUTO_KEYGUARD
-    // Create the write policy. Also processes with write device data can write the value.
-    TSecurityPolicy writePolicy( ECapabilityWriteDeviceData ); 
-  // Create the read policy. Also processes with read device data can read the value. 
-  TSecurityPolicy readPolicy( ECapabilityReadDeviceData ); 
-  
-  TInt tRet = RProperty::Define( KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, RProperty::EInt, readPolicy, writePolicy );
-        
-    if ( tRet != KErrNone )
-        {
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::ConstructL():\
-            FAILED to define the SECUI query Flag: %d"), tRet);
-        #endif
-        } 
-    
-    tRet = RProperty::Define( KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, RProperty::EInt, readPolicy, writePolicy );
-    if ( tRet != KErrNone )
-        {
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::ConstructL():\
-            FAILED to define the SECUI query request state Flag: %d"), tRet);
-        #endif
-        }
-
-if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw ))  
-{
-
-    // Define the TARM admin flag.
-    
-    tRet = RProperty::Define( KSCPSIDAutolock, SCP_TARM_ADMIN_FLAG_UID, RProperty::EInt,
-        readPolicy, writePolicy );    
-    if ( tRet != KErrNone )
-        {
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::ConstructL():\
-            FAILED to define the TARM Admin Flag"));
-        #endif
-        }
-        
-    // The following sequence is used to validate the configuration on SCP server.
-    // This is needed on the first boot (initial or RFS) or if the C-drive has been formatted
-    // (3-button format) and Autolock is not active.
-
-    RSCPClient scpClient;
-    if ( scpClient.Connect() == KErrNone )
-        {
-        TInt confStatus = KErrNone;
-        // check whether this is normal or exceptional boot. This solves the issue when PIN is requested, Autolock starts, and scpClient.CheckConfiguration verifies the internal lock code
-        TInt startupReason(ENormalStartup);
-    		RProperty::Get(KPSUidStartup, KPSStartupReason, startupReason);
-
-				TInt secQueryStatus = ESecurityQueryUninitialized;
-				TInt tRet = RProperty::Get(KPSUidStartup, KStartupSecurityCodeQueryStatus, secQueryStatus);
-				#if defined(_DEBUG)
-				RDebug::Printf( "%s %s (%u) startupReason=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, startupReason );
-				RDebug::Printf( "%s %s (%u) secQueryStatus=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, secQueryStatus );
-				RDebug::Printf( "%s %s (%u) cRresult=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, cRresult );
-				RDebug::Printf( "%s %s (%u) lockInfo.iSetting=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, lockInfo.iSetting );
-				RDebug::Printf( "%s %s (%u) tRet=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, tRet );
-				#endif
-
-				TInt simStatusValue;
-				tRet = RProperty::Get(KPSUidStartup, KPSSimStatus, simStatusValue);
-				#if defined(_DEBUG)
-				RDebug::Printf( "%s %s (%u) tRet=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, tRet );
-				RDebug::Printf( "%s %s (%u) simStatusValue=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, simStatusValue );
-				RDebug::Printf( "%s %s (%u) ESimReadable=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, ESimReadable );
-				#endif
-					
-        if( simStatusValue==ESimReadable && secQueryStatus==ESecurityQueryActive)
-        	{	// query during SIM-query. This should not happen because check on CSecurityNotifier::GetParamsL  iEvent != RMobilePhone::EPin1Required
-					#if defined(_DEBUG)
-					RDebug::Printf( "%s %s (%u) tRet=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, tRet );
-					#endif
-        	confStatus = KErrNone;	// the best thing to do is to skip CheckConfiguration, because it might secretly accept the lock-code
-        	}
-        else
-        	confStatus = scpClient.CheckConfiguration( KSCPInitial );
-        #if defined(_DEBUG)
-				RDebug::Printf( "%s %s (%u) confStatus=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, confStatus );
-				RDebug::Printf( "%s %s (%u) KErrAccessDenied=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, KErrAccessDenied );
-				#endif
-        if ( confStatus == KErrAccessDenied )
-            {
-            #ifndef __WINS__            
-            if ( 1 )    // Previously was ( lockInfo.iSetting == RMobilePhone::ELockSetDisabled )   but now it needs to handle scenarios : ISA_format without drive format, and the opposite
-            #else // __WINS__                    
-            if ( 1 ) // DOS lock is never active in WINS            
-            #endif // __WINS__     
-            {         
-            // DOS lock is not active. Note that if DOS is locked, checking the code here will
-            // mess up the query sequence. On initial startup DOS is not locked.                    
-                
-                TInt finalConfStatus = scpClient.CheckConfiguration( KSCPComplete );
-                #if defined(_DEBUG)
-								RDebug::Printf( "%s %s (%u) finalConfStatus=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, finalConfStatus );
-                #endif
-                if ( finalConfStatus == KErrAccessDenied )
-                    {                
-                    #ifdef __WINS__   
-                    #if defined(_DEBUG)
-                    RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::ConstructL():\
-                        DOS validation FAILED in WINS, something wrong!"));
-                    #endif                                  
-                    #else // !__WINS__                                            
-
-                    // The SCP server is out of sync and Autolock is not active. (c-drive formatted)
-                    // We must ask the security code. ( Note that it is very rare that this is executed )
-                  #if defined(_DEBUG)
-                    RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::ConstructL():\
-                        Lock setting disabled, calling setlocksetting"));
-                    #endif
-                
-                    // Wait here until the startup is complete
-                
-                    TInt tarmErr = KErrNone;
-                    while ( tarmErr == KErrNone )
-                        {                              
-                        TInt sysState=0;
-                            tarmErr = RProperty::Get(KPSUidStartup, KPSGlobalSystemState, sysState);
-
-                            if ((sysState == ESwStateNormalRfOn) || (sysState == ESwStateNormalRfOff) 
-                                 || (sysState == ESwStateNormalBTSap))
-                                {
-                                break;
-                                }                                        
-                        User::After(500000);
-                        }
-                
-                    // Just change the lock setting again to disabled to request the security code.
-                    // Set the TARM flag so SecUi knows it should display the "login" query.
-                  TInt tarmFlag=0;
-                  tRet = RProperty::Get( KSCPSIDAutolock, SCP_TARM_ADMIN_FLAG_UID, tarmFlag );
-                  if ( tRet == KErrNone )
-                      {
-                      tarmFlag |= KSCPFlagResyncQuery;
-                      tRet = RProperty::Set( KSCPSIDAutolock, SCP_TARM_ADMIN_FLAG_UID, tarmFlag );
-                      }
-              
-                  if ( tRet != KErrNone )
-                        {
-                        #if defined(_DEBUG)
-                        RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::ConstructL():\
-                            FAILED to set TARM Admin Flag"));
-                        #endif
-                        }
-              
-                  RMobilePhone::TMobilePhoneLockSetting lockChange;
-                  lockChange = RMobilePhone::ELockSetDisabled;
-                  iWait->SetRequestType(EMobilePhoneSetLockSetting);
-                    iPhone.SetLockSetting(iWait->iStatus, lockType, lockChange);
-                
-                    res = iWait->WaitForRequestL();
-                    #endif // __WINS__                                 
-                    }
-                }                        
-                                   
-            } // if ( confStatus == KErrAccessDenied )
-            
-        scpClient.Close();               
-        }
-      
-}
-
-    // Eventhough we might lock the device on boot-up (systemLocked == ETrue), we
-    // want to hide the app until the handshake is done. StartUp application will
-    // active the app when it is finished.
-    #if defined(_DEBUG)
-		RDebug::Printf( "%s %s (%u) systemLocked=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, systemLocked );
-		RDebug::Printf( "%s %s (%u) phoneLocked=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, phoneLocked );
-		#endif
-    if( !systemLocked )
-        {
-        // incoming call on boot
-				TInt value(EStartupUiPhaseUninitialized);
-				RProperty::Get(KPSUidStartup, KPSStartupUiPhase, value);
-				#if defined(_DEBUG)
-				RDebug::Printf( "%s %s (%u) KPSStartupUiPhase value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, value );
-				#endif
-        if( value<EStartupUiPhaseSystemWelcomeDone )
-        	{
-        	TInt err=iPhoneObserver->Start();
-        	#if defined(_DEBUG)
-					RDebug::Printf( "%s %s (%u) err=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, err );
-					#endif
-					}
-        // app to background
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::ConstructL() app to background"));
-        #endif
-        TApaTask self(iCoeEnv->WsSession());
-        self.SetWgId(iCoeEnv->RootWin().Identifier());
-        self.SendToBackground();
-        // flush
-        iCoeEnv->WsSession().Flush();      
-        }
-    else
-        {
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::ConstructL() LOCK SYSTEM"));
-        #endif
-        TInt lockState = 0;
-        
-        #ifdef RD_REMOTELOCK
-      lockState = EManualLocked;      
-      #else //!RD_REMOTELOCK      
-      lockState = EAutolockOn;      
-      #endif//RD_REMOTELOCK
-        iModel->LockSystemL(lockState);  
-        }
-        
-    iGripStatusObserver = CAutolockGripStatusObserver::NewL( this, iEikonEnv->WsSession() ); 
-    iFpsStatusObserver = CAutolockFpsStatusObserver::NewL( this, iEikonEnv->WsSession() ); 
-    iDeviceLockQueryStatus = EFalse;
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::ConstructL()  END"));
-    #endif
-  }
-// ----------------------------------------------------
-// CAutolockAppUi::~CAutolockAppUi()
-// Destructor
-// Frees reserved resources
-// ----------------------------------------------------
-//
-CAutolockAppUi::~CAutolockAppUi()
-    {
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::~CAutolockAppUi() BEGIN"));
-    #endif
-
-    if(iWait)
-        {
-        // Cancel active requests
-        if(iWait->IsActive())
-            {
-            #if defined(_DEBUG)
-          RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::~CAutolockAppUi() CANCEL REQ"));
-          #endif
-            iPhone.CancelAsyncRequest(iWait->GetRequestType());
-            }
-        }
-    //close ETel connections
-    if (iCustomPhone.SubSessionHandle())
-        iCustomPhone.Close();
-    
-    if (iPhone.SubSessionHandle())
-      iPhone.Close();
-    
-    if (iServer.Handle())
-        {           
-        iServer.UnloadPhoneModule(KMmTsyModuleName);
-        iServer.Close();
-        }
-  delete iModel;
-  delete iPhoneObserver;
-  delete iIncallBubble;
-#ifdef RD_AUTO_KEYGUARD
-  delete iKeyguardObserver;
-#endif
-
-    delete iEcsDetector;
-    delete iEcsNote; // Ecs change
-    delete iWait;
-    FeatureManager::UnInitializeLib();
-    delete iGripStatusObserver;
-    delete iFpsStatusObserver;
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::~CAutolockAppUi() END"));
-    #endif
-  }
-// ----------------------------------------------------
-// CAutolockAppUi::HandleForegroundEventL()
-// Handles foreground event.
-// ----------------------------------------------------
-//
-void CAutolockAppUi::HandleForegroundEventL(TBool aForeground)
-  {
-  #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::HandleForegroundEventL()"));
-    #endif
-  if (aForeground )
-    {
-    if (iLocked)
-      {
-      // lock voice key 
-      LockSideKeyL(); 
-      CAknView* view = View(KAutoLockViewId);
-      if(view)
-        { 
-          TRect aInitialRect;
-        STATIC_CAST(CAutolockView*, view)->HandleCall(0x15, aInitialRect);
-        }
-    
-      }
-    else
-      {
-      // app back to background
-      TApaTask self(iCoeEnv->WsSession());
-      self.SetWgId(iCoeEnv->RootWin().Identifier());
-      self.SendToBackground();
-      }
-    }
-
-  if (!aForeground && iLocked)
-    {
-        TInt callState=0;
-        TInt simStatus=0;
-        RProperty::Get(KPSUidCtsyCallInformation, KCTsyCallState, callState );
-        RProperty::Get(KPSUidStartup, KPSSimStatus, simStatus);
-
-        if (callState == EPSCTsyCallStateNone && simStatus != ESimNotPresent)
-      { 
-      // try put autolock back to foreground
-      CAknView* view = View(KAutoLockViewId);
-      if(view)
-        { 
-        TRect aInitialRect;
-        STATIC_CAST(CAutolockView*, view)->HandleCall(0x19, aInitialRect);
-        }
-      TApaTask self(iCoeEnv->WsSession());
-      self.SetWgId(iCoeEnv->RootWin().Identifier());
-      self.BringToForeground();   
-      }
-    else
-      {
-      // unlock voice key while there is active call
-      UnLockSideKey();
-      CAknView* view = View(KAutoLockViewId);
-      if(view)
-        { 
-          TRect aInitialRect;
-        STATIC_CAST(CAutolockView*, view)->HandleCall(0x16, aInitialRect);
-        }
-      }
-    }
-
-  CAknAppUi::HandleForegroundEventL(aForeground);
-  
-  }
-
-
-// ----------------------------------------------------
-// HideSoftNotification()
-// dismiss all the pending notes just before asking the unlocking code
-// ----------------------------------------------------
-//
-void HideSoftNotification()
-    {
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)HideSoftNotification"));
-    #endif
-    CAknSoftNotifier *softNotifier = NULL;
-    TRAPD (err, {
-            softNotifier = CAknSoftNotifier::NewL();
-            softNotifier->AddNotificationL(ESetIdleState, 0);
-    };)
-    delete softNotifier;
-    }
-// CAutolockAppUi::HandleCommandL(TInt aCommand)
-// ----------------------------------------------------  
-
-
-// ----------------------------------------------------
-// CAutolockAppUi::HandleMessageL
-//
-// Handles the TARM command to unlock the phone.
-// ----------------------------------------------------
-//  
-MCoeMessageObserver::TMessageResponse CAutolockAppUi::HandleMessageL( 
-                                TUint32 aClientHandleOfTargetWindowGroup, 
-                                TUid aMessageUid, 
-                                const TDesC8& aMessageParameters 
-                               )
-    {
-      
-      if(!FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw ))  
-      {
-        User::Leave(KErrNotSupported);
-      }
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::HandleMessageL()"));
-    #endif
-    
-    MCoeMessageObserver::TMessageResponse messageResponse( EMessageHandled );
-    
-    if ( aMessageUid.iUid == SCP_CMDUID_UNLOCK+1 )
-        {
-        #if defined(_DEBUG)
-        RDebug::Printf( "%s %s (%u) calling CancelDeviceLockQuery=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-        #endif
-        CancelDeviceLockQuery();
-        }
-    else if ( aMessageUid.iUid == SCP_CMDUID_UNLOCK )
-        {        
-        // For security reasons we must check from the SCP server did this 
-        // command originate from it.                                
-        RSCPClient scpClient;
-        if ( scpClient.Connect() == KErrNone )
-            {
-            CleanupClosePushL( scpClient );
-        
-            if ( scpClient.QueryAdminCmd( ESCPCommandUnlockPhone ) )
-                {
-                // Switch autolock to BG
-                #if defined(_DEBUG)
-                RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::HandleMessageL():\
-                    Admin command received, unlocking"));
-                #endif            
-            
-                if ( !iLocked )
-                    {
-                    #if defined(_DEBUG)
-                    RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::HandleMessageL():\
-                        Ignoring Unlock message - not locked."));
-                    #endif            
-                    }   
-                else
-                    {
-                    iLocked = EFalse;
-                    HideSoftNotification(); // dismiss all the pending notes                    
-                    DisableWGListChangeEventListening();  
-                    UnLockKeys();
-                    iModel->SetLockedL(EFalse);
-                    // Disable keyguard after remote unlock
-                    RAknKeyLock iKeyLock;
-                    TInt tempResult = iKeyLock.Connect();
-                    iKeyLock.DisableKeyLock();
-                  // end Disable keyguard after remote unlock
-                    SwitchToPreviousAppL();
-                    }   
-                }           
-            else
-                {
-                #if defined(_DEBUG)
-                RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::HandleMessageL():\
-                    Unauthorized attempt to unlock"));
-                #endif
-                }
-        
-            CleanupStack::PopAndDestroy(); // scpClient                               
-            }
-        else
-            {          
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::HandleMessageL():\
-                Failed to connect to SCP, ignoring unlock-message."));
-            #endif            
-            
-            }
-        }               
-    else // aMessageUid.iUid != SCP_CMDUID_UNLOCK 
-        {
-        messageResponse = CAknAppUi::HandleMessageL( aClientHandleOfTargetWindowGroup, 
-                                                     aMessageUid,
-                                                     aMessageParameters
-                                                   );
-        }
-    
-    return messageResponse;
-    }
-        
-  
-// ------------------------------------------------------------------------------
-// CAutolockAppUi::::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane)
-//  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 CAutolockAppUi::DynInitMenuPaneL(
-    TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/)
-    {
-    }
-
-void CAutolockAppUi::HandlePointerEventL(const TPointerEvent& aPointerEvent)
-    {
-	#if defined(_DEBUG)
-    RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-	#endif
-    }
-// ----------------------------------------------------
-// CAutolockAppUi::HandleKeyEventL(
-//     const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
-// ----------------------------------------------------
-//
-TKeyResponse CAutolockAppUi::HandleKeyEventL(
-    const TKeyEvent& aKeyEvent,TEventCode aType)
-    {
-        
-    if ( aKeyEvent.iCode == EKeyBell || (aType == EEventKeyUp && aKeyEvent.iScanCode == EStdKeyDeviceF)  || (aKeyEvent.iCode == EKeyDeviceF) )
-    {
-    if(iLocked)    
-        HandleCommandL(ESecUiCmdUnlock);
-    return EKeyWasConsumed; 
-    }
-
-    TBool featureNoPowerkey = FeatureManager::FeatureSupported( KFeatureIdNoPowerkey );
-    // If power key pressed, tell SysAp about if
-    if( (aKeyEvent.iScanCode == EStdKeyDevice2 && aType == EEventKeyDown )
-        || (aType == EEventKey && featureNoPowerkey && aKeyEvent.iCode == EKeyNo))
-        {
-        SendMessageToSysAp(EEikKeyLockPowerKeyPressed);
-        if ( featureNoPowerkey )
-            {
-            SendMessageToSysAp(EEikKeyLockLightsOnRequest);              
-            }
-        }
-    return EKeyWasNotConsumed;
-    }
-
-void CAutolockAppUi::SendMessageToSysAp(TInt aMessage)
-    {
-    RWsSession& ws = iEikonEnv->WsSession();
-    TInt wgId=0;
-    CApaWindowGroupName::FindByAppUid(KSysApUid, ws, wgId);
-    if (wgId)
-        {
-        TWsEvent event;
-        event.SetType(aMessage);
-        event.SetTimeNow();
-        ws.SendEventToWindowGroup(wgId, event);
-        }
-    }
-
-
-void CAutolockAppUi::HandleCommandL(TInt aCommand)
-    {
-  #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::HandleCommandL()"));
-    #endif
-  switch ( aCommand )
-        {
-        case EEikCmdExit:
-      {
-      #if defined(_DEBUG)
-      RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::HandleCommandL() EEikCmdExit"));
-      #endif
-            Exit();
-            break;
-      }
-        case ESecUiCmdUnlock:
-      {
-      #if defined(_DEBUG)
-      RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::HandleCommandL() ESecUiCmdUnlock"));
-      #endif
-      // stop observing emergency call event
-      iEmergencySupportReady = EFalse;
-      iEcsDetector->Reset(); // Ecs queue is cleared; keys up til here are forgotten
-      // ask secuity code
-      CSecurityHandler* handler = new (ELeave) CSecurityHandler(iPhone);
-      CleanupStack::PushL(handler);
-      TSecUi::InitializeLibL(); 
-          
-          // Put the lights on when security query is shown
-          SendMessageToSysAp( EEikSecurityQueryLights );
-          HideSoftNotification(); // dismiss all the pending notes just before asking the unlocking code
-          
-            TRAPD(err,
-      {
-      iDeviceLockQueryStatus = ETrue;
-      if(handler->AskSecCodeInAutoLockL())
-        {   
-        iLocked = EFalse;
-        DisableWGListChangeEventListening();
-        iDeviceLockQueryStatus = EFalse;
-        UnLockKeys();
-        iModel->SetLockedL(EFalse);
-        SwitchToPreviousAppL();
-        }
-            else
-        {  // make sure that we will be topmost still
-            iDeviceLockQueryStatus = EFalse;
-                    TInt callState;
-                    RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallState, callState );
-                if ( callState == EPSCTsyCallStateNone &&
-                     !FeatureManager::FeatureSupported( KFeatureIdProtocolCdma ) )
-                    {
-            TApaTask self(CCoeEnv::Static()->WsSession());
-            self.SetWgId(CCoeEnv::Static()->RootWin().Identifier());
-            self.BringToForeground();
-                    TBool featureNoPowerkey = FeatureManager::FeatureSupported( KFeatureIdNoPowerkey );
-                    if ( featureNoPowerkey )
-                        {//set lights on in case user pressed "red button". If he pressed cancel the lights are on anyway so it doesn't matter.
-                        SendMessageToSysAp(EEikKeyLockLightsOnRequest);              
-                        }
-            // we don't want enable lock if call in progress    
-                    RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallState, callState );
-                    TInt keyguardDisableState(ECoreAppUIsDisableKeyguardUninitialized);
-                    //If there is alarm on the keyguard status is set to disabled. In that case don't enable keyguard as it will be done by SysAp 
-                    //after the alarm has been disabled/snoozed. Otherwise the alarm CBA is left under keyguard CBA.
-                    RProperty::Get( KPSUidCoreApplicationUIs, KCoreAppUIsDisableKeyguard, keyguardDisableState );
-                    if ((callState == EPSCTsyCallStateNone) && (keyguardDisableState != ECoreAppUIsDisableKeyguard))
-                        {   
-              RAknKeyLock keylock;
-              if ( keylock.Connect() == KErrNone )
-                {
-                keylock.EnableAutoLockEmulation();
-                keylock.Close();
-                }
-              }
-                    }
-                }
-      };)
-
-      // start observing emergency call event
-      iEmergencySupportReady = ETrue;
-      CleanupStack::PopAndDestroy(handler); // handler
-      TSecUi::UnInitializeLib();  // secui    
-      
-      User::LeaveIfError(err);
-
-      break;
-      }
-        default:
-            break;      
-        } 
-    }
-
-// ----------------------------------------------------
-// CAutolockAppUi::SwitchToPreviousAppL()
-// Activates previous app 
-//----------------------------------------------------
-//
-void CAutolockAppUi::SwitchToPreviousAppL()
-  {
-  #if defined(_DEBUG)
-  RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::SwitchToPreviousAppL()"));
-  #endif
-  iEcsDetector->Reset(); // Ecs queue is cleared; keys up til here are forgotten
-  // stop observing phone events
-  iPhoneObserver->Stop();
-  CAknView* view = View(KAutoLockViewId);
-  if(view)
-    {
-    STATIC_CAST(CAutolockView*, view)->MakeVisible(EFalse);
-    }
-  else
-    {
-    #if defined(_DEBUG)
-    RDebug::Printf( "%s %s (%u) no view ????=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, view );
-    #endif
-    }
-  // app to background
-  TApaTask self(iCoeEnv->WsSession());
-  self.SetWgId(iCoeEnv->RootWin().Identifier());
-  self.SendToBackground();
-  // flush
-  iCoeEnv->WsSession().Flush();
-  }
-// ----------------------------------------------------
-// CAutolockAppUi::BringAppToForegroundL()
-// Activates autolock app
-//----------------------------------------------------
-//
-void CAutolockAppUi::BringAppToForegroundL()
-  {
-  #if defined(_DEBUG)
-  RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::BringAppToForegroundL()"));
-  #endif
-  TBool tarmAdminFlag(EFalse);
-  TBool remotelockState(EFalse);
-if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw ))
-{
-    tarmAdminFlag = TarmState();
-}
-
-#ifdef RD_REMOTELOCK
-        TInt autolockState;
-        RProperty::Get(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, autolockState);
-        remotelockState = (autolockState == ERemoteLocked);           
-#endif//RD_REMOTELOCK
-	// If TARM admin flag is set, bring Autolock to foreground regardless of call state.
-
-
-	if(!tarmAdminFlag)
-	{   //If phone has been remote locked bring Autolock to foreground regardless of call state.
-	    if(!remotelockState)
-	    {   // check if there is active call
-				TInt callState;
-				RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallState, callState );
-				#if defined(_DEBUG)
-				RDebug::Printf( "%s %s (%u) callState=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, callState );
-				#endif
-
-				TInt value(EStartupUiPhaseUninitialized);
-				RProperty::Get(KPSUidStartup, KPSStartupUiPhase, value);
-				#if defined(_DEBUG)
-				RDebug::Printf( "%s %s (%u) KPSStartupUiPhase value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, value );
-				RDebug::Printf( "%s %s (%u) EStartupUiPhaseSystemWelcomeDone=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, EStartupUiPhaseSystemWelcomeDone );
-				#endif
-				if(value<EStartupUiPhaseSystemWelcomeDone && callState == EPSCTsyCallStateNone)
-					{
-					callState = EPSCTsyCallStateNone+1;	// so that is unlocks
-					iLocked = EFalse;
-					#if defined(_DEBUG)
-					RDebug::Printf( "%s %s (%u) iLocked=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iLocked );
-					#endif
-					}
-				else if(value<EStartupUiPhaseSystemWelcomeDone && callState > EPSCTsyCallStateNone)
-					{
-					callState = EPSCTsyCallStateNone+0;	// so that is locks
-					#if defined(_DEBUG)
-					RDebug::Printf( "%s %s (%u) new+0 callState=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, callState );
-					#endif
-					}
-            if (callState != EPSCTsyCallStateNone )
-                {
-               	#if defined(_DEBUG)
-								RDebug::Printf( "%s %s (%u) 1=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 );
-								#endif
-		    		    UnLockKeys();
-		    		    iModel->SetLockedL(EFalse);
-		    		    iModel->ResetInactivityTimeout();
-		    		    return;
-		    		    }   
-	    }
-	    
-	}
-         		
-
-  #ifndef __WINS__
-
-  #ifndef __NO_DOS__
-
-    /*****************************************************
-    * Series 60 Customer / ETEL
-    * Series 60 ETEL API
-    *****************************************************/
-
-  // check that device locked in DOS side too
-  RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockPhoneDevice;
-  RMobilePhone::TMobilePhoneLockInfoV1 lockInfo;
-  RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo);
-
-	#if defined(_DEBUG)
-	RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::BringAppToForegroundL() GetLockInfo"));
-	#endif
-	iWait->SetRequestType(EMobilePhoneGetLockInfo);
-	iPhone.GetLockInfo(iWait->iStatus, lockType, lockInfoPkg);
-	TInt res = iWait->WaitForRequestL();
-	User::LeaveIfError(res);
-	if (iWait->iStatus == KErrNone)
-		{
-		// if not don't lock ui either
-		#if defined(_DEBUG)
-		RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::BringAppToForegroundL() KErrNone"));
-		RDebug::Printf( "%s %s (%u) lockInfo.iSetting=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, lockInfo.iSetting );
-		RDebug::Printf( "%s %s (%u) RMobilePhone::ELockSetDisabled=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, RMobilePhone::ELockSetDisabled );
-		#endif
-		if (lockInfo.iSetting == RMobilePhone::ELockSetDisabled)
-			{
-			iModel->SetLockedL(EFalse);
-			UnLockKeys();
-			return;
-			}
-		}
-	#endif
-
-  #endif
-
-  // in case Telephone-app is topmost, then the user is confused because he sees but can't use it.
-  // therefore it's required to hide it, by sending to background. ETMA-7M8A2Y 20090105
-  if ( AknLayoutUtils::PenEnabled() )
-      {     
-        TApaTaskList apaTaskList(CCoeEnv::Static()->WsSession());
-
-        TApaTask apaTask = apaTaskList.FindApp(KPhoneAppUid);
-        if (apaTask.Exists())
-        {
-          #if defined(_DEBUG)
-            RDebug::Print(_L("(AUTOLOCK)CAknKeyLockControl::EnableKeylock() Bring phone to background"));
-          #endif
-          // Bring phone to background
-          apaTask.SendToBackground();
-        }
-      } 
-	#if defined(_DEBUG)
-	RDebug::Printf( "%s %s (%u) iPhoneObserver->Start=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 );
-	#endif
-  
-  iPhoneObserver->Start();
-  iLocked = ETrue;
-  // app to foreground  
-  TApaTask self(iCoeEnv->WsSession());
-  self.SetWgId(iCoeEnv->RootWin().Identifier());
-  self.BringToForeground();
-  ActivateLocalViewL(KAutoLockViewId);
-  CAknView* view = View(KAutoLockViewId);
-  if(view)
-    {
-    TRect aInitialRect;
-      STATIC_CAST(CAutolockView*, view)->HandleCall(0x17, aInitialRect);
-    STATIC_CAST(CAutolockView*, view)->MakeVisible(ETrue);
-    }
-  else
-    {
-    #if defined(_DEBUG)
-    RDebug::Printf( "%s %s (%u) no view ????=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, view );
-    #endif
-    }
-  }
-
-// ----------------------------------------------------
-// CAutolockAppUi::LockKeysL()
-// locks keys 
-//----------------------------------------------------
-//
-void CAutolockAppUi::LockKeysL()
-  {
-  #if defined(_DEBUG)
-  RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::LockKeysL()"));
-  #endif
-  // capture appkey & volume key
-  if (!iAppKey)
-    {
-    RWindowGroup& groupWin=iCoeEnv->RootWin();
-    iAppKey = groupWin.CaptureKeyUpAndDowns(EStdKeyApplication0, 0, 0); // Capture app key
-    }
-  TInt gripStatus = EPSHWRMGripClosed;
-  RProperty::Get( KPSUidHWRM, KHWRMGripStatus, gripStatus );
-  #if defined(_DEBUG)
-  RDebug::Printf( "%s %s (%u) gripStatus=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, gripStatus );
-  #endif
-  if(gripStatus==EPSHWRMGripOpen)
-    ForceOrientation(0);
-  else
-    ForceOrientation(1);
-  LockSideKeyL();
-  }
-// ----------------------------------------------------
-// CAutolockAppUi::UnLockKeys()
-// unlocks keys 
-//----------------------------------------------------
-//
-void CAutolockAppUi::UnLockKeys()
-  {
-  #if defined(_DEBUG)
-  RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::UnLockKeysL()"));
-  #endif
-  // uncapture appkey
-  if (iAppKey)
-    {
-    RWindowGroup& groupWin=iCoeEnv->RootWin();
-    groupWin.CancelCaptureKeyUpAndDowns(iAppKey);
-    iAppKey = 0;
-    }
-  UnLockSideKey();
-  }
-// ----------------------------------------------------
-// CAutolockAppUi::LockSideKeyL()
-// unlocks side-key 
-//----------------------------------------------------
-//
-void CAutolockAppUi::LockSideKeyL()
-  {
-  #if defined(_DEBUG)
-  RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::LockSideKeyL()"));
-  #endif
-  if (!iSideKey1)
-    {
-    RWindowGroup& groupWin=iCoeEnv->RootWin();
-    iSideKey1 = groupWin.CaptureKey(EKeyDeviceF,0,0); // EKeySide -> EKeyDeviceF
-    #if defined(_DEBUG)
-    RDebug::Printf( "%s %s (%u) capturing EStdKeyDeviceF=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, EStdKeyDeviceF );
-    #endif
-    iSideKey2 = groupWin.CaptureKeyUpAndDowns(EStdKeyDeviceF, 0, 0);  // EStdKeyDevice6 -> EStdKeyDeviceF
-    }
-  }
-
-// -------------------------------------------------------------------------------------------------------------
-// part of emergency call handling when telephony+devicelock is active
-// this solution is meant only for 3.1 and 3.2
-void CAutolockAppUi::HandleEcsEvent( CAknEcsDetector* aEcsDetector, CAknEcsDetector::TState aState )
-    {
-    switch ( aState )
-        {
-        case CAknEcsDetector::ECompleteMatchThenSendKey:
-            // Do nothing since note will be removed on ECallAttempted event
-            break;
-        case CAknEcsDetector::ECompleteMatch:
-            iEcsNote->SetEmergencyNumber( aEcsDetector->CurrentMatch() );
-            
-            // Tell sysAp to switch lights on
-            SendMessageToSysAp( EEikEcsQueryLights );
-            
-            iEcsNote->ShowNote();
-            iEcsNote->iNoteOnScreen =ETrue;
-            break;
-        case CAknEcsDetector::EPartialMatch:
-            iEcsNote->SleepNote();
-            break;
-        case CAknEcsDetector::ECallAttempted:
-            iEcsNote->SleepNote();
-            break;
-        case CAknEcsDetector::EEmpty:
-            iEcsNote->SleepNote();
-            break;
-        case CAknEcsDetector::ENoMatch:
-            iEcsNote->SleepNote();
-            break;
-        default:
-            break;
-        }
-    }
-
-CEcsNote::CEcsNote() : iNoteOnScreen( EFalse )
-    {}
-    
-void CEcsNote::ConstructSleepingNoteL(TInt aResourceId)
-    {
-    CAknNoteDialog::ConstructSleepingDialogL(aResourceId);
-    }
-    
-TInt CEcsNote::ShowNote()
-    {
-    ReportUserActivity();
-    iTimeoutInMicroseconds = CAknNoteDialog::EUndefinedTimeout;
-    iTone = CAknNoteDialog::ENoTone;    
-    if (!iNoteOnScreen)
-        {  
-        return RouseSleepingDialog();
-        }
-        // return value not used
-    else
-        // return value not used
-        return NULL;
-    }
-
-void CEcsNote::SleepNote()
-    {
-    if (iNoteOnScreen)
-        ExitSleepingDialog(); // Causes flicker to other notes if called when note is not on screen
-    iNoteOnScreen = EFalse;
-    }
-
-TKeyResponse CEcsNote::OfferKeyEventL(const TKeyEvent& /*aKeyEvent*/, TEventCode /*aType*/)
-    {
-    return EKeyWasConsumed;
-    }
-
-void CEcsNote::SetEmergencyNumber( const TDesC& aMatchedNumber )
-    {
-    TRect screen(iAvkonAppUi->ApplicationRect());
-    TAknLayoutRect mainPane;
-    mainPane.LayoutRect(screen, AKN_LAYOUT_WINDOW_main_pane(screen, 0, 1, 1));
-    TAknLayoutRect popupNoteWindow;
-    AknLayoutUtils::TAknCbaLocation cbaLocation( AknLayoutUtils::CbaLocation() );
-    TInt variety( 0 );
-    if ( cbaLocation == AknLayoutUtils::EAknCbaLocationRight )
-        {
-        variety = 5;
-        }
-    else if ( cbaLocation == AknLayoutUtils::EAknCbaLocationLeft )
-        {
-        variety = 8;
-        }
-    else
-        {
-        variety = 2;
-        }
-
-    popupNoteWindow.LayoutRect(mainPane.Rect(), AknLayoutScalable_Avkon::popup_note_window( variety ));
-    TAknLayoutText textRect;
-    textRect.LayoutText(popupNoteWindow.Rect(), AKN_LAYOUT_TEXT_Note_pop_up_window_texts_Line_1(4));
-
-    // Size of a temporary buffer that contains new lines, spaces and 
-    // emergency number for a note.
-    TBuf16<KAknEcsMaxMatchingLength+80> number;
-    number.Append('\n');
-    number.Append('\n');
-
-    TInt spaceCharWidthInPixels = textRect.Font()->CharWidthInPixels(' ');
-    if (spaceCharWidthInPixels < 1)
-        {
-        // Avoid divide by zero situation even the space char would have zero length.
-        spaceCharWidthInPixels = 1;
-        }
-    
-    TInt length = (textRect.TextRect().Width() - textRect.Font()->TextWidthInPixels(aMatchedNumber))
-                    / spaceCharWidthInPixels;
-
-    const TInt matchedNumberLength = aMatchedNumber.Length();
-    const TInt numberLength = number.Length();
-    const TInt numberMaxLength = number.MaxLength();
-    
-    if ( numberLength + length + matchedNumberLength > numberMaxLength)
-        {
-        // To make sure that buffer overflow does not happen.
-        length = numberMaxLength - numberLength - matchedNumberLength;
-        }
-    for (int i = 0; i < length ; i++)
-        {
-        number.Append(' ');
-        }
-
-    number.Append(aMatchedNumber);
-    TRAP_IGNORE(SetTextL(number));
-
-    }
-        
-// -------------------------------------------------------------------------------------------------------------
-  
-// ----------------------------------------------------
-// CAutolockAppUi::UnLockSideKey()
-// unlocks side-key 
-//----------------------------------------------------
-//
-void CAutolockAppUi::UnLockSideKey()
-  {
-  #if defined(_DEBUG)
-  RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::UnLockSideKeyL()"));
-  #endif
-  if (iSideKey1)
-    {
-    RWindowGroup& groupWin=iCoeEnv->RootWin();
-    groupWin.CancelCaptureKeyUpAndDowns(iSideKey2);
-    groupWin.CancelCaptureKey(iSideKey1);
-    iSideKey1 = 0;
-    iSideKey2 = 0;
-    }
-  }
-  
-
-//
-// ---------------------------------------------------------
-// CAutolockAppUi::HandleScreenDeviceChangedL()
-// Handles screen layout changes, called by CCoeAppUi
-// ---------------------------------------------------------
-//
-void CAutolockAppUi::HandleScreenDeviceChangedL()
-{
-  CAknAppUiBase::HandleScreenDeviceChangedL();
-   //get autolock view from CAknViewAppUi
-  CAknView* view = View(KAutoLockViewId);
-  if(view)
-    {
-        STATIC_CAST(CAutolockView*, view)->ScreenDeviceChanged();
-    }
-  
-}
-
-//
-// ----------------------------------------------------------
-// CAutolockAppUi::IsPinBlocked()
-// Checks whether PIN1/UPIN is blocked
-// ----------------------------------------------------------
-//
-TBool CAutolockAppUi::IsPinBlocked()
-{
-  RMmCustomAPI::TSecurityCodeType secCodeType;
-  TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ));
-  TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin ));
-
-  if(wcdmaSupported || upinSupported)
-    {
-      RMobilePhone::TMobilePhoneSecurityCode activePin;
-      iCustomPhone.GetActivePin(activePin);
-      if(activePin == RMobilePhone::ESecurityUniversalPin)
-        secCodeType = RMmCustomAPI::ESecurityUniversalPin;
-      else
-        secCodeType = RMmCustomAPI::ESecurityCodePin1;
-    }
-  else 
-      secCodeType = RMmCustomAPI::ESecurityCodePin1;
-  
-  TBool isBlocked = EFalse;
-    iCustomPhone.IsBlocked(secCodeType,isBlocked);
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::IsPinBlocked result: %d"), isBlocked);
-    #endif
-  return isBlocked;
-}
-
-//
-// ----------------------------------------------------------
-// CAutolockAppUi::HandleWsEventL()
-// 
-// ----------------------------------------------------------
-//
-void CAutolockAppUi::HandleWsEventL( const TWsEvent& aEvent,CCoeControl* aDestination )
-    {
-      const TInt type = aEvent.Type();
-    #if defined(_DEBUG)
-      RDebug::Printf( "%s %s (%u) type=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, type );
-      #endif
-
-      switch ( type )
-      {
-        case KAknFullOrPartialForegroundLost: // partial or full fg lost
-          if( iIncallBubble )
-                    {
-                    #if defined(_DEBUG)
-            RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::HandleWsEventL: DISABLE call bubble"));
-            #endif                    
-                    iIncallBubble->SetIncallBubbleAllowedInIdleL( EFalse );
-                    }
-        break;
-        case KAknFullOrPartialForegroundGained: // partial or full fg gained
-          if( iIncallBubble )
-                {
-                  #if defined(_DEBUG)
-              RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::HandleWsEventL: ENABLE call bubble"));
-              #endif
-              CAknView* view = View(KAutoLockViewId);
-              if(view)
-                { 
-                TRect aInitialRect;
-                STATIC_CAST(CAutolockView*, view)->HandleCall(0x1A, aInitialRect);
-                }
-
-                    iIncallBubble->SetIncallBubbleAllowedInIdleL( ETrue );
-                }
-          break;  
-          case EEventWindowGroupListChanged:
-              HandleWindowGroupListChange();
-              break;
-          case EEventPointer:
-          case EEventDragDrop:
-              {
-              TInt gripStatus = EPSHWRMGripClosed;
-              RProperty::Get( KPSUidHWRM, KHWRMGripStatus, gripStatus );
-							#if defined(_DEBUG)
-							RDebug::Printf( "%s %s (%u) 1 gripStatus=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, gripStatus );
-							RDebug::Printf( "%s %s (%u) EPSHWRMGripClosed=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, EPSHWRMGripClosed );
-							#endif
-							if(gripStatus==EPSHWRMGripStatusUninitialized)
-								{
-								gripStatus=EPSHWRMGripClosed;
-								#if defined(_DEBUG)
-								RDebug::Printf( "%s %s (%u) new gripStatus=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, gripStatus );
-								#endif
-								}
-              TInt callState = 0;
-              RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallState, callState );
-    	    	#if defined(_DEBUG)
-   	    		RDebug::Printf( "%s %s (%u) callState=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, callState );
-			    #endif
-                TPointerEvent *pointer = aEvent.Pointer();
-                  CAknView* view = View(KAutoLockViewId);
-                  if(view)
-                    { 
-                        STATIC_CAST(CAutolockView*, view)->ScreenDeviceChanged();
-                      TRect aInitialRect;
-                        STATIC_CAST(CAutolockView*, view)->HandleCall(0x1, aInitialRect);
-                        if(aCallButtonRect.iBr.iX==0) // initialize if not done already
-                          aCallButtonRect = TRect (aInitialRect);
-                    }
-              if ( callState != EPSCTsyCallStateNone && callState != EPSCTsyCallStateUninitialized )
-                {
-                if(pointer->iType==TPointerEvent::EButton1Down)
-                  {
-                  TPoint iPosition = pointer->iPosition;
-		    	       #if defined(_DEBUG)
-    	    			RDebug::Printf( "%s %s (%u) iPosition.iX=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPosition.iX );
-    	    			RDebug::Printf( "%s %s (%u) aCallButtonRect.iBr.iX=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aCallButtonRect.iBr.iX );
-    	    			RDebug::Printf( "%s %s (%u) iPosition.iY=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPosition.iY );
-    	    			RDebug::Printf( "%s %s (%u) aCallButtonRect.iBr.iY=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aCallButtonRect.iBr.iY );
-    	    			#endif
-                  if(aCallButtonRect.iBr.iX<iPosition.iX && iPosition.iX<aCallButtonRect.iBr.iX+aCallButtonRect.iTl.iX &&
-                    ( (gripStatus==EPSHWRMGripClosed && iPosition.iY>400) || (gripStatus!=EPSHWRMGripClosed && aCallButtonRect.iBr.iY<iPosition.iY && iPosition.iY<aCallButtonRect.iBr.iY+aCallButtonRect.iTl.iY ) )
-                     )
-                    {
-	    		        	#if defined(_DEBUG)
-    	    					RDebug::Printf( "%s %s (%u) iGotEventDownDuringCall=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iGotEventDownDuringCall );
-    	    					#endif
-                    iGotEventDownDuringCall=1;
-                    }
-                  }
-                if(pointer->iType==TPointerEvent::EButton1Up)
-                  {
-                  TPoint iPosition = pointer->iPosition;
-                  // touching at any point inside and below the BigRedButton. This is to handle the case where another dialog overlaps
-		    	        #if defined(_DEBUG)
-   	    					RDebug::Printf( "%s %s (%u) iGotEventDownDuringCall=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iGotEventDownDuringCall );
-	    	    			RDebug::Printf( "%s %s (%u) iPosition.iX=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPosition.iX );
-	    	    			RDebug::Printf( "%s %s (%u) aCallButtonRect.iBr.iX=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aCallButtonRect.iBr.iX );
-	    	    			RDebug::Printf( "%s %s (%u) iPosition.iY=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPosition.iY );
-	    	    			RDebug::Printf( "%s %s (%u) aCallButtonRect.iBr.iY=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aCallButtonRect.iBr.iY );
-   	    					#endif
-            if(iGotEventDownDuringCall==1 && aCallButtonRect.iBr.iX<iPosition.iX && iPosition.iX<aCallButtonRect.iBr.iX+aCallButtonRect.iTl.iX && 
-                  ( (gripStatus==EPSHWRMGripClosed && iPosition.iY>400) || (gripStatus!=EPSHWRMGripClosed && aCallButtonRect.iBr.iY<iPosition.iY && iPosition.iY<aCallButtonRect.iBr.iY+aCallButtonRect.iTl.iY ) )
-                     )
-                    {
-										// on some devices, simulating End-Key might not end the call. First, try the API
-										RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallState, callState );
-										#if defined(_DEBUG)
-										RDebug::Printf( "%s %s (%u) callState=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, callState );
-										#endif
-										if ( callState != EPSCTsyCallStateNone && callState != EPSCTsyCallStateUninitialized )
-											{
-				                    RTelServer telServer;
-				                    RMobilePhone mPhone;  
-				                    User::LeaveIfError(telServer.Connect());
-				                    TInt err;
-				                    err = telServer.LoadPhoneModule(KMmTsyModuleName);
-				                    if (err != KErrNone && err != KErrAlreadyExists)
-				                        User::Leave(err);
-				                    User::LeaveIfError(mPhone.Open(telServer, KMmTsyPhoneName));
-				                    CleanupClosePushL(mPhone);
-				                    RMobileLine mLine;
-				                    TPtrC lineName;
-				                    lineName.Set(KMmTsyVoice1LineName);
-				                    User::LeaveIfError(mLine.Open(mPhone, lineName));
-				                    CleanupClosePushL(mLine);
-            
-				                    TInt count(0);
-				                    User::LeaveIfError(mLine.EnumerateCall(count));
-								    #if defined(_DEBUG)
-								    RDebug::Printf( "%s %s (%u) count=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, count );
-								    #endif   
-				                    for (TInt jj = 0; jj < count; jj++)
-				                        {
-				                        RLine::TCallInfo cinfo;
-				                        User::LeaveIfError(mLine.GetCallInfo(jj, cinfo));
-				                        RMobileCall mCall;
-				                        User::LeaveIfError(mCall.OpenExistingCall(mLine, cinfo.iCallName));
-									    #if defined(_DEBUG)
-									    RDebug::Printf( "%s %s (%u) calling mCall.HangUp 0=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-									    #endif   
-				                        mCall.HangUp(); // this gives an error, but succeeds
-				                        }
-				                    CleanupStack::PopAndDestroy(&mLine);
-				                    CleanupStack::PopAndDestroy(&mPhone);
-		    		        			}
-											User::After(100000);	// give time for the call to end
-											#if defined(_DEBUG)
-											RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallState, callState );
-											RDebug::Printf( "%s %s (%u) callState=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, callState );
-											#endif
-											if ( callState != EPSCTsyCallStateNone && callState != EPSCTsyCallStateUninitialized )
-												{
-												// send End key to Telephony to end the call. This works for GSM and VOIP
-											    #if defined(_DEBUG)
-											    RDebug::Printf( "%s %s (%u) sending EStdKeyNo=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, EStdKeyNo );
-											    #endif
-												TRawEvent event;
-												event.Set(TRawEvent::EKeyDown, EStdKeyNo);
-												iEikonEnv->WsSession().SimulateRawEvent(event);
-												User::After(1000);
-												event.Set(TRawEvent::EKeyUp, EStdKeyNo);
-												iEikonEnv->WsSession().SimulateRawEvent(event);
-												User::After(100000);	// give time for the call to end
-												}
-                    }
-                  iGotEventDownDuringCall=0;  // even if outside the touch area
-                  aCallButtonRect.iBr.iX = 0;
-                  }
-                }
-              }
-              break;
-          case EEventKeyUp: // on touch devices, this happens only for the switch-key, which should turn on the lights.
-          case EEventKey:
-          case EEventKeyDown:
-            if(iLocked)
-                { // need to capture the switch-key for the case activeCall because Autolock stays on top, even over Akn
-                TKeyEvent *key = aEvent.Key();
-                #if defined(_DEBUG)
-                RDebug::Printf( "%s %s (%u) key->iCode=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, key->iCode );
-                RDebug::Printf( "%s %s (%u) key->iScanCode=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, key->iScanCode );
-                #endif
-                if ( (key->iScanCode == EStdKeyDeviceF) || (key->iCode == EKeyDeviceF) )
-                  {
-                  #if defined(_DEBUG)
-                  RDebug::Printf( "%s %s (%u) good key=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 );
-                  #endif
-                  RWsSession& ws = iEikonEnv->WsSession();
-                  TApaTaskList tasklist( ws );
-                  TApaTask capserver = tasklist.FindApp( KAknCapServerUid );
-                  if( capserver.Exists() )
-                      {
-                      #if defined(_DEBUG)
-                      RDebug::Printf( "%s %s (%u) found KAknCapServerUid=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, KAknCapServerUid );
-                      #endif
-                      capserver.SendKey( *key );
-                      }
-                  SendMessageToSysAp( EEikSecurityQueryLights );
-                  }
-                }
-            break;
-        default:
-          iGotEventDownDuringCall=0;  // any other event invalidates the Press inside the BigRedButton
-          break;
-      }
-      
-      // All events are sent to base class.
-      CAknViewAppUi::HandleWsEventL( aEvent, aDestination );
-        
-        // part of emergency call handling when telephony+devicelock is active
-        // this solution is meant only for 3.1 and 3.2
-        // Emergency detector only handles key down events
-        if ( iEmergencySupportReady )
-          iEcsDetector->HandleWsEventL( aEvent, aDestination);      
-  #if defined(_DEBUG)
-    RDebug::Printf( "%s %s (%u) 0=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-    #endif
-    }
-
-TBool CAutolockAppUi::DeviceLockQueryStatus()
-    {
-    return iDeviceLockQueryStatus;
-    }
-
-TBool CAutolockAppUi::DeviceLockStatus()
-    {
-    return iLocked;
-    }
-
-void CAutolockAppUi::ForceOrientation(TInt value)
-    {
-    #if defined(_DEBUG)
-    RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, value );
-    #endif
-		if(value==1)
-			{
-			SetOrientationL( EAppUiOrientationLandscape );
-			SetOrientationL( EAppUiOrientationPortrait );
-			}
-		if(value==0)
-			{
-			SetOrientationL( EAppUiOrientationPortrait );
-			SetOrientationL( EAppUiOrientationLandscape );
-			}
-    aCallButtonRect.iBr.iX = 0;
-    #if defined(_DEBUG)
-    RDebug::Printf( "%s %s (%u) done value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, value );
-    #endif
-    }
-
-void CAutolockAppUi::CancelDeviceLockQuery()
-    {
-  #if defined(_DEBUG)
-    RDebug::Printf( "%s %s (%u) 0=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-    #endif
-    TRawEvent rawEvent;
-    rawEvent.Set( TRawEvent::EKeyDown, KCancelKeyScanCode );
-    iCoeEnv->WsSession().SimulateRawEvent( rawEvent );          
-    rawEvent.Set( TRawEvent::EKeyUp, KCancelKeyScanCode );
-    iCoeEnv->WsSession().SimulateRawEvent( rawEvent );          
-    }
-
-TBool CAutolockAppUi::DeviceFpsLock(TInt iStatus)
-    {
-    if(iStatus)
-      HandleCommandL(ESecUiCmdUnlock);
-    else
-      iModel->SetLockedL(ETimerLocked);
-    return ETrue;
-    }
-void CAutolockAppUi::HandleWindowGroupListChange()
-    {
-  #if defined(_DEBUG)
-    RDebug::Printf( "%s %s (%u) iLocked=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iLocked );
-    #endif
-    if ( !iLocked )
-        {
-        // System is not locked, make sure app is not on the foreground.
-        if ( !iCoeEnv->RootWin().OrdinalPosition() )
-            {
-            CAknSgcClient::MoveApp(
-                iCoeEnv->RootWin().Identifier(), 
-                ESgcMoveAppToBackground );
-            }
-        }
-    else
-        {
-                CAknView* view = View(KAutoLockViewId);
-                  if(view)
-                    { 
-                      TRect aInitialRect;
-                        STATIC_CAST(CAutolockView*, view)->HandleCall(0x10, aInitialRect);
-                        if(aCallButtonRect.iBr.iX==0) // initialize if not done already
-                          aCallButtonRect = TRect (aInitialRect);
-                    }
-        // So now system is locked. When call is not ongoing, autolock should
-        // be on the foreground.
-        TInt callState = 0;
-        RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallState, callState );
-        if ( callState == EPSCTsyCallStateNone || 
-             callState == EPSCTsyCallStateUninitialized )
-            {
-            // No calls ongoing.
-            if ( iCoeEnv->RootWin().OrdinalPosition() > 0 ) 
-                {
-                // Not on foreground
-                CAknSgcClient::MoveApp(
-                    iCoeEnv->RootWin().Identifier(), 
-                    ESgcMoveAppToForeground );
-                }
-            }
-        }
-    }
-
-TBool CAutolockAppUi::TarmState()
-{
-TBool ret(EFalse);
-if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw ))
-{
-    // Get the TARM admin flag value
-    TInt tarmFlag;
-  TInt tRet = RProperty::Get( KSCPSIDAutolock, SCP_TARM_ADMIN_FLAG_UID, tarmFlag );
-    
-    if ( tRet != KErrNone )
-        {
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::BringAppToForegroundL(): Warning: failed to get TARM Admin Flag state"));
-            #endif
-        }
-    else
-        {
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::BringAppToForegroundL(): TARM flag: %d"),
-                tarmFlag );
-            #endif
-        }
-        
-    // Unset the admin flag if set
-    if ( tarmFlag & KSCPFlagAdminLock )
-        {
-        ret = ETrue;
-        TInt tRet = RProperty::Get( KSCPSIDAutolock, SCP_TARM_ADMIN_FLAG_UID, tarmFlag );
-        
-        if ( tRet == KErrNone )
-            {
-            tarmFlag &= ~KSCPFlagAdminLock;
-            tRet = RProperty::Set( KSCPSIDAutolock, SCP_TARM_ADMIN_FLAG_UID, tarmFlag );
-            }
-
-        if ( tRet != KErrNone )
-            {
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::BringAppToForegroundL(): FAILED to unset TARM Admin Flag"));
-            #endif
-            }                    
-        }  
-
-}
-  #if defined(_DEBUG)
-    RDebug::Printf( "%s %s (%u) ret=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, ret );
-    #endif
-return ret;
-}
-
-// ---------------------------------------------------------
-// CAutolockAppUi::HiddenReset()
-// ---------------------------------------------------------
-TBool CAutolockAppUi::HiddenReset()
-    {
-    #if defined(_DEBUG)
-  RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::HiddenReset() begin"));
-  #endif                        
-
-    TBool ret_val ( EFalse );
-  TInt startupReason(ENormalStartup);
-  TInt errorCode(KErrNone);
-  
-  RProperty::Get(KPSUidStartup, KPSStartupReason, startupReason);
-  
-  if ( errorCode != KErrNone )
-    {
-        #if defined(_DEBUG)
-          RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::HiddenReset() error getting startup reason"));
-          #endif
-      }
-    ret_val = (startupReason != ENormalStartup);
-    #if defined(_DEBUG)
-  RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::HiddenReset() END: %d"), ret_val);
-  #endif
-    return ret_val;
-    }
-void CAutolockAppUi::EnableWGListChangeEventListening()
-{
-  #if defined(_DEBUG)
-  RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::EnableWGListChangeEventListening()"));
-  #endif
-    RWindowGroup& rootWin = iCoeEnv->RootWin();
-    rootWin.EnableGroupListChangeEvents();
-    rootWin.EnableScreenChangeEvents();
-}
-void CAutolockAppUi::DisableWGListChangeEventListening()
-{
-  #if defined(_DEBUG)
-  RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::DisableWGListChangeEventListening()"));
-  #endif
-    RWindowGroup& rootWin = iCoeEnv->RootWin();
-    rootWin.DisableGroupListChangeEvents();
-    rootWin.DisableScreenChangeEvents();
-}
-// End of File  
--- a/securitydialogs/Autolock/src/AutolockContainer.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,394 +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:
-*
-*/
-
-
-// INCLUDE FILES
-#include "AutolockContainer.h"
-#include <eikenv.h>
-#include <autolock.mbg>
-#include <avkon.hrh>
-#include <aknlayoutscalable_avkon.cdl.h>
-#include <aknlayoutscalable_apps.cdl.h>
-#include <layoutmetadata.cdl.h>
-#include <data_caging_path_literals.hrh>
-#include "AutolockAppUiPS.h"
-#include <Autolock.rsg>
-#include "autolock.hrh"
-#include <eikdef.h>
-#include <aknnotedialog.h>
-#include <aknkeylock.h>
-#include <AknSoftNotifier.h>
-
-#include <coreapplicationuisdomainpskeys.h>
-
-#include <AknsLayeredBackgroundControlContext.h>
-#include <AknsDrawUtils.h>
-#include <AknBitmapAnimation.h>
-#include    <AknsUtils.h>
-#include	<AknUtils.h>
-
-#include <e32property.h>
-#include <PSVariables.h>   // Property values
-#include <coreapplicationuisdomainpskeys.h>
-#include <startupdomainpskeys.h>
-#include <ctsydomainpskeys.h>
-_LIT(BitmapName,"AutoLock.mbm");
-
-// CONSTANTS
-
-#ifdef RD_FULLSCREEN_WALLPAPER
-enum TAutolockBgLayers
-    {
-    EAutolockBgLayerWallpaper      = 0,    
-    EAutolockBgLayerBackground     = 1,
-    EAutolockBgLayersN             = 2
-    };
-#else
-enum TAutolockBgLayers
-    {
-    EAutolockBgLayerBackground     = 0,
-    EAutolockBgLayerWallpaper      = 1,
-    EAutolockBgLayersN             = 2
-    };
-#endif //RD_FULLSCREEN_WALLPAPER
-
-        TInt aCallRect_x;
-        TInt aCallRect_y;
-        TInt aCallRect_width;
-        TInt aCallRect_height;
-// ================= MEMBER FUNCTIONS =======================
-
-// ---------------------------------------------------------
-// CAutolockContainer::ConstructL(const TRect& aRect)
-// Symbian OS two phased constructor
-// ---------------------------------------------------------
-//
-void CAutolockContainer::ConstructL(const TRect& aRect)
-    {
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockContainer::ConstructL"));
-    #endif
-    CreateWindowL();
-
-    HBufC* bitMapPath = HBufC::NewLC(KMaxPath);
-    TPtr BitmapFile(bitMapPath->Des());
-    BitmapFile.Append(_L("Z:"));
-    BitmapFile.Append(KDC_APP_BITMAP_DIR);
-    BitmapFile.Append(BitmapName);
-
-    iEikBitmap = 0;
-    iEikBitmapCall = 0;
-    AknsUtils::CreateIconL( 
-        AknsUtils::SkinInstance(), 
-        KAknsIIDQgnGrafPhoneLocked,
-        iBitmap,
-        iMask,
-        BitmapFile,
-        EMbmAutolockQgn_graf_phone_locked, 
-        EMbmAutolockQgn_graf_phone_locked_mask );
-    AknsUtils::CreateIconL( 
-        AknsUtils::SkinInstance(), 
-        KAknsIIDQgnGrafPhoneLocked,
-        iBitmapCall,
-        iMaskCall,
-        BitmapFile,
-        EMbmAutolockQgn_indi_button_end_call, 
-        EMbmAutolockQgn_indi_button_end_call_mask );
-    
-#ifdef RD_FULLSCREEN_WALLPAPER
-    TSize screenSize = iCoeEnv->ScreenDevice()->SizeInPixels();
-    TRect wallpaperRect( TPoint(0,0), screenSize );    
-    iBgContext = CAknsLayeredBackgroundControlContext::NewL(
-    KAknsIIDWallpaper, wallpaperRect, ETrue, EAutolockBgLayersN );
-    SetRect(aRect);
-#else    
-    // Create background control context for skins. Use parent absolute mode,
-    // as this is window owning control
-    iBgContext = CAknsLayeredBackgroundControlContext::NewL(
-        KAknsIIDQsnBgAreaMainIdle, aRect, ETrue, EAutolockBgLayersN );
-    iBgContext->SetLayerImage( EAutolockBgLayerWallpaper, KAknsIIDWallpaper );
-    iBgContext->SetLayerRect( EAutolockBgLayerWallpaper, aRect );
-    SetRect(aRect);
-#endif // RD_FULLSCREEN_WALLPAPER
-    ActivateL();
-
-    CleanupStack::PopAndDestroy(bitMapPath); //bitMapPath
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockContainer::ConstructL END"));
-    #endif
-    }
-
-
-// ---------------------------------------------------------
-// CAutolockContainer::~CAutolockContainer()
-// Destructor
-// ---------------------------------------------------------
-//
-CAutolockContainer::~CAutolockContainer()
-    {
-    delete iBgContext;
-    delete iBitmap;
-    delete iMask;
-    delete iBitmapCall;
-    delete iMaskCall;
-
-	}
-// ---------------------------------------------------------
-// CAutolockContainer::SizeChanged()
-// Called by framework when the view size is changed
-// ---------------------------------------------------------
-//
-void CAutolockContainer::SizeChanged()
-    {
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockContainer::SizeChanged()"));
-    #endif
-    
-    TRect mainPaneRect(Rect());
-    TAknLayoutRect idleTradPane;
-    idleTradPane.LayoutRect(mainPaneRect, AknLayoutScalable_Avkon::main_idle_trad_pane());
-
-    TInt variety = 3;
-    if (Layout_Meta_Data::IsLandscapeOrientation())
-        {
-        variety = 2;
-        }
-
-
-    TAknLayoutRect idlePaneG2;
-    idlePaneG2.LayoutRect(idleTradPane.Rect(), AknLayoutScalable_Avkon::main_idle_pane_g2(variety));
-
-    TInt callState = 0;
-	  RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallState, callState );
-    if ( callState == EPSCTsyCallStateNone || callState == EPSCTsyCallStateUninitialized )
-    	{
-    AknIconUtils::SetSize( iBitmap, idlePaneG2.Rect().Size() );
-    	}
-    else
-    	{
-		  TSize lockSize = TSize(0.8 * idlePaneG2.Rect().Size().iWidth, 0.8 * idlePaneG2.Rect().Size().iHeight);
-	    AknIconUtils::SetSize( iBitmap, lockSize );
-    	}
-		TSize callSize = TSize(60,60);
-    AknIconUtils::SetSize( iBitmapCall, callSize );
-    
-#ifdef  RD_FULLSCREEN_WALLPAPER
-    TSize screenSize = iCoeEnv->ScreenDevice()->SizeInPixels();
-    TRect wallpaperRect( TPoint(0,0), screenSize );    
-    iBgContext->SetLayerRect( EAutolockBgLayerBackground, Rect() ) ;
-    iBgContext->SetLayerRect( EAutolockBgLayerWallpaper, wallpaperRect ) ;
-    
-    TPoint origo( 0, 0);
-    iBgContext->SetParentPos(origo);
-#else
-
-    iBgContext->SetLayerRect( EAutolockBgLayerBackground, Rect() ) ;
-    iBgContext->SetLayerRect( EAutolockBgLayerWallpaper, Rect() ) ;
-     
-    TPoint positionRelativeToScreen = PositionRelativeToScreen();
-    //parent must be set when using parent absolute mode.
-    iBgContext->SetParentPos(positionRelativeToScreen);
-#endif //RD_FULLSCREEN_WALLPAPER
-
-        RRegion autolockRegion;
-#ifdef  RD_FULLSCREEN_WALLPAPER    	
-    	autolockRegion.AddRect( wallpaperRect);
-#else    	
-    	autolockRegion.AddRect(Rect());
-#endif //RD_FULLSCREEN_WALLPAPER   
-        Window().SetShape(autolockRegion);
-        autolockRegion.Close();
-    
-     #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockContainer::SizeChanged() END"));
-    #endif
-	 }
-// ---------------------------------------------------------
-// CAutolockContainer::CountComponentControls() const
-// ---------------------------------------------------------
-//
-TInt CAutolockContainer::CountComponentControls() const
-    {
-    TInt controlCount = 0;
-
-    return controlCount;
-    }
-
-// ---------------------------------------------------------
-// CAutolockContainer::ComponentControl(TInt aIndex) const
-// ---------------------------------------------------------
-//
-CCoeControl* CAutolockContainer::ComponentControl(TInt /*aIndex*/) const
-    {
-    return NULL;
-	} 
- // ---------------------------------------------------------
-// CAutolockContainer::Draw(const TRect& aRect) const
-// ---------------------------------------------------------
-//
-void CAutolockContainer::Draw(const TRect& aRect) const
-    {
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockContainer::Draw"));
-    #endif
-    if (AknLayoutUtils::PenEnabled() )
-    	{
-			TInt value = 0;
-			RProperty::Get(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, value);	    
-			if(value <= EAutolockOff)
-				{	// Avoid displaying the icon
-				#if defined(_DEBUG)
-				RDebug::Printf( "%s %s (%u) no Draw value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, value );
-				#endif
-				// If it returns, it will not handle orientation changes.
-				// However it will not really draw because the view is hidden
-				// return;
-				}
-			}
-
-    CWindowGc& gc = SystemGc();
-    gc.SetPenStyle(CGraphicsContext::ENullPen);
-    gc.SetBrushColor(KRgbWhite); 
-    gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
-    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
-    MAknsControlContext* cc = AknsDrawUtils::ControlContext( this );
-    AknsDrawUtils::Background( skin, cc, this, gc, aRect );
-
-    // Draw "lock" icon centered to this control    
-    // fist calculate the correct x coordinate based on this 
-    // controls rect and bitmap width    
-    TInt x = Rect().Width()/2 - iBitmap->SizeInPixels().iWidth /2;
-    // and do same with y
-    TInt y = Rect().Height()/2 - iBitmap->SizeInPixels().iHeight/2;
-		TInt width =iBitmap->SizeInPixels().iWidth;
-		TInt height =iBitmap->SizeInPixels().iHeight;
-		
-		TInt gripStatus = EPSHWRMGripClosed;
-		RProperty::Get( KPSUidHWRM, KHWRMGripStatus, gripStatus );
-		#if defined(_DEBUG)
-		RDebug::Printf( "%s %s (%u) gripStatus=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, gripStatus );
-		#endif
-		
-      TInt callState = 0;
-  	  RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallState, callState );
-    if ( callState == EPSCTsyCallStateNone || callState == EPSCTsyCallStateUninitialized )
-    	{
-    	}
-    else
-    	{
-			if (gripStatus != EPSHWRMGripOpen)
-    		y-=100;
-    	}
-    
-    if (iBitmap && iMask)
-        {
-          // gc.BitBltMasked(TPoint(x,y),iBitmap,TRect(TPoint(0,0),iBitmap->SizeInPixels()), iMask, ETrue);
-          gc.BitBltMasked(TPoint(x,y),iBitmap,TRect(TPoint(0,0),TPoint(width,height)), iMask, ETrue);
-    	  if ( callState == EPSCTsyCallStateNone || callState == EPSCTsyCallStateUninitialized )
-    	  	{
-    	  }
-    	  else
-    	  	{
-		    	if (gripStatus != EPSHWRMGripOpen)
-		    		{
-	   	    	aCallRect_x=Rect().Width()/2 - iBitmapCall->SizeInPixels().iWidth/2;
-		    		aCallRect_y=Rect().Height() * 0.75;
-		    		}
-		    	else
-		    		{
-		    		aCallRect_x=Rect().Width()* 0.75 - iBitmapCall->SizeInPixels().iWidth/2;
-		    		aCallRect_y = Rect().Height()/2-3*10;
-		    		}
-		    	aCallRect_width=iBitmapCall->SizeInPixels().iWidth;
-		    	aCallRect_height=iBitmapCall->SizeInPixels().iHeight;
-    	  	TSize cornerSize(20,20); 
-    	  	TSize cornerEllipseSize(cornerSize.iHeight*2,cornerSize.iWidth*2);
-    	  	TRect box(aCallRect_x-3*10	, aCallRect_y-3*10, aCallRect_x+aCallRect_width+3*10, aCallRect_y+aCallRect_height+3*10);
-					TRect cornerRectTl(box.iTl,cornerEllipseSize);
-					gc.SetBrushColor(KRgbRed); 
-					gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
-					gc.SetPenStyle(CGraphicsContext::EDottedPen);
-					gc.DrawRoundRect(box,cornerSize);
-        	gc.BitBltMasked(TPoint(aCallRect_x,aCallRect_y),iBitmapCall,TRect(TPoint(0,0),TPoint(aCallRect_width,aCallRect_height)), iMaskCall, ETrue);
-    	  	if (gripStatus != EPSHWRMGripOpen)
-    	  		aCallRect_y+=100;	// coordinates are relative to TRect, not to Screen
-    	  	
-    	  	// if active call, dismiss all pending notes. This avoids them on top of the BigRedButton
-    	  	CAknSoftNotifier *softNotifier = NULL;
-			    TRAPD (err, {
-			            softNotifier = CAknSoftNotifier::NewL();
-			            softNotifier->AddNotificationL(ESetIdleState, 0);
-			            // softNotifier->SetIdleStateL(EFalse);
-			    };)
-			    delete softNotifier;
-			    // during any call ,the touch need to be enabled, so that BigRedButton is available
-			    // It will be re-enabled when the call ends
-		    	RAknKeyLock keylock;
-			    if ( keylock.Connect() == KErrNone )
-				    {
-				    keylock.DisableWithoutNote();
-				    keylock.Close();
-				    }
-        	}
-        }
-    else if (iBitmap && !iMask)
-        {
-        gc.BitBlt(TPoint(x,y),iBitmap);
-    	  if ( callState == EPSCTsyCallStateNone || callState == EPSCTsyCallStateUninitialized )
-    	  	{
-    	  	}
-    	  else
-    	  	{
-        	gc.BitBlt(TPoint(x,y+iBitmap->SizeInPixels().iHeight),iBitmapCall);
-        	}
-        }
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockContainer::Draw END"));
-    #endif
-    }
-
-// ---------------------------------------------------------
-// CAutolockContainer::HandleControlEventL(
-//     CCoeControl* aControl,TCoeEvent aEventType)
-// ---------------------------------------------------------
-//
-void CAutolockContainer::HandleControlEventL(
-    CCoeControl* /*aControl*/,TCoeEvent /*aEventType*/)
-    {
-    }
-
-// ---------------------------------------------------------
-// CAutolockContainer::MopSupplyObject
-// 
-// ---------------------------------------------------------
-//
-TTypeUid::Ptr CAutolockContainer::MopSupplyObject( TTypeUid aId )
-    {
-    if (aId.iUid == MAknsControlContext::ETypeId)
-        {
-        return MAknsControlContext::SupplyMopObject( aId, iBgContext );
-        }
-    return CCoeControl::MopSupplyObject( aId );
-    }
-void CAutolockContainer::GiveCoords( TRect& aRect )
-    {
-    	aRect.iBr.iX=aCallRect_x;
-    	aRect.iBr.iY=aCallRect_y;
-    	aRect.iTl.iX=aCallRect_width+2*3*10;
-    	aRect.iTl.iY=aCallRect_height+2*3*10;
-    }
-// End of File  
--- a/securitydialogs/Autolock/src/AutolockDocument.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +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:
-*
-*/
-
-
-// INCLUDE FILES
-#include <apgwgnam.h>
-#include "AutolockDocument.h"
-#include "AutolockAppUiPS.h"
-
-// ================= MEMBER FUNCTIONS =======================
-//
-// ----------------------------------------------------
-// CAutolockDocument::ConstructL()
-// destructor.
-// ----------------------------------------------------
-//
-CAutolockDocument::~CAutolockDocument()
-    {
-    }
-// ----------------------------------------------------
-// CAutolockDocument::ConstructL()
-// Symbian OS default constructor can leave..
-// ----------------------------------------------------
-//
-void CAutolockDocument::ConstructL()
-    {
-    }
-// ----------------------------------------------------
-// CAutolockDocument::NewL()
-// Two-phased constructor.
-// ----------------------------------------------------
-//
-CAutolockDocument* CAutolockDocument::NewL(CEikApplication& aApp)     
-    {
-    CAutolockDocument* self = new (ELeave) CAutolockDocument( aApp );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop();
-    return self;
-    }
-// ----------------------------------------------------
-// CAutolockDocument::CreateAppUiL()
-// constructs CAutolockAppUi
-// ----------------------------------------------------
-//
-CEikAppUi* CAutolockDocument::CreateAppUiL()
-    {
-    return new (ELeave) CAutolockAppUi;
-    }
-
-// ----------------------------------------------------
-// CAutolockDocument::UpdateTaskNameL()
-// Sets app hidden...
-// ----------------------------------------------------
-//
-void CAutolockDocument::UpdateTaskNameL( CApaWindowGroupName* aWgName )
-	{
-	CEikDocument::UpdateTaskNameL( aWgName );
-	aWgName->SetHidden( ETrue );
-	}
-// End of File  
--- a/securitydialogs/Autolock/src/AutolockFpsStatusObserver.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +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:
-*
-*/
-
-#include <e32base.h>
-#include <e32debug.h>
-#include <AknCapServerDefs.h>
-#include <apgtask.h>
-#include "AutolockFpsStatusObserver.h"
-
-
-EXPORT_C CAutolockFpsStatusObserver* CAutolockFpsStatusObserver::NewL( MAutolockFpsStatusObserver* aObserver, RWsSession& aSession )
-    {
-    CAutolockFpsStatusObserver* self = new (ELeave) CAutolockFpsStatusObserver( aSession );
-    CleanupStack::PushL( self );
-    self->ConstructL( aObserver );
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-void CAutolockFpsStatusObserver::ConstructL( MAutolockFpsStatusObserver* aObserver )
-    {
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockFpsStatusObserver::ConstructL") );
-    #endif
-const TUid KUidFpsCategory = {0x1020507E };
-
-// PnS key
-const TUint32 KFpsAuthenticationKey = 0x00000001;
-
-    TInt err = iFpsStatus.Attach( KUidFpsCategory, KFpsAuthenticationKey );
-    if ( err )
-        {
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(AUTOLOCK)ERROR: Attach failed, err %d"), err );
-        #endif
-        }
-    iObserver = aObserver;
-    CActiveScheduler::Add( this );
-    iFpsStatus.Subscribe( iStatus );
-    SetActive();
-    }
-
-CAutolockFpsStatusObserver::CAutolockFpsStatusObserver( RWsSession& aSession ) : CActive( EPriorityIdle ), iSession( aSession )
-    {
-    }
-
-CAutolockFpsStatusObserver::~CAutolockFpsStatusObserver()
-    {
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockFpsStatusObserver::~CAutolockFpsStatusObserver") );
-    #endif
-    Cancel();
-    iFpsStatus.Close();
-    }
-
-void CAutolockFpsStatusObserver::DoCancel()
-    {
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockFpsStatusObserver::DoCancel") );
-    #endif
-    iFpsStatus.Cancel();
-    }
-
-void CAutolockFpsStatusObserver::RunL()
-    {
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockFpsStatusObserver::RunL") );
-    #endif
-    iFpsStatus.Subscribe( iStatus );
-    SetActive();
-    
-    TInt FpsStatus;
-    TInt err = iFpsStatus.Get( FpsStatus );
-    if( !err )
-    	{
-        FpsStatusChangedL( FpsStatus );
-        }
-    }
-
-void CAutolockFpsStatusObserver::FpsStatusChangedL( TInt aFpsStatus )
-    {
-const TUint32 ESwipeValid = 0x00000001;
-    if( aFpsStatus == ESwipeValid )
-    	{
-        #if defined(_DEBUG)
-    	RDebug::Print(_L("(AUTOLOCK)CAutolockFpsStatusObserver::FpsStatusChangedL => Fps opened"));
-    	#endif 
-    	if( iObserver->DeviceLockStatus() )
-    		{
-            #if defined(_DEBUG)
-        	RDebug::Print(_L("(AUTOLOCK)CAutolockFpsStatusObserver::FpsStatusChangedL => unlocking"));
-        	#endif
-		iObserver->DeviceFpsLock(1);
-    		}
-    	else
-    		{
-            #if defined(_DEBUG)
-        	RDebug::Print(_L("(AUTOLOCK)CAutolockFpsStatusObserver::FpsStatusChangedL => locking"));
-        	#endif
-		iObserver->DeviceFpsLock(0);
-    		}
-        }
-    }
-
-// End of File
--- a/securitydialogs/Autolock/src/AutolockGripStatusObserver.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,158 +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:
-*
-*/
-
-#include <e32base.h>
-#include <e32debug.h>
-#include <AknCapServerDefs.h>
-#include <apgtask.h>
-#include "AutolockGripStatusObserver.h"
-#include "AutolockApp.h"
-#include "AutolockAppUiInterface.h"
-#include <aknkeylock.h>
-
-
-EXPORT_C CAutolockGripStatusObserver* CAutolockGripStatusObserver::NewL( MAutolockAppUiInterface* aObserver, RWsSession& aSession )
-    {
-    CAutolockGripStatusObserver* self = new (ELeave) CAutolockGripStatusObserver( aSession );
-    CleanupStack::PushL( self );
-    self->ConstructL( aObserver );
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-void CAutolockGripStatusObserver::ConstructL( MAutolockAppUiInterface* aObserver )
-    {
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockGripStatusObserver::ConstructL") );
-    #endif
-    TInt err = iGripStatus.Attach( KPSUidHWRM, KHWRMGripStatus );
-    if ( err )
-        {
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(AUTOLOCK)ERROR: Attach failed, err %d"), err );
-        #endif
-        }
-    iObserver = aObserver;
-    CActiveScheduler::Add( this );
-    iGripStatus.Subscribe( iStatus );
-    SetActive();
-    }
-
-CAutolockGripStatusObserver::CAutolockGripStatusObserver( RWsSession& aSession ) : CActive( EPriorityIdle ), iSession( aSession )
-    {
-    }
-
-CAutolockGripStatusObserver::~CAutolockGripStatusObserver()
-    {
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockGripStatusObserver::~CAutolockGripStatusObserver") );
-    #endif
-    Cancel();
-    iGripStatus.Close();
-    }
-
-void CAutolockGripStatusObserver::DoCancel()
-    {
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockGripStatusObserver::DoCancel") );
-    #endif
-    iGripStatus.Cancel();
-    }
-
-void CAutolockGripStatusObserver::RunL()
-    {
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockGripStatusObserver::RunL") );
-    #endif
-    iGripStatus.Subscribe( iStatus );
-    SetActive();
-    
-    TInt gripStatus;
-    TInt err = iGripStatus.Get( gripStatus );
-    if( !err )
-    	{
-        GripStatusChangedL( gripStatus );
-        }
-    }
-
-void CAutolockGripStatusObserver::GripStatusChangedL( TInt aGripStatus )
-    {
-    #if defined(_DEBUG)
-	RDebug::Print(_L("(AUTOLOCK)CAutolockGripStatusObserver::::GripStatusChangedL"));
-	#endif   
-    if( aGripStatus == EPSHWRMGripOpen ) 
-    	{
-        #if defined(_DEBUG)
-    	RDebug::Print(_L("(AUTOLOCK)CAutolockGripStatusObserver::::GripStatusChangedL => Grip opened"));
-    	#endif 
-   		iObserver->ForceOrientation(0);
-    	if( !iObserver->DeviceLockQueryStatus() && iObserver->DeviceLockStatus() )
-    		{
-            #if defined(_DEBUG)
-        	RDebug::Print(_L("(AUTOLOCK)CAutolockGripStatusObserver::::GripStatusChangedL => send command"));
-        	#endif
-    	    //Grip opened
-        	TApaTaskList tasklist( iSession );
-        	/* this is old code. It was changed to a new one, following a suggestion from the Slide-handling team
-        	TApaTask capserver = tasklist.FindApp( KAknCapServerUid );
-        	if( capserver.Exists() )
-        	    {
-        	    TKeyEvent key;
-        	    key.iCode = EKeyDevice0;
-        	    key.iModifiers = 0;
-        	    key.iRepeats = 0;
-        	    key.iScanCode = EStdKeyDevice0;
-        	    capserver.SendKey( key );
-        	    }
-					*/
-					TApaTask capserver = tasklist.FindApp( KUidAutolock ); 
-					if( capserver.Exists() ) 
-					        { 
-					        TKeyEvent key; 
-					        key.iCode = EKeyBell; 
-					        capserver.SendKey( key ); 
-					        } 
-					RAknKeylock2 keylock; 
-					TInt error( keylock.Connect() ); 
-					if ( !error ) 
-					    { 
-					    keylock.DisableWithoutNote(); 
-					    keylock.Close(); 
-					    } 
-    		}
-        }
-    else
-        {
-        #if defined(_DEBUG)
-    	RDebug::Print(_L("(AUTOLOCK)CAutolockGripStatusObserver::::GripStatusChangedL => Grip closed"));
-    	#endif 
-   		iObserver->ForceOrientation(1);
-
-        //Grip closed
-        if( iObserver->DeviceLockQueryStatus() )
-        	{
-            #if defined(_DEBUG)
-        	RDebug::Print(_L("(AUTOLOCK)CAutolockGripStatusObserver::::GripStatusChangedL => send key event"));
-        	#endif
-            //the device lock query is on top
-        	//generate cancel key event
-        	iObserver->CancelDeviceLockQuery();
-            }
-        }
-    }
-
-// End of File
--- a/securitydialogs/Autolock/src/AutolockWait.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,168 +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: 
-*	
-*
-*/
-
-
-
-#include    <e32base.h>
-#include	<eikenv.h>
-#include	<eikappui.h>
-#include	"AutolockWait.h"
-
-
-
-// ================= MEMBER FUNCTIONS =======================
-//
-// ----------------------------------------------------------
-// CWait::NewL()	
-// 
-// ----------------------------------------------------------
-// 
-CWait* CWait::NewL()
-    {
-    CWait* self = new(ELeave) CWait();
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop();
-    return self;
-    }
-//
-// ----------------------------------------------------------
-// CSystemLock::ConstructL()	
-// 
-// ----------------------------------------------------------
-// 
-void CWait::ConstructL()	
-	{	
-	CActiveScheduler::Add(this);			
-	}	
-//
-// ----------------------------------------------------------
-// CWait::CWait()
-// 
-// ----------------------------------------------------------
-//
-CWait::CWait() : CActive(0)
-	{ 
-	}
-//
-// ----------------------------------------------------------
-// CWait::~CWait()
-// Destructor
-// ----------------------------------------------------------
-//
-CWait::~CWait()
-    {
-        Cancel();
-	}
-//
-// ----------------------------------------------------------
-// CWait::StartWaitForRequest
-// 
-// ----------------------------------------------------------
-//
-TInt CWait::WaitForRequestL()
-    {	
-	CWaitAbsorbingControl* absorbing = CWaitAbsorbingControl::NewLC();
-	SetActive();
-	iWait.Start();
-	CleanupStack::PopAndDestroy(absorbing);
-	return iStatus.Int();
-	}
-//
-// ----------------------------------------------------------
-// CWait::RunL()
-// 
-// ----------------------------------------------------------
-// 
-void CWait::RunL()
-	{
-	if(iWait.IsStarted())		
-	    iWait.AsyncStop();
-	}
-//
-// ----------------------------------------------------------
-// CWait::DoCancel()
-// Cancels code request
-// ----------------------------------------------------------
-//
-void CWait::DoCancel()
-    {
-    if(iWait.IsStarted())
-	    iWait.AsyncStop();
-    }
-
-//
-// ----------------------------------------------------------
-// CWait::SetRequestType
-// Sets active request type
-// ----------------------------------------------------------
-//
-void CWait::SetRequestType(TInt aRequestType)
-{
-    iRequestType = aRequestType;
-}
-
-//
-// ----------------------------------------------------------
-// CWait::GetRequestType
-// Gets active request type
-// ----------------------------------------------------------
-//
-TInt CWait::GetRequestType()
-{
-    return iRequestType;
-}
-
-//
-// class CWaitAbsorbingControl
-//
-CWaitAbsorbingControl::CWaitAbsorbingControl()
-	{
-	}
-
-CWaitAbsorbingControl::~CWaitAbsorbingControl()
-	{
-	if (iCoeEnv && iAppUi)
-		iAppUi->RemoveFromStack(this);
-	}
-
-CWaitAbsorbingControl* CWaitAbsorbingControl::NewLC()
-	{
-	CWaitAbsorbingControl* self= new(ELeave) CWaitAbsorbingControl();
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	return self;
-	}
-
-void CWaitAbsorbingControl::ConstructL()
-	{
-	CreateWindowL();
-	SetExtent(TPoint(0,0), TSize(0,0));
-	ActivateL();
-	SetPointerCapture(ETrue);
-	ClaimPointerGrab(ETrue);
-	iAppUi=iEikonEnv->EikAppUi();
-	iAppUi->AddToStackL(this, ECoeStackPriorityEnvironmentFilter);
-	}
-
-TKeyResponse CWaitAbsorbingControl::OfferKeyEventL(const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/)
-	{
-	return EKeyWasConsumed;
-	}
-
-// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/src/lockapp.hrh	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,96 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  General application spesific enumeration values
+ *
+*/
+
+
+#ifndef __LOCKAPP_HRH__
+#define __LOCKAPP_HRH__
+
+/**
+ *  LockApp panic codes
+ *
+ *  @lib    lockapp
+ *  @since  5.0
+ *  @author Joona Petrell
+ *  @author Tamas Koteles
+ */
+enum TLockAppPanic
+	{
+	ELockPanicGeneral,
+	ELockPanicIllegalMessage,
+	ELockUnknownValue,
+	ELockIllegalState,
+	ELockPanicOutOfRange,
+	ELockPanicObserverAlreadyExists,
+	ELockPanicObserverNotFound,
+	};
+
+/**
+ *  Three possible states of LockApp: unlocked, keyguard active, devicelock active
+ *
+ *  @lib    lockapp
+ *  @since  5.0
+ *  @author Joona Petrell
+ *  @author Tamas Koteles
+ */
+enum TLockStatus
+	{
+	ELockNotActive = 0,
+	EKeyguardActive,
+	EDevicelockActive
+	};
+
+/**
+ *  Three possible reason for devicelock: manual, remote, timer
+ *
+ *  @lib    lockapp
+ *  @since  5.0
+ *  @author Joona Petrell
+ *  @author Tamas Koteles
+ */
+enum TDevicelockReason
+	{
+	EDevicelockManual = 1,
+	EDevicelockRemote,
+	EDevicelockTimer
+	};
+
+/**
+ *  Bit-field representing screen saver status
+ */
+const TUint KLockAppEnvScreenSaverOn = 1;
+
+/**
+ *  Bit-field representing phonecall status
+ */
+const TUint KLockAppEnvPhonecallOngoing = 2;
+
+/**
+ *  Bit-field representing idle status
+ */
+const TUint KLockAppEnvIdleOnForeground = 4;
+
+/**
+ *  Bit-field representing grip status
+ */
+const TUint KLockAppEnvGrip = 8;
+
+/**
+ *  Bit-field representing FPS status
+ */
+const TUint KLockAppEnvFPS = 0x10;
+
+#endif // __LOCKAPP_HRH__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/src/main.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, version 2.1 of the License.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program.  If not, 
+* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
+*
+* Description:
+*
+*/
+
+// #include "xqservicelog.h"
+#include <QDebug>
+
+#include <QApplication>
+#include "Autolock.h"
+#include "../PubSub/securityuisprivatepskeys.h"
+
+#include <hbapplication.h>
+#include <hbmainwindow.h>
+
+int main(int argc, char **argv)
+{
+    // qInstallMsgHandler(XQSERVICEMESSAGEHANDLER);
+    // XQSERVICE_DEBUG_PRINT(" ================== xxxx Autolock::main");
+    qDebug() << "================== xxxx QApplication Autolock::main";
+    
+    
+    // Need to check whether process is already running. This happens if it's started from Stater, and 
+    // before fully initialized, it's started by API through QtHighway
+    TSecurityPolicy readPolicy(ECapabilityReadDeviceData);
+    TSecurityPolicy writePolicy(ECapabilityWriteDeviceData);
+    int ret = RProperty::Define(KPSUidSecurityUIs,
+            KSecurityUIsLockInitiatorUID, RProperty::EInt, TSecurityPolicy(TSecurityPolicy::EAlwaysPass),
+            writePolicy);
+		qDebug() << "KSecurityUIsLockInitiatorUID ret=" << ret;
+    int myInitiatorUID = 0;
+    int err = RProperty::Get(KPSUidSecurityUIs, KSecurityUIsLockInitiatorUID, myInitiatorUID);
+		qDebug() << "KSecurityUIsLockInitiatorUID err=" << err;
+		qDebug() << "KSecurityUIsLockInitiatorUID myInitiatorUID=" << myInitiatorUID;
+		err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsLockInitiatorUID, 0);
+
+    // it takes about 3 seconds to start it, on device
+    QApplication a( argc, argv );
+    Autolock *cl = new Autolock();
+    // qDebug() << " Autolock::main cl->show";
+    // cl->show();
+    // qDebug() << " Autolock::main cl->hide";
+    cl->hide();
+    // qDebug() << " Autolock::main cl->lower";
+    cl->lower();
+    qDebug() << " Autolock::main cl->lower";
+    err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsLockInitiatorUID, 1);
+    int rv = a.exec();
+    qDebug() << " Autolock::main cl->exec";
+    delete cl;
+    qDebug() << " Autolock::main cl->delete";
+    return rv;
+}
+
--- a/securitydialogs/SecUi/BWinsCw/SECUI_EKA2U.def	Thu Aug 19 10:45:23 2010 +0300
+++ b/securitydialogs/SecUi/BWinsCw/SECUI_EKA2U.def	Tue Aug 31 16:04:40 2010 +0300
@@ -46,4 +46,27 @@
 	?UnblockPinL@CManualSecuritySettings@@QAEHW4TPin@1@ABVTDesC16@@11@Z @ 45 NONAME ; int CManualSecuritySettings::UnblockPinL(enum CManualSecuritySettings::TPin, class TDesC16 const &, class TDesC16 const &, class TDesC16 const &)
 	?UnlockSimL@CManualSecuritySettings@@QAEHABVTDesC16@@0@Z @ 46 NONAME ; int CManualSecuritySettings::UnlockSimL(class TDesC16 const &, class TDesC16 const &)
 	?HandleEventL@CSecurityHandler@@QAEXW4TMobilePhoneSecurityEvent@RMobilePhone@@HAAH@Z @ 47 NONAME ; void CSecurityHandler::HandleEventL(enum RMobilePhone::TMobilePhoneSecurityEvent, int, int &)
+	?DisplayPermanentNoteL@CSecQueryUi@@QAEXABVTDesC16@@@Z @ 48 NONAME ; void CSecQueryUi::DisplayPermanentNoteL(class TDesC16 const &)
+	?DisplayErrorNoteL@CSecQueryUi@@QAEXABVTDesC16@@@Z @ 49 NONAME ; void CSecQueryUi::DisplayErrorNoteL(class TDesC16 const &)
+	?NewLC@CSecQueryUi@@SAPAV1@XZ @ 50 NONAME ; class CSecQueryUi * CSecQueryUi::NewLC(void)
+	?LaunchHelpL@CSecQueryUi@@QAEXABVTDesC16@@@Z @ 51 NONAME ; void CSecQueryUi::LaunchHelpL(class TDesC16 const &)
+	?ChangePin2ParamsL@CSecuritySettings@@QAEHV?$TBuf@$09@@0HAAVTDes16@@H@Z @ 52 NONAME ; int CSecuritySettings::ChangePin2ParamsL(class TBuf<10>, class TBuf<10>, int, class TDes16 &, int)
+	?InstallConfirmationQueryL@CSecQueryUi@@QAEHHAAV?$TBuf@$09@@@Z @ 53 NONAME ; int CSecQueryUi::InstallConfirmationQueryL(int, class TBuf<10> &)
+	?ChangePinParamsL@CSecuritySettings@@QAEHV?$TBuf@$09@@0HAAVTDes16@@H@Z @ 54 NONAME ; int CSecuritySettings::ChangePinParamsL(class TBuf<10>, class TBuf<10>, int, class TDes16 &, int)
+	?DisplayWarningNoteL@CSecQueryUi@@QAEXABVTDesC16@@@Z @ 55 NONAME ; void CSecQueryUi::DisplayWarningNoteL(class TDesC16 const &)
+	?DisplayInformationNoteL@CSecQueryUi@@QAEXABVTDesC16@@@Z @ 56 NONAME ; void CSecQueryUi::DisplayInformationNoteL(class TDesC16 const &)
+	?NewL@CSecQueryUi@@SAPAV1@XZ @ 57 NONAME ; class CSecQueryUi * CSecQueryUi::NewL(void)
+	?SecQueryDialog@CSecQueryUi@@QAEHABVTDesC16@@AAVTDes16@@HHH@Z @ 58 NONAME ; int CSecQueryUi::SecQueryDialog(class TDesC16 const &, class TDes16 &, int, int, int)
+	?ChangeUPinParamsL@CSecuritySettings@@QAEHV?$TBuf@$09@@0HAAVTDes16@@H@Z @ 59 NONAME ; int CSecuritySettings::ChangeUPinParamsL(class TBuf<10>, class TBuf<10>, int, class TDes16 &, int)
+	?CloseWaitNote@CSecQueryUi@@QAEXXZ @ 60 NONAME ; void CSecQueryUi::CloseWaitNote(void)
+	?UpdateProgressNoteValueL@CSecQueryUi@@QAEXH@Z @ 61 NONAME ; void CSecQueryUi::UpdateProgressNoteValueL(int)
+	?DisplayProgressNoteL@CSecQueryUi@@QAEXABVTDesC16@@H@Z @ 62 NONAME ; void CSecQueryUi::DisplayProgressNoteL(class TDesC16 const &, int)
+	?DisplayWaitNoteL@CSecQueryUi@@QAEXABVTDesC16@@AAVTRequestStatus@@@Z @ 63 NONAME ; void CSecQueryUi::DisplayWaitNoteL(class TDesC16 const &, class TRequestStatus &)
+	?ChangePinRequestParamsL@CSecuritySettings@@QAEHHV?$TBuf@$09@@HAAVTDes16@@H@Z @ 64 NONAME ; int CSecuritySettings::ChangePinRequestParamsL(int, class TBuf<10>, int, class TDes16 &, int)
+	?ChangeSecCodeParamsL@CSecuritySettings@@QAEHV?$TBuf@$09@@0HAAVTDes16@@H@Z @ 65 NONAME ; int CSecuritySettings::ChangeSecCodeParamsL(class TBuf<10>, class TBuf<10>, int, class TDes16 &, int)
+	?CloseProgressNoteL@CSecQueryUi@@QAEXXZ @ 66 NONAME ; void CSecQueryUi::CloseProgressNoteL(void)
+	?ClosePermanentNote@CSecQueryUi@@QAEXXZ @ 67 NONAME ; void CSecQueryUi::ClosePermanentNote(void)
+	?ChangeAutoLockPeriodParamsL@CSecuritySettings@@QAEHHV?$TBuf@$09@@HAAVTDes16@@H@Z @ 68 NONAME ; int CSecuritySettings::ChangeAutoLockPeriodParamsL(int, class TBuf<10>, int, class TDes16 &, int)
+	?LaunchHelpL@CSecQueryUi@@QAEXABVTDesC16@@ABVTUid@@@Z @ 69 NONAME ; void CSecQueryUi::LaunchHelpL(class TDesC16 const &, class TUid const &)
+	?AskSecCodeParamsL@CSecuritySettings@@QAEHAAV?$TBuf@$09@@HAAVTDes16@@H@Z @ 70 NONAME ; int CSecuritySettings::AskSecCodeParamsL(class TBuf<10> &, int, class TDes16 &, int)
 
--- a/securitydialogs/SecUi/EABI/Secuiu.def	Thu Aug 19 10:45:23 2010 +0300
+++ b/securitydialogs/SecUi/EABI/Secuiu.def	Tue Aug 31 16:04:40 2010 +0300
@@ -75,4 +75,29 @@
 	_ZTV23CManualSecuritySettings @ 74 NONAME ; #<VT>#
 	_ZTV5CWait @ 75 NONAME ; #<VT>#
 	_ZN16CSecurityHandler12HandleEventLEN12RMobilePhone25TMobilePhoneSecurityEventEiRi @ 76 NONAME
+	_ZN11CSecQueryUi11LaunchHelpLERK7TDesC16 @ 77 NONAME
+	_ZN11CSecQueryUi11LaunchHelpLERK7TDesC16RK4TUid @ 78 NONAME
+	_ZN11CSecQueryUi13CloseWaitNoteEv @ 79 NONAME
+	_ZN11CSecQueryUi14SecQueryDialogERK7TDesC16R6TDes16iii @ 80 NONAME
+	_ZN11CSecQueryUi16DisplayWaitNoteLERK7TDesC16R14TRequestStatus @ 81 NONAME
+	_ZN11CSecQueryUi17DisplayErrorNoteLERK7TDesC16 @ 82 NONAME
+	_ZN11CSecQueryUi18ClosePermanentNoteEv @ 83 NONAME
+	_ZN11CSecQueryUi18CloseProgressNoteLEv @ 84 NONAME
+	_ZN11CSecQueryUi19DisplayWarningNoteLERK7TDesC16 @ 85 NONAME
+	_ZN11CSecQueryUi20DisplayProgressNoteLERK7TDesC16i @ 86 NONAME
+	_ZN11CSecQueryUi21DisplayPermanentNoteLERK7TDesC16 @ 87 NONAME
+	_ZN11CSecQueryUi23DisplayInformationNoteLERK7TDesC16 @ 88 NONAME
+	_ZN11CSecQueryUi24UpdateProgressNoteValueLEi @ 89 NONAME
+	_ZN11CSecQueryUi25InstallConfirmationQueryLEiR4TBufILi10EE @ 90 NONAME
+	_ZN11CSecQueryUi4NewLEv @ 91 NONAME
+	_ZN11CSecQueryUi5NewLCEv @ 92 NONAME
+	_ZN17CSecuritySettings16ChangePinParamsLE4TBufILi10EES1_iR6TDes16i @ 93 NONAME
+	_ZN17CSecuritySettings17ChangePin2ParamsLE4TBufILi10EES1_iR6TDes16i @ 94 NONAME
+	_ZN17CSecuritySettings17ChangeUPinParamsLE4TBufILi10EES1_iR6TDes16i @ 95 NONAME
+	_ZN17CSecuritySettings20ChangeSecCodeParamsLE4TBufILi10EES1_iR6TDes16i @ 96 NONAME
+	_ZN17CSecuritySettings23ChangePinRequestParamsLEi4TBufILi10EEiR6TDes16i @ 97 NONAME
+	_ZN17CSecuritySettings27ChangeAutoLockPeriodParamsLEi4TBufILi10EEiR6TDes16i @ 98 NONAME
+	_ZTI11CSecQueryUi @ 99 NONAME
+	_ZTV11CSecQueryUi @ 100 NONAME
+	_ZN17CSecuritySettings17AskSecCodeParamsLER4TBufILi10EEiR6TDes16i @ 101 NONAME
 
--- a/securitydialogs/SecUi/GSSimSecPlugin/Data/10207438.rss	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +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 Device & SIM Security plugin.
-*
-*/
-
-// INCLUDES
-#include <ecom/registryinfo.rh>
-
-
-RESOURCE REGISTRY_INFO theInfo
-	{
-	dll_uid     = 0x10207438;
-	interfaces  = 
-		{
-		INTERFACE_INFO
-			{
-			interface_uid   = 0x10207236;
-			implementations = 
-				{
-				IMPLEMENTATION_INFO
-					{
-					implementation_uid  = 0x10207439;
-					version_no          = 1;
-					display_name        = "Device & SIM Security Plugin";
-					default_data        = "0x1020743A";
-					opaque_data         = "0";//Order number
-					}
-				};
-			}
-		};
-	}
-
-// End of File
-
--- a/securitydialogs/SecUi/GSSimSecPlugin/Data/GSSimSecPluginRsc.rss	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,609 +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:  Resource file for General Settings
-*
-*/
-
-
-
-//  RESOURCE IDENTIFIER
-NAME    SIMS // 4 letter ID
-
-//  INCLUDES
-#include <gssecurity.loc>
-#include "GSSimSecPlugin.hrh"
-#include "GSSimSecPlugin.rh"
-
-#include <avkon.loc> // Avkon localized strings
-#include <avkon.mbg>
-#include <avkon.rsg>
-#include <EIKCORE.rsg>
-#include <uikon.rh>
-#include <eikon.rh>
-#include <avkon.rh>
-
-// CONSTANTS
-
-//  RESOURCE DEFINITIONS 
-
-RESOURCE RSS_SIGNATURE
-    {
-    }
-
-
-
-//----------------------------------------------------
-//  r_gs_sim_security_view_caption
-// 
-// Security view caption for plugin
-//----------------------------------------------------
-//
-RESOURCE TBUF r_gs_sim_security_view_caption
-    {
-    buf = qtn_set_dev_sim_security;
-    }
-
-
-//----------------------------------------------------
-//   
-//    r_gs_sim_security_view_title
-//    Security view title
-//
-//----------------------------------------------------
-//
-
-RESOURCE TITLE_PANE r_gs_sim_security_view_title
-    {
-    txt = qtn_set_title_security_phone_and_sim;        
-    }
-
-//----------------------------------------------------
-//   
-//    r_gs_sim_security_softkeys_options_back__change
-//    SIM security view's CBA resource
-//
-//----------------------------------------------------
-//
-RESOURCE CBA r_gs_sim_security_softkeys_options_back__change
-    {
-    buttons =
-        {
-        CBA_BUTTON {id=EAknSoftkeyOptions; txt = text_softkey_option;},
-        CBA_BUTTON {id=EAknSoftkeyBack; txt = text_softkey_back; },
-        CBA_BUTTON {id=EAknSoftkeyChange; txt= qtn_msk_change; }
-        };
-    }
-
-//----------------------------------------------------
-//   
-//    r_gs_sim_security_view
-//    SIM security view's menu
-//
-//----------------------------------------------------
-//
-RESOURCE AVKON_VIEW r_gs_sim_security_view
-    {
-    menubar = r_gs_sim_sec_menubar_change_exit;  
-    cba = r_gs_sim_security_softkeys_options_back__change;
-    }
-
-// -----------------------------------------------------------------------------
-//
-// r_gs_menubar_change_exit
-// GS menu with 'change' and 'exit' items.
-//
-// -----------------------------------------------------------------------------
-//
-RESOURCE MENU_BAR r_gs_sim_sec_menubar_change_exit
-    {
-    titles =
-        {
-        MENU_TITLE
-            {
-            menu_pane = r_gs_sim_sec_menu_item_exit;
-            },
-        MENU_TITLE
-            {
-            menu_pane = r_gs_sim_sec_menu_item_help;
-            },
-        MENU_TITLE
-            {
-            menu_pane = r_gs_sim_sec_menu_item_change;
-            }
-        };
-    }
-
-// -----------------------------------------------------------------------------
-//
-// r_gs_menu_item_exit
-//
-// -----------------------------------------------------------------------------
-//
-RESOURCE MENU_PANE r_gs_sim_sec_menu_item_exit
-    {
-    items =
-        {
-        MENU_ITEM
-            {
-            command = EAknCmdExit;
-            txt = qtn_options_exit;
-            }
-        };
-    }
-
-
-// -----------------------------------------------------------------------------
-//
-// r_gs_menu_item_change
-// Change item.
-//
-// -----------------------------------------------------------------------------
-//
-RESOURCE MENU_PANE r_gs_sim_sec_menu_item_change
-    {
-    items =
-        {
-        MENU_ITEM
-            {
-            flags = EEikMenuItemAction;
-            command = EGSCmdAppChange;
-            txt = qtn_options_change;
-            }
-        };
-    }
-
-// -----------------------------------------------------------------------------
-//
-// r_gs_menu_item_help
-// Change item.
-//
-// -----------------------------------------------------------------------------
-//
-RESOURCE MENU_PANE r_gs_sim_sec_menu_item_help
-    {
-    items =
-        {
-        MENU_ITEM
-            {
-            command = EAknCmdHelp;
-            txt = qtn_options_help;
-            }
-        };
-    }
-
-//----------------------------------------------------
-//   
-//    r_sim_security_lbx
-//    SIM security view's list box items
-//
-//----------------------------------------------------
-//
-RESOURCE SIM_SEC_FEATURE_ARRAY r_sim_security_lbx
-    {
-    items =
-        {
-        SIM_SEC_FEATURE
-            {
-            txt = " \t"qtn_set_code_in_use"\t\t";
-            item = EGSSettIdCodeInUse;
-            type = EGSListBoxItemTypeIsDynamic;
-            },
-        SIM_SEC_FEATURE
-            {
-            txt = " \t"qtn_set_upin_code_req"\t\t";
-            item = EGSSettIdUpinRequest;
-            type = EGSListBoxItemTypeIsDynamic;            
-            },
-        SIM_SEC_FEATURE
-            {
-            txt = " \t"text_pin_code_cntrl"\t\t";
-            item = EGSSettIdPinRequest;
-	    type = EGSListBoxItemTypeIsDynamic;            
-            },
-        SIM_SEC_FEATURE
-            {
-            txt = " \t"text_pin_change"\t\t";
-            item = EGSSettIdPinCode;
-            type = EGSListBoxItemTypeIsDynamic;
-            },
-        SIM_SEC_FEATURE
-            {
-            txt = " \t"qtn_set_upin_code"\t\t";
-            item = EGSSettIdUpinCode;
-            type = EGSListBoxItemTypeIsDynamic;
-            },
-        SIM_SEC_FEATURE
-            {
-            txt = " \t"text_pin2_change"\t\t";
-            item = EGSSettIdPin2Code;
-            },
-        SIM_SEC_FEATURE
-            {
-            txt = " \t"qtn_set_autolock"\t\t";
-            item = EGSSettIdAutolock;
-            },
-        SIM_SEC_FEATURE
-            {
-            txt = " \t"qtn_set_sec_code"\t\t";
-            item = EGSSettIdSecurityCode;
-            },
-        SIM_SEC_FEATURE
-            {
-            txt = " \t"qtn_set_sim_change_sec"\t\t";
-            item = EGSSettIdSimChange;
-            },
-
-#ifdef RD_REMOTELOCK
-        SIM_SEC_FEATURE
-            {
-            txt = " \t"qtn_set_remotelock_status"\t\t";
-            item = EGSSettIdRemoteLock;
-            },
-#endif //RD_REMOTELOCK
-
-        SIM_SEC_FEATURE
-            {
-            txt = " \t"text_closed_user_groups"\t\t";
-            item = EGSSettIdClosedUserGroup;
-            type = EGSListBoxItemTypeIsDynamic;
-            },
-        SIM_SEC_FEATURE
-            {
-            txt = " \t"text_simatk_setting"\t\t";
-            item = EGSSettIdSatOperations;
-            type = EGSListBoxItemTypeIsDynamic;
-            },
-        SIM_SEC_FEATURE
-            {
-            txt = " \t"qtn_op_set_trusted_prov_server"\t\t ";
-            item = EGSSettIdTPServer;
-            type = EGSListBoxItemTypeIsDynamic;
-            }
-        };
-}
-
-//----------------------------------------------------
-//   
-//    r_autolock_array
-//    Autolock array items
-//
-//----------------------------------------------------
-//
-RESOURCE ARRAY r_autolock_array
-    {
-    items =
-        {
-        LBUF
-            {
-            txt = qtn_set_autolock_off;
-            },
-        LBUF
-            {
-            txt = qtn_set_autolock_min_one;
-            },
-        LBUF
-            {
-            txt = qtn_set_autolock_value_min;
-            }
-        };    
-    }
-
-#ifdef RD_REMOTELOCK
-//----------------------------------------------------
-//   
-//    r_remotelock_array
-//    Remote Lock status (on/off) array items
-//
-//----------------------------------------------------
-//
-RESOURCE ARRAY r_remotelock_array
-    {
-    items =
-        {
-        LBUF
-            {
-            txt = qtn_set_remotelock_on;
-            },
-        LBUF
-            {
-            txt = qtn_set_remotelock_off;
-            }
-        };    
-    }
-#endif // RD_REMOTELOCK
-
-//----------------------------------------------------
-//   
-//    r_pin_array
-//    PIN array items
-//
-//----------------------------------------------------
-//
-RESOURCE ARRAY r_pin_array
-    {
-    items =
-        {
-        LBUF
-            {
-            txt = text_pin_code_on;
-            },
-        LBUF
-            {
-            txt = text_pin_code_off;
-            }
-        };    
-    }
-
-//----------------------------------------------------
-//   
-//    r_upin_array
-//    UPIN array items
-//
-//----------------------------------------------------
-//
-RESOURCE ARRAY r_upin_array
-    {
-    items =
-        {
-        LBUF
-            {
-            txt = text_pin_code_on;
-            },
-        LBUF
-            {
-            txt = text_pin_code_off;
-            }
-        };    
-    }
-
-//----------------------------------------------------
-//   
-//    r_code_array
-//    Code in use array items
-//
-//----------------------------------------------------
-//
-RESOURCE ARRAY r_code_array
-    {
-    items =
-        {
-        LBUF
-            {
-            txt = qtn_set_pin;
-            },
-        LBUF
-            {
-            txt = qtn_set_upin;
-            }
-        };    
-    }
-
-
-//----------------------------------------------------
-//   
-//    r_security_array
-//    Security array items
-//
-//----------------------------------------------------
-//
-RESOURCE ARRAY r_security_array
-    {
-    items =
-        {
-        LBUF
-            {
-            txt = qtn_set_sim_change_sec_on;
-            },
-        LBUF
-            {
-            txt = qtn_set_sim_change_sec_off;
-            }
-        };    
-    }
-
-
-//----------------------------------------------------
-//   
-//    r_sat_array
-//    SAT array items
-//
-//----------------------------------------------------
-//
-RESOURCE ARRAY r_sat_array
-    {
-    items =
-        {
-        LBUF
-            {
-            txt = text_simatk_notes_off;
-            },
-        LBUF
-            {
-            txt = text_simatk_notes_on;
-            }
-        };    
-    }
-
-//----------------------------------------------------
-//   
-//    r_cug_network_default
-//
-//----------------------------------------------------
-//
-RESOURCE TBUF r_cug_network_default { buf = text_cug_default; }
-
-//----------------------------------------------------
-//   
-//    r_cug_on
-//
-//----------------------------------------------------
-//
-RESOURCE TBUF r_cug_on { buf = text_cug_group; }
-
-//----------------------------------------------------
-//   
-//    r_cug_off
-//
-//----------------------------------------------------
-//
-RESOURCE TBUF r_cug_off { buf = text_cug_suppress; }
-
-//----------------------------------------------------
-//   
-//    r_cug_index
-//    CUG Index dialog resource
-//
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_cug_index
-    {
-    flags=EGeneralQueryFlags; 
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
-    items =
-        {
-        DLG_LINE
-            {
-            type=EAknCtQuery;
-            id=EGeneralQuery;
-            control= AVKON_DATA_QUERY             
-                { 
-                layout = ENumberLayout;
-                label = text_give_group_number;
-                control = AVKON_INTEGER_EDWIN         
-                    {
-                    maxlength = 5;
-                    min=0;
-                    max=99999;
-                    };
-
-                };
-            }
-        };
-    }
-  
-//----------------------------------------------------
-//   
-//    r_cug_index_error_note
-//    CUG Index error note dialog resource
-//
-//----------------------------------------------------
-//  
-RESOURCE DIALOG r_cug_index_error_note
-    {
-    flags = EEikDialogFlagNoDrag | EEikDialogFlagNoTitleBar |
-            EEikDialogFlagCbaButtons | EEikDialogFlagWait;
-    buttons = R_AVKON_SOFTKEYS_EMPTY;
-    items =
-        {
-        DLG_LINE
-            {
-            type = EAknCtNote;
-            id = ECugIndexErrorNote;
-            control = AVKON_NOTE 
-                { 
-                layout = EGeneralLayout;
-                singular_label = text_cug_error;
-                animation = R_QGN_NOTE_ERROR_ANIM;
-                };
-            }
-        };
-    }            
-
-
-//----------------------------------------------------
-//   
-//    r_cug_setting_page
-//    CUG setting page dialog resource
-//
-//----------------------------------------------------
-//  
-RESOURCE AVKON_SETTING_PAGE r_cug_setting_page
-    { 
-    label= text_closed_user_groups;
-    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
-    type =  EAknSetListBox;
-    editor_resource_id= r_cug_listbox;
-    }
-
-//----------------------------------------------------
-//   
-//    r_cug_listbox
-//    CUG list box resource
-//
-//----------------------------------------------------
-//  
-RESOURCE LISTBOX r_cug_listbox
-    {
-    array_id = r_cug_lbx;
-    flags = EEikListBoxMultipleSelection;
-    }
-
-
-//----------------------------------------------------
-//   
-//    r_cug_lbx
-//    CUG list box items
-//
-//----------------------------------------------------
-//  
-RESOURCE ARRAY r_cug_lbx
-    {
-    items =
-        {
-        LBUF
-            {
-            txt = text_cug_default;
-            },
-        LBUF
-            {
-            txt = text_cug_group;
-            },
-        LBUF
-            {
-            txt = text_cug_suppress;
-            }
-
-        };
-    }    
-
-
-//----------------------------------------------------
-//   
-//    r_sat_setting_page
-//    SAT setting page resource
-//
-//----------------------------------------------------
-//  
-RESOURCE AVKON_SETTING_PAGE r_sat_setting_page
-    { 
-    label= text_simatk_setting;
-    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
-    type =  EAknSetListBox;
-    editor_resource_id= r_sat_listbox;
-    }
-
-//----------------------------------------------------
-//   
-//    r_sat_listbox
-//    SAT list box resource
-//
-//----------------------------------------------------
-//  
-RESOURCE LISTBOX r_sat_listbox
-    {
-    array_id = r_sat_array;
-    flags = EEikListBoxMultipleSelection;
-    }
-
-//End of File
--- a/securitydialogs/SecUi/GSSimSecPlugin/GSSimSecPlugin.mmp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +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:  Project specification file.
-*
-*/
-
-#include <platform_paths.hrh>
-
-#include  <data_caging_paths.hrh>    // For RESOURCE_FILES_DIR
-
-CAPABILITY          CAP_ECOM_PLUGIN
-TARGET              gssimsecplugin.dll
-TARGETTYPE          PLUGIN
-UID                 0x10009D8D 0x10207438
-VENDORID            VID_DEFAULT
-
-
-SOURCEPATH  Src
-SOURCE   GSSimSecPluginImplementationTable.cpp
-SOURCE   GSSimSecPlugin.cpp
-SOURCE   GSSimSecPluginContainer.cpp
-SOURCE   GSSimSecPluginModel.cpp
-SOURCE   GSPubSubsListener.cpp
-
-
-//User include paths
-USERINCLUDE     Inc
-USERINCLUDE     Data // For *.rh
-
-//System include paths
-APP_LAYER_SYSTEMINCLUDE
-
-
-SOURCEPATH      Data
-
-START RESOURCE  10207438.rss
-TARGET          gssimsecplugin.rsc
-END
-
-START RESOURCE  GSSimSecPluginRsc.rss
-HEADER
-TARGETPATH      RESOURCE_FILES_DIR
-LANGUAGE_IDS
-END
-
-
-
-LIBRARY   euser.lib
-LIBRARY   ecom.lib
-LIBRARY   efsrv.lib
-LIBRARY   avkon.lib
-LIBRARY   bafl.lib 
-LIBRARY   cone.lib 
-LIBRARY   eikcoctl.lib 
-LIBRARY   eikcore.lib 
-LIBRARY   egul.lib
-LIBRARY   eikdlg.lib            // eikon dialogs
-LIBRARY   flogger.lib           // File logging
-LIBRARY   commonengine.lib      // For RConeResourceLoader
-LIBRARY   featmgr.lib           // Feature manager 
-LIBRARY   centralrepository.lib
-LIBRARY   aknskinsrv.lib        // for enhanced skinning
-LIBRARY   aknskins.lib          // for enhanced skinning
-LIBRARY   secui.lib             // security
-LIBRARY   etelmm.lib            // security
-LIBRARY   sssettings.lib        // ss settings
-LIBRARY   hlplch.lib            // for "Help" options menu
-LIBRARY   gsecomplugin.lib
-LIBRARY   gsframework.lib       // For base classes
-LIBRARY   gslistbox.lib         // For CGSListBoxItemTextArray
-
-LIBRARY   scpclient.lib
-
-#ifdef RD_REMOTELOCK
-LIBRARY  rlocksettings.lib
-#endif
-
-SMPSAFE
-
-// End of File
\ No newline at end of file
--- a/securitydialogs/SecUi/GSSimSecPlugin/Inc/GSPubSubsListener.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,129 +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:  Listener for Publish and subscribe data.
-*
-*/
-
-
-#ifndef GSPUBSUBSLISTENER_H
-#define GSPUBSUBSLISTENER_H
-
-//  INCLUDES
-#include <e32base.h>
-#include <e32std.h>
-#include <e32property.h>
-
-// FORWARD DECLARATIONS
-class MGSSettingPSObserver;
-
-// CLASS DECLARATION
-
-/**
-*  RProperty poller.
-*
-*  @lib gs.lib
-*  @since Series 60 3.0
-*/
-NONSHARABLE_CLASS( CGSPubSubsListener ) : public CActive
-    {
-    public:  // Constructors and destructor
-        
-        /**
-        * Two-phased constructor.
-        * @param aUid the Uid to use
-        * @param aKey item's key
-        * @param aObserver callback interface for notification
-        * @return instance of CGSPubSubsListener
-        */
-        static CGSPubSubsListener* NewL( const TUid aUid, const TInt aKey, 
-                                         MGSSettingPSObserver* aObserver );
-        
-        /**
-        * Destructor.
-        */
-        virtual ~CGSPubSubsListener();
-        
-    public: // New functions.
-
-        /**
-        * Gets integer value from P & S.
-        * @param aVal a value in return
-        * @return error code
-        */       
-        TInt Get( TInt& aVal );
-
-        /**
-        * Gets 8 bit string value from P&S.
-        * @param aVal a value in return
-        * @return error code
-        */
-        TInt Get( TDes8& aVal );
-        
-        /**
-        * Gets 16 bit descriptor value from P&S.
-        * @param aVal a value in return
-        * @return error code
-        */
-        TInt Get( TDes16& aVal );
-        
-    private: // From CActive.
-
-        /** @see CActive::RunL */
-        virtual void RunL();
-
-        /** @see CActive::Cancel */
-        virtual void DoCancel();
-
-        /** @see CActive::RunError */
-        virtual TInt RunError( TInt aError );
-
-        /**
-        * Starts the listening (RunL).
-        */
-        void StartListening();
-
-    private:
-
-        /**
-        * C++ default constructor.
-        * @param aUid the Uid to use
-        * @param aKey item's key
-        * @param aObserver callback interface for notification
-        */
-        CGSPubSubsListener( const TUid aUid,  TInt aKey, 
-                            MGSSettingPSObserver* aObserver );
-
-        /**
-        * By default Symbian 2nd phase constructor is private.
-        */
-        void ConstructL();
-    
-    private:    // Data
-    
-        // UID of the monitored item.
-        TUid        iUid;
-        
-        // ID of the monitored item.
-        TInt        iId;
-        
-        // Property to subscribe to.
-        RProperty   iProperty;
-        
-        // The notification interface.
-        MGSSettingPSObserver* iCallback;
-    };
-
-#endif // GSPUBSUBSLISTENER_H
-
-// End of File
--- a/securitydialogs/SecUi/GSSimSecPlugin/Inc/GSSimSecPlugin.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,219 +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:  View for Device & SIM security plug-in.
-*
-*/
-
-
-#ifndef GSSIMSECPLUGIN_H
-#define GSSIMSECPLUGIN_H
-
-// INCLUDES
-#include "GSSimSecPluginContainer.h"
-#include "GSSimSecPluginModel.h"
-#include "MGSSettingPSObserver.h"
-#include "GSPubSubsListener.h"
-
-#include <aknsettingpage.h>
-#include <ConeResLoader.h>
-#include <gsplugininterface.h>
-#include <gsfwviewuids.h>
-#include <gsbaseview.h>
-#include <secuisecuritysettings.h>
-#include <RSSSettings.h>
-
-// CONSTANTS
-const TInt KMaxStringLength = 80;
-const TUid KGSSimSecPluginUid = { 0x10207438 };
-
-// MACROS
-
-// DATA TYPES
-
-// FUNCTION PROTOTYPES
-
-// FORWARD DECLARATIONS
-class CAknViewAppUi;
-class CGSSimSecPluginContainer;
-
-
-// CLASS DECLARATION
-
-/**
-*  CGSSimSecPlugin view class
-*
-*  View class for Sim Security sub-folder
-*/
-class CGSSimSecPlugin : public CGSBaseView,
-                        private MGSSettingPSObserver
-    {
-    public: // Constructors and destructor
-        
-        /**
-        * Symbian OS two-phased constructor
-        * @return GS sim & device security view.
-        */
-        static CGSSimSecPlugin* NewL( TAny* aInitParams );
-        
-        /**
-        * C++ default constructor.
-        */
-        CGSSimSecPlugin();
-
-        /**
-        * Symbian OS default constructor.
-        */
-        void ConstructL();
-
-        /**
-        * Destructor.
-        */
-        ~CGSSimSecPlugin();
-
-    public: // Functions from base classes
-        
-       /**
-        * Returns view id.
-        * @return TUid.
-        */
-        TUid Id() const;
-
-        /**
-        * Handles commands.
-        * @param aCommand Command to be handled.
-        * 
-        */
-        void HandleCommandL( TInt aCommand );
-
-    public: //new
-
-        /**
-        * Updates listbox's item's value.
-        * @param aItemId An item which is updated.
-        * 
-        */
-        void UpdateListBoxL( TInt aItemId );
-        
-        //From CGSBaseView
-        void HandleResourceChangeL( TInt aType );
-
-    public: // From CGSPluginInterface
-
-        /**
-        * @see CGSPluginInterface header file.
-        */
-        void GetCaptionL( TDes& aCaption ) const;
-        
-        /**
-        * @see CGSPluginInterface header file.
-        */
-        TInt PluginProviderCategory() const;
-
-        /**
-        * @see CGSPluginInterface header file.
-        */
-        TBool Visible() const;
-        
-    protected: // From MEikMenuObserver
-
-        void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
-
-    private: // from CAknView
-        /**
-        * Activates the view.
-        * @param aPrevViewId ID of previous view
-        * @param aCustomMessageId customized message ID
-        * @param aCustomMessage sutomized message payload
-        */
-        void DoActivateL( const TVwsViewId& aPrevViewId,
-                          TUid aCustomMessageId,
-                          const TDesC8& aCustomMessage );
-
-    private: // from CGSBaseView
-       
-        void NewContainerL();
-       
-        /**
-        * From CGSBaseView, handles list box selections.
-        * 
-        */
-        void HandleListBoxSelectionL();
- 
-    private:
-        /**
-        * Callback from MGSSettingPSObserver
-        */
-        void HandleNotifyPSL( const TUid aUid, const TInt& aKey, 
-                                      const TRequestStatus& aStatus );
-      
-    private: //new
-    	
-        /**
-        * Sets Autolock period
-        * 
-        */
-        void SetAutolockTimeL( TInt aPeriod );
-       
-        /**
-        * Set sat operations value (on/off).
-        * 
-        */
-       
-        void SetSatOperationsL();
-       
-        /**
-        * Set sat operations value with setting page(on/off).
-        * 
-        */
-        void SetSatWithSettingPageL();
-       
-        /**
-        * Shows closed user group index query
-        * @param aCugIndex Current Cug index
-        * @param aCugDefault Default CUG index
-        * @return TInt (query result)
-        */
-        TInt CugIndexQueryL( TInt& aCugIndex, TInt& aCugDefault );
-
-        /**
-        * Set closed user group setting
-        * 
-        */
-        void CugModeL();
-       
-        /**
-        * Get CGSSimSecPlugin's ccontainer.
-        */
-        CGSSimSecPluginContainer* Container();
-        
-        
-        TInt SetRemoteLockStatusL( TInt aAutoLockPeriod );
-        
-    private: // Data
-        //for CUG settings
-        RSSSettings        iCugSettings;
-        //to launch SecUI
-        CSecuritySettings* iSecurity;
-        //plugin model.
-        CGSSimSecPluginModel* iModel;
-        //resource loader
-        RConeResourceLoader iResourceLoader;
-        //PubSub object for BT SAP state
-        CGSPubSubsListener* iBtSapListener;
-
-    };
-
-#endif //GSSIMSECPLUGIN_H
-
-// End of File
--- a/securitydialogs/SecUi/GSSimSecPlugin/Inc/GSSimSecPlugin.hrh	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +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:  contains common definitions for menu id:s
-*
-*/
-
-
-#ifndef GSSIMSECPLUGIN_HRH
-#define GSSIMSECPLUGIN_HRH
-
-// Data query max length
-#define KGSMaxDataLength 21
-
-enum TSimSecMenuCommands
-    {
-    EGSCmdAppOpen = 1,
-    EGSCmdAppHelp,
-    EGSCmdAppChange,
-    EAppCmdChange
-    };
-
-enum TCugPopupIndex
-    {
-    EGSCugNetworkDefault = 0, 
-    EGSCugOn = 1,
-    EGSCugOff = 2
-    };
-
-enum TGSNotes
-    { 
-    EPasswordErrorNote,
-    EPasswordChangedNote,
-    ECugIndexErrorNote
-    };
-
-
-// Device & SIM security
-enum {
-    EGSSettIdPinRequest,
-    EGSSettIdPinCode,
-    EGSSettIdPin2Code,
-    EGSSettIdAutolock,
-    EGSSettIdSecurityCode,
-    EGSSettIdSimChange,
-    EGSSettIdClosedUserGroup,
-    EGSSettIdSatOperations,
-    EGSSettIdTPServer,
-    EGSSettIdUpinRequest,
-    EGSSettIdCodeInUse,
-    EGSSettIdUpinCode,
-    EGSSettIdDevAndSim,
-    EGSSettIdCertManUi,
-    EGSSettIdWlanEapPlugins,
-    EGSSettIdWimSecurity,
-    EGSSettIdTransTracking,
-    EGSSettIdAutoKeyguard,
-    EGSSettIdRemoteLock
-    };
-
-enum TGSListBoxItemVisibility
-    {
-    EGSListBoxItemTypeIsAlwaysVisible = 0,
-    EGSListBoxItemTypeIsDynamic
-    };
-#endif  //GSSIMSECPLUGIN_HRH
-
-//End of File
-
--- a/securitydialogs/SecUi/GSSimSecPlugin/Inc/GSSimSecPlugin.rh	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
-* Copyright (c) 2003-2005 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Contains common declarations for resources of GS.
-*                The file can be included only in resource file.
-*
-*/
-
-#ifndef GSSIMSEC_RH
-#define GSSIMSEC_RH
-
-
-// Global definitions
-
-
-// ---------------------------------------------------------
-//    sim_sec_feature_array
-//    Defines a structure to contain information about items 
-//    to be able to included in the listbox.
-// ---------------------------------------------------------
-//
-STRUCT SIM_SEC_FEATURE_ARRAY
-    {
-    STRUCT items[];
-    }
-
-// ---------------------------------------------------------
-//    sim_sec_feature
-//    Defines a structure that contains information about 
-//    a single listbox item.
-// ---------------------------------------------------------
-//
-STRUCT SIM_SEC_FEATURE
-    {
-    LTEXT txt = "";    
-    WORD item = -1;
-    BYTE type = EGSListBoxItemTypeIsAlwaysVisible;
-    }
-
-#endif // GSSIMSEC_RH
-// End of File
--- a/securitydialogs/SecUi/GSSimSecPlugin/Inc/GSSimSecPluginContainer.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,180 +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:  Container for the Display sub-folder
-*
-*/
-
-
-
-#ifndef GSSIMSECCONTAINER_H
-#define GSSIMSECCONTAINER_H
-
-// INCLUDES
-#include <secuisecuritysettings.h>
-#include <e32property.h>
-
-#include <gsbasecontainer.h>
-
-
-// FORWARD DECLARATION
-class CGSListBoxItemTextArray;
-class CGSSimSecPluginModel;
-
-// CLASS DECLARATION
-
-/**
-*  CGSSimSecPluginContainer container class
-*
-*  Container class for SIM security view
-*  @lib GSSimSecPlugin.lib
-*  @since Series 60_3.1
-*/
-class CGSSimSecPluginContainer : public CGSBaseContainer
-    {
-    public: // Constructors and destructor
-        
-        /**
-        * Symbian OS constructor.
-        * @param aRect Listbox's rect.
-        * 
-        */
-        void ConstructL( const TRect& aRect );
-
-        /**
-        * Destructor.
-        */
-        ~CGSSimSecPluginContainer();
-        
-        /**
-        * Constructor
-        */
-        CGSSimSecPluginContainer( CGSSimSecPluginModel* aModel );
-
-   public: // new
-        /**
-        * Updates the listbox items
-        * @param aFeatureId: selected listbox item ID
-        */
-        void UpdateListBoxL( TInt aFeatureId );
-		
-        /**
-        * Retrieves the feature id for the selected item in the listbox
-        * @return listbox item array's current feature.
-        */
-        TInt CurrentFeatureId() const;
-        
-        void HandleResourceChangeL( TInt aType );
-
-   protected: // from CGSBaseContainer
-       /**
-        * Constructs listbox.
-        * @param aResLbxId Resource id for listbox.
-        * 
-        */
-       void ConstructListBoxL( TInt aResLbxId );
-
-   private: //new
-        /**
-        * Creates list box items
-        */   
-        void CreateListBoxItemsL();
-        /**
-        * Creates Code in use item
-        */   
-        void MakeCodeInUseItemL();
-        /**
-        * Creates upin code request list box item
-        */  
-        void MakeUpinRequestItemL();
-        /**
-        * Creates pin code request list box item
-        */  
-        void MakePinRequestItemL();
-        /**
-        * Creates code list box item
-        *
-        * @ param aItemType TInt (code type pin/pin2/security)
-        */  
-        void MakeCodeItemL( const TInt aItemType );
-        /**
-        * Creates autolock list box item
-        */  
-        void MakeAutolockItemL();
-        /**
-        * Creates sim change security list box item
-        */  
-        void MakeSimChangeItemL();
-        /**
-        * Creates closed user group list box item
-        */  
-        void MakeClosedUserGroupItemL();
-        
-        /**
-        * Creates sat operations list box item
-        */  
-        void MakeSatOperationsItemL();
-
-        /**
-        * Creates Trusted provisioning server list box item
-        */  
-        void MakeTPServerItemL();
-        /**
-        * Recreates different pin code related list box items as needed
-        * after switching PIN codes from PIN to UPIN or vice versa.
-        */  
-        void RecreatePinItemsL();
-        
-        void MakeRemoteLockItemL();
-    private:
-        /**
-        * Required for help.
-        * 
-        */
-        void GetHelpContext( TCoeHelpContext& aContext ) const;
-   
-	private: //data
-        //Code in use item's text
-        CDesCArrayFlat* iCodeItems;
-        //UPIN item's text
-        CDesCArrayFlat* iUpinItems;
-        //autolock item's text
-        CDesCArrayFlat* iAutoLockItems;
-        // RemoteLock item's text
-        CDesCArrayFlat* iRemoteLockItems;
-        //PIN item's text
-        CDesCArrayFlat* iPinItems;
-        //security item's text
-        CDesCArrayFlat* iSecurityItems;
-        //SAT item's text
-        CDesCArrayFlat* iSatItems;
-        //items from resource 
-        CDesCArray* iItemArray;
-        //for SecUI 
-        CSecuritySettings* iSecurity;
-        //check if UPIN code is supported
-        TBool iUpinCodeSupported;
-        //check if UPIN code is active
-        TBool iUpinCodeActive;
-        //check if UPIN code is permanently rejected
-        TBool iUpinCodeRejected;
-        //GS listbox model
-		CGSListBoxItemTextArray* iListboxItemArray;
-        //Model pointer. Does not own it, so do not delete this pointer.
-        CGSSimSecPluginModel* iModel;
-
-    };
-
-#endif //GSSIMSECCONTAINER_H
-
-// End of File
--- a/securitydialogs/SecUi/GSSimSecPlugin/Inc/GSSimSecPluginModel.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,121 +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:  Model for Device & SIM security plug-in.
-*
-*/
-
-
-#ifndef GSSIMSECPLUGINMODEL_H
-#define GSSIMSECPLUGINMODEL_H
-
-// INCLUDES
-#include <e32base.h>
-#include <centralrepository.h>
-
-// CONSTANTS
-const TInt KGSBufSize128 = 128;
-
-// MACROS
-
-// DATA TYPES
-
-// FUNCTION PROTOTYPES
-
-// FORWARD DECLARATIONS
-
-// CLASS DEFINITION
-/**
-*  CGSSimSecPluginModel is the model class of device & sim security plugin.
-*  It provides functions to get and set setting values.
-*  @lib GSSimSecPlugin.lib
-*  @since Series 60_3.1
-
-*/
-class CGSSimSecPluginModel : public CBase
-    {
-    public:  // Constructor and destructor
-        /**
-        * Two-phased constructor
-        */
-        static CGSSimSecPluginModel* NewL();
-
-        /**
-        * Destructor
-        */
-        ~CGSSimSecPluginModel();
-        
-    public:
-        /**
-        * Returns the autolock period time (minutes). 
-        *
-        * @return TInt: period
-        */
-        TInt AutoLockPeriod();
-
-        /**
-        * Sets the autolock period. After this period device is locked.
-        * @param aLockTime TInt (minutes)
-        *
-        * @return ETrue: no errors
-        *         EFalse: an error has occurred
-        */
-        TBool SetAutoLockPeriod( const TInt aLockTime );
-
-        /**
-        * Returns SAT operations sate
-        *
-        * @return TInt 0: SAT operations off
-        *         TInt 1: SAT operations on
-        */
-        TInt SatOperations();
-
-        /**
-        * Sets SAT operations on/off
-        * @param aValue TInt (0 = off 1 =on)
-        *
-        * @return ETrue: no errors
-        *         EFalse: an error has occurred
-        */
-        TBool SetSatOperations( const TInt aValue );
-
-        /**
-        * Checking if SAT operations supported
-        * @return:
-        * 0: not supported
-        * 1: supported
-        */
-        TInt ConfirmSatOperationsSupport();
-
-    private: // Private constructors
-        /**
-        * Default C++ contructor
-        */
-        CGSSimSecPluginModel();
-
-        /**
-        * Symbian OS default constructor
-        * @return void
-        */
-        void ConstructL();
-        
-    private: // data
-        CRepository* iSecurityRepository;
-        CRepository* iPersonalizationRepository;
-    
-    };
-
-
-#endif //GSSIMSECPLUGINMODEL_H
-
-// End of File
\ No newline at end of file
--- a/securitydialogs/SecUi/GSSimSecPlugin/Inc/MGSSettingPSObserver.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +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:  Observer interface for indicating publish and subscribe 
-*               setting changes
-*
-*/
-
-
-
-#ifndef MGSSETTINGPSOBSERVER_H
-#define MGSSETTINGPSOBSERVER_H
-
-//  INCLUDES
-#include <e32std.h>
-
-// CLASS DECLARATION
-
-/**
-*  Observer interface for indicating setting changes
-*
-*  @lib GSSimSecPlugin
-*  @since 3.1
-*/
-class MGSSettingPSObserver
-    {
-    public:  // New functions
-
-        /**
-        * Handler for setting changed event
-        * @param aUid uid of setting        
-        * @param aId id of setting
-        * @param aStatus status of completed AO operation
-        */
-        virtual void HandleNotifyPSL( const TUid aUid, const TInt& aKey, 
-                                      const TRequestStatus& aStatus ) = 0;
-    };
-
-#endif // MGSSETTINGPSOBSERVER_H
-
-// End of File
--- a/securitydialogs/SecUi/GSSimSecPlugin/Src/GSPubSubsListener.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,155 +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:  Publish and subscribe settings listener.
-*
-*/
-
-
-// INCLUDE FILES
-#include "GSPubSubsListener.h"
-#include "MGSSettingPSObserver.h"
-
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// CGSPubSubsListener::CGSPubSubsListener
-// C++ constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-//
-CGSPubSubsListener::CGSPubSubsListener( const TUid aUid, const TInt aKey, 
-                                       MGSSettingPSObserver* aObserver ) 
-    : CActive( CActive::EPriorityStandard )
-    {
-    iUid = aUid;
-    iId = aKey;
-    iCallback = aObserver;
-    }
-
-// -----------------------------------------------------------------------------
-// CGSPubSubsListener::~CGSPubSubsListener
-// Destructor.
-// -----------------------------------------------------------------------------
-//
-CGSPubSubsListener::~CGSPubSubsListener()
-    {
-    Cancel();
-    iProperty.Close();
-    }
-
-// -----------------------------------------------------------------------------
-// CGSPubSubsListener::RunL
-// From CActive.
-// -----------------------------------------------------------------------------
-//
-void CGSPubSubsListener::RunL()
-    {
-    const TRequestStatus status( iStatus );
-    StartListening();
-    iCallback->HandleNotifyPSL( iUid, iId, status );
-    }
-
-// -----------------------------------------------------------------------------
-// CGSPubSubsListener::DoCancel
-// From CActive.
-// -----------------------------------------------------------------------------
-//
-void CGSPubSubsListener::DoCancel()
-    {
-    iProperty.Cancel();
-    }
-
-// -----------------------------------------------------------------------------
-// CGSPubSubsListener::RunError
-// From CActive.
-// -----------------------------------------------------------------------------
-//
-TInt CGSPubSubsListener::RunError( TInt /*aError*/ )
-    {
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// CGSPubSubsListener::NewL
-//
-// Symbian OS two phased constructor
-// -----------------------------------------------------------------------------
-//
-CGSPubSubsListener* CGSPubSubsListener::NewL( const TUid aUid, const TInt aKey,
-                                              MGSSettingPSObserver* aObserver )
-    {
-    CGSPubSubsListener* self = new( ELeave ) 
-        CGSPubSubsListener( aUid, aKey, aObserver );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop();
-    return self;
-    }
-
-// -----------------------------------------------------------------------------
-// CGSPubSubsListener::StartListening
-// -----------------------------------------------------------------------------
-//
-void CGSPubSubsListener::StartListening() 
-    {
-    iProperty.Subscribe( iStatus );
-    SetActive();
-    }
-
-// -----------------------------------------------------------------------------
-// CGSPubSubsListener::ConstructL
-//
-// Symbian OS default constructor
-// -----------------------------------------------------------------------------
-//
-void CGSPubSubsListener::ConstructL()
-    {
-    CActiveScheduler::Add( this );
-    
-    User::LeaveIfError ( iProperty.Attach( iUid, iId, EOwnerThread ) );
-    StartListening();
-    }
-
-// -----------------------------------------------------------------------------
-// CGSPubSubsListener::Get
-// Read integer value.
-// -----------------------------------------------------------------------------
-//
-TInt CGSPubSubsListener::Get( TInt& aVal )
-    {
-    return iProperty.Get( iUid, iId, aVal );
-    }
-
-// -----------------------------------------------------------------------------
-// CGSPubSubsListener::Get
-// Read binary value.
-// -----------------------------------------------------------------------------
-//
-TInt CGSPubSubsListener::Get( TDes8& aVal )
-    {
-    return iProperty.Get( iUid, iId, aVal );
-    }
-  
-// -----------------------------------------------------------------------------
-// CGSPubSubsListener::Get
-// Read string value.
-// -----------------------------------------------------------------------------
-//      
-TInt CGSPubSubsListener::Get( TDes16& aVal )
-    {
-    return iProperty.Get( iUid, iId, aVal );
-    }
-
-// End of File
--- a/securitydialogs/SecUi/GSSimSecPlugin/Src/GSSimSecPlugin.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,830 +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:  View for Device & SIM Security sub-folder
-*
-*/
-
-
-// INCLUDE FILES
-#include <coeaui.h>
-#include <hlplch.h>             // For HlpLauncher
-#include <bautils.h>
-#include <gulicon.h>
-#include <eikfrlbd.h>
-#include <eiktxlbx.h>
-#include <aknradiobuttonsettingpage.h>
-#include <aknPopup.h>
-#include <aknlists.h>
-#include <RSSSettings.h>
-#include <AknQueryDialog.h>
-#include <aknnotedialog.h>
-#include <aknViewAppUi.h>
-#include <featmgr.h>
-#include <StringLoader.h>
-#include <secui.h>
-#include <secuisecuritysettings.h>
-#include <BTSapDomainPSKeys.h>
-#include <e32property.h>
-
-#include <GSSimSecPluginRsc.rsg>
-#include <gsprivatepluginproviderids.h>
-#include <gsmainview.h>
-#include <gsbasecontainer.h>
-
-#include "GSSimSecPlugin.h"
-#include "GSSimSecPluginContainer.h"
-#include "GSSimSecPlugin.hrh"
-
-
-#ifdef RD_REMOTELOCK
-#include    <RemoteLockSettings.h>  
-#endif // RD_REMOTELOCK
-
-
-// EXTERNAL DATA STRUCTURES
-
-// EXTERNAL FUNCTION PROTOTYPES  
-
-// CONSTANTS
-
-// MACROS
-
-// LOCAL CONSTANTS AND MACROS
-const TInt KEmptyCugIndex( -100000000 );
-_LIT( KGSSimSecPluginResourceFileName, "z:GSSimSecPluginRsc.rsc" );
-
-// MODULE DATA STRUCTURES
-
-// LOCAL FUNCTION PROTOTYPES
-
-// FORWARD DECLARATIONS
-
-/**
-* CCugQuery
-* It defines CCugQuery used in closed user group settings
-*/
-class CCugQuery
-    : public CAknNumberQueryDialog
-    {
-    public: // Constructors and destructors
-        /**
-        * C++ constructor.
-        */
-        CCugQuery( TInt& aNumber,const TTone aTone = ENoTone );
-        /**
-        * Prepares the dialog, by constructing it from the specified resource. Overwrite the base class.
-        * @param aResourceId The resource ID of the dialog.
-        */
-        void PrepareLC( TInt aResourceId );
-        
-    protected: // From base classes
-        /**
-        * From CCAknNumberQueryDialog Left softkey is allways OK.
-        */
-        void  UpdateLeftSoftKeyL();
-    };
-
-// ============================= LOCAL FUNCTIONS ==============================
-
-// ========================= MEMBER FUNCTIONS =================================
-
-// ---------------------------------------------------------------------------
-// GSSimSecPlugin::NewL()
-// 
-// ---------------------------------------------------------------------------
-CGSSimSecPlugin* CGSSimSecPlugin::NewL( TAny* /*aInitParams*/ )
-    {
-    CGSSimSecPlugin* self = new( ELeave ) CGSSimSecPlugin();
-    
-    CleanupStack::PushL( self );
-    self->ConstructL();    
-    CleanupStack::Pop( self );
-
-    return self;
-    }
-
-
-// ---------------------------------------------------------------------------
-// GSSimSecPlugin::CGSSimSecPlugin()
-// 
-// ---------------------------------------------------------------------------
-CGSSimSecPlugin::CGSSimSecPlugin()
-    : iResourceLoader( *iCoeEnv )
-    {    
-    }
-
-
-// ---------------------------------------------------------------------------
-// CGSSimSecPlugin::ConstructL()
-// 
-// Symbian OS two-phased constructor
-// ---------------------------------------------------------------------------
-void CGSSimSecPlugin::ConstructL()
-    {
-    FeatureManager::InitializeLibL();
-
-    iModel = CGSSimSecPluginModel::NewL();
-    //PS listener initialization
-    iBtSapListener = CGSPubSubsListener::NewL( 
-                     KPSUidBluetoothSapConnectionState,
-                     KBTSapConnectionState, this );
-
-    iSecurity= CSecuritySettings::NewL();    
-    if(!FeatureManager::FeatureSupported( KFeatureIdFfNoCugSupport ))
-    {    
-    	User::LeaveIfError( iCugSettings.Open() );
-		}
-    // Find the resource file
-    TParse parse;
-    parse.Set( KGSSimSecPluginResourceFileName, 
-               &KDC_RESOURCE_FILES_DIR, NULL );
-    TFileName fileName( parse.FullName() );
-    
-    // Get language of resource file
-    BaflUtils::NearestLanguageFile( iCoeEnv->FsSession(), fileName );
-
-    // Open resource file
-    iResourceLoader.OpenL( fileName );
-    
-    BaseConstructL( R_GS_SIM_SECURITY_VIEW );
-
-    // secui resource file
-    TSecUi::InitializeLibL();
-    }
-
-
-// ---------------------------------------------------------------------------
-// CGSSimSecPlugin::~CGSSettListSecurityView()
-// 
-// 
-// ---------------------------------------------------------------------------
-CGSSimSecPlugin::~CGSSimSecPlugin()
-    {
-    FeatureManager::UnInitializeLib();
-    // close resource loader
-    iResourceLoader.Close();
-	if(!FeatureManager::FeatureSupported( KFeatureIdFfNoCugSupport ))
-    { 
-    iCugSettings.Close();
-  	}
-    if ( iSecurity )
-        {
-        delete iSecurity;
-        }
-
-    if ( iModel )
-        {
-        delete iModel;
-        }
-    delete iBtSapListener;
-
-    TSecUi::UnInitializeLib();  
-    }
-
-
-// ---------------------------------------------------------------------------
-// TUid CGSSettSimListSecurityView::Id()
-// 
-// 
-// ---------------------------------------------------------------------------
-TUid CGSSimSecPlugin::Id() const
-    {
-    return KGSSimSecPluginUid;
-    }
-
-
-// ---------------------------------------------------------------------------
-// CGSSimSecPlugin::HandleCommandL()
-// 
-// 
-// ---------------------------------------------------------------------------
-void CGSSimSecPlugin::HandleCommandL( TInt aCommand )
-    {
-    switch ( aCommand )
-        {
-        case EGSCmdAppChange:
-        case EAknSoftkeyChange:
-            {           
-            const TInt currentFeatureId = Container()->CurrentFeatureId();
-
-            if ( currentFeatureId != EGSSettIdSatOperations )
-                {
-                HandleListBoxSelectionL();
-                }
-            else
-                {
-                if(aCommand == EGSCmdAppChange)
-                    SetSatWithSettingPageL();
-                else //user pressed MSK, don't show setting page.
-                    SetSatOperationsL();
-                }
-            }
-            break;
-        case EAknSoftkeyBack:
-            iAppUi->ActivateLocalViewL( KGSSecurityPluginUid );  
-            break;
-        case EAknCmdHelp:
-            {
-            if( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
-                {
-                HlpLauncher::LaunchHelpApplicationL(
-                    iEikonEnv->WsSession(), iAppUi->AppHelpContextL() );
-                }
-            }
-            break;
-        default:
-            iAppUi->HandleCommandL( aCommand );
-            break;
-        }
-    }
-
-
-// ---------------------------------------------------------------------------
-// CGSSimSecPlugin::UpdateListBoxL
-// 
-// Update the current item in the listbox.
-// ---------------------------------------------------------------------------
-void CGSSimSecPlugin::UpdateListBoxL( TInt aItemId )
-    {
-    Container()->UpdateListBoxL( aItemId );
-    }
-
-
-// ---------------------------------------------------------------------------
-// CGSSimSecPlugin::DoActivateL(...)
-// 
-// 
-// ---------------------------------------------------------------------------
-void CGSSimSecPlugin::DoActivateL( const TVwsViewId& aPrevViewId, 
-                                   TUid aCustomMessageId, 
-                                   const TDesC8& aCustomMessage )
-    {
-    CGSBaseView::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage );    
-    }
-
-
-// ----------------------------------------------------------------------------
-// CGSSimSecPlugin::Container
-// 
-// Return handle to container class.
-// ----------------------------------------------------------------------------
-//
-CGSSimSecPluginContainer* CGSSimSecPlugin::Container()
-    {
-    return static_cast<CGSSimSecPluginContainer*>( iContainer );
-    }
-
-
-// ---------------------------------------------------------------------------
-// CGSSimSecPlugin::NewContainerL()
-// 
-// Creates new iContainer.
-// ---------------------------------------------------------------------------
-//
-void CGSSimSecPlugin::NewContainerL()
-    {
-    iContainer = new( ELeave ) CGSSimSecPluginContainer( iModel );
-    }
-
-
-// ---------------------------------------------------------------------------
-// CGSSimSecPlugin::HandleListBoxSelectionL()
-// 
-// 
-// ---------------------------------------------------------------------------
-void CGSSimSecPlugin::HandleListBoxSelectionL() 
-    {
-    const TInt currentFeatureId = Container()->CurrentFeatureId();
-    TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ));
-    TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin ));
-    switch ( currentFeatureId )
-        {
-        case EGSSettIdCodeInUse:
-            if(wcdmaSupported || upinSupported)
-                {
-	                if(iSecurity->SwitchPinCodesL())
-	                {
-	                	UpdateListBoxL( currentFeatureId );
-	              	}
-                }       
-            break;
-        case EGSSettIdUpinRequest:
-            if(wcdmaSupported || upinSupported)
-                 {
-                    if(iSecurity->ChangeUPinRequestL())
-                    {            
-                    	UpdateListBoxL( currentFeatureId );
-                    }
-                 }
-            break;
-        case EGSSettIdUpinCode:
-            if(wcdmaSupported || upinSupported)
-              {
-                  iSecurity->ChangeUPinL();
-              }
-            break;
-        case EGSSettIdPinRequest: 
-        		if(iSecurity->ChangePinRequestL())
-            {               
-            	UpdateListBoxL( currentFeatureId );
-            }
-            break;
-        case EGSSettIdPinCode:            
-            iSecurity->ChangePinL();
-            break;
-        case EGSSettIdPin2Code:
-            iSecurity->ChangePin2L();
-            break;
-        case EGSSettIdAutolock:        
-            SetAutolockTimeL( iSecurity->ChangeAutoLockPeriodL( 
-                                         iModel->AutoLockPeriod() ) );
-            break;
-        case EGSSettIdSecurityCode:
-            iSecurity->ChangeSecCodeL();
-            break;
-        case EGSSettIdSimChange:    
-            if(iSecurity->ChangeSimSecurityL())
-            {
-            	UpdateListBoxL( currentFeatureId );
-            }
-            break; 
-            
-#ifdef RD_REMOTELOCK
-        case EGSSettIdRemoteLock:
-            SetRemoteLockStatusL( iModel->AutoLockPeriod() );
-            break;
-            
-#endif                
-        case EGSSettIdClosedUserGroup:
-        	if(!FeatureManager::FeatureSupported( KFeatureIdFfNoCugSupport ))
-    		{        
-	            CugModeL();
-	            UpdateListBoxL( currentFeatureId );
-	          }
-            break;
-        case EGSSettIdSatOperations:
-            SetSatOperationsL();
-            break;
-        default:
-            break;
-        }
-    
-    }
-
-// ---------------------------------------------------------------------------
-// CGSSimSecPlugin::SetAutolockTimeL()
-// 
-// 
-// ---------------------------------------------------------------------------
-void CGSSimSecPlugin::SetAutolockTimeL( TInt aPeriod )
-    { 
-    iModel->SetAutoLockPeriod( aPeriod );
-    UpdateListBoxL( EGSSettIdAutolock );
-    }
-
-// ---------------------------------------------------------------------------
-// CGSSimSecPlugin::SetSatOperationsL()
-// 
-// 
-// ---------------------------------------------------------------------------
-void CGSSimSecPlugin::SetSatOperationsL()
-    {
-    TInt i = iModel->SatOperations();
-    
-    if ( i == 0 )
-        {
-        iModel->SetSatOperations( 1 );
-        }
-    else
-        {
-        iModel->SetSatOperations( 0 );
-        }
-    UpdateListBoxL( EGSSettIdSatOperations );
-    }
-
-// ---------------------------------------------------------------------------
-// CGSSimSecPlugin::SetSatOperationsL()
-// 
-// 
-// ---------------------------------------------------------------------------
-void CGSSimSecPlugin::SetSatWithSettingPageL()
-    {
-    TInt currentItem = iModel->SatOperations();
-
-    CDesCArrayFlat* items =  iCoeEnv->ReadDesC16ArrayResourceL( R_SAT_ARRAY );
-    CleanupStack::PushL( items );
-
-    CAknRadioButtonSettingPage* page = 
-        new( ELeave ) CAknRadioButtonSettingPage( R_SAT_SETTING_PAGE, 
-                                                  currentItem, items );
-
-    if ( page->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) )            
-        {    
-        iModel->SetSatOperations( currentItem );
-        }
-    
-    CleanupStack::PopAndDestroy( items );
-
-    UpdateListBoxL( EGSSettIdSatOperations );
-    }
-
-
-// ---------------------------------------------------------------------------
-// CGSSimSecPlugin::CugModeL()
-// 
-// 
-// ---------------------------------------------------------------------------
-void CGSSimSecPlugin::CugModeL()
-    {    
-    TInt cugIndex = 0;
-    TInt currentItem = 0;
-    TInt cugMode = 0;
-    TInt cugDefault;
-    TInt err = KErrNone;
-
-    err = iCugSettings.Get( ESSSettingsDefaultCug, cugDefault );
-    User::LeaveIfError( err );
-
-    
-    if ( iCugSettings.Get( ESSSettingsCug, cugMode ) != KErrNone )
-        {// getting mode was not succesful
-        cugMode = cugDefault;
-        }
-
-    if ( cugMode == cugDefault )
-        {
-        currentItem = EGSCugNetworkDefault;
-        if ( iCugSettings.PreviousCugValue( cugIndex ) != KErrNone )        
-            {
-            cugIndex = 0;
-            }
-        }
-    else
-        {
-        switch ( cugMode )
-            {
-            case ESSSettingsCugSuppress:
-                currentItem = EGSCugOff;
-                if ( iCugSettings.PreviousCugValue( cugIndex ) != KErrNone )
-                    {
-                    cugIndex = 0;
-                    }
-                break;
-            default:
-                currentItem = EGSCugOn;
-                cugIndex = cugMode;
-                break;
-            }
-        }
-
-
-    CDesCArrayFlat* items = iCoeEnv->ReadDesC16ArrayResourceL( R_CUG_LBX );
-    CleanupStack::PushL( items );
-
-    CAknRadioButtonSettingPage* page = 
-        new( ELeave ) CAknRadioButtonSettingPage( R_CUG_SETTING_PAGE, 
-                                                  currentItem, items );
-
-    // call the appropriate cug- methods here
-    if ( page->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) )    
-        {    
-        
-        switch ( currentItem )
-            {
-            case EGSCugNetworkDefault://cug mode set default, 
-                User::LeaveIfError( iCugSettings.Set( ESSSettingsCug, 
-                                                      cugDefault ) );
-                break;
-            case EGSCugOn: //1, index is queried, if query ok then
-                // set the index and mode
-                if ( CugIndexQueryL( cugIndex, cugDefault )  )
-                    {
-                    if ( iCugSettings.IsValueValidCugIndex( cugIndex ) )
-                        {
-                        User::LeaveIfError( iCugSettings.Set( ESSSettingsCug, 
-                                                              cugIndex ) );
-                        }
-                    else
-                        {
-                        User::LeaveIfError( iCugSettings.Set( ESSSettingsCug, 
-                                                              cugDefault ) );
-                        User::LeaveIfError( iCugSettings.ResetPreviousCugValue() );
-                        }
-                    }
-                break;
-            case EGSCugOff://2, sets cug mode "inactive"
-                User::LeaveIfError( iCugSettings.Set( ESSSettingsCug, 
-                                    ESSSettingsCugSuppress ) );
-                break;
-            default:
-                break;
-            }
-        }
-    CleanupStack::PopAndDestroy( items );
-    return;    
-    }
-
-
-// ---------------------------------------------------------------------------
-// CGSSimSecPlugin::CugIndexQueryL()
-// 
-// 
-// ---------------------------------------------------------------------------
-TInt CGSSimSecPlugin::CugIndexQueryL( TInt& aCugIndex, TInt& aCugDefault )
-    {    
-    while ( ETrue )
-        {
-        CCugQuery* dlg = new( ELeave ) CCugQuery( aCugIndex,
-                                       CAknQueryDialog::ENoTone );
-        dlg->PrepareLC( R_CUG_INDEX );
-        if ( dlg->RunLD() )
-            {
-            // check content validity (?-32767), 
-            // ui spec concerned only values above limit
-            if( !iCugSettings.IsValueValidCugIndex( aCugIndex )
-                && ( aCugIndex != KEmptyCugIndex )
-                && ( aCugIndex != aCugDefault ) )
-                {
-                CAknNoteDialog* dlg = new ( ELeave ) 
-                    CAknNoteDialog( CAknNoteDialog::EErrorTone, 
-                                    CAknNoteDialog::ELongTimeout );
-                dlg->ExecuteLD( R_CUG_INDEX_ERROR_NOTE );
-                }
-            else //index ok, break
-                {
-                break;
-                }
-            }
-        else // query cancelled
-            {
-            return EFalse;
-            }
-        }
-
-    return ETrue;    
-    }
-
-
-// ---------------------------------------------------------------------------
-// CCugQuery::CCugQuery()
-// 
-// ---------------------------------------------------------------------------
-//
-CCugQuery::CCugQuery( TInt& aNumber, const TTone aTone )
-    : CAknNumberQueryDialog( aNumber, aTone )
-    {
-    }
-
-
-// ---------------------------------------------------------------------------
-// CCugQuery::UpdateLeftSoftKeyL()
-// Left softkey is allways visible
-// ---------------------------------------------------------------------------
-//
-void CCugQuery::UpdateLeftSoftKeyL()
-    {
-    MakeLeftSoftkeyVisible( ETrue );
-    }
-
-// ---------------------------------------------------------------------------
-// CCugQuery::PrepareLC( TInt aResourceId )
-// 
-// ---------------------------------------------------------------------------
-//
-void CCugQuery::PrepareLC( TInt aResourceId )
-    {
-    CAknNumberQueryDialog::PrepareLC( aResourceId );
-    CAknQueryControl* queryControl = QueryControl();
-    if( queryControl )
-        {
-        CEikEdwin* edwin = static_cast< CEikEdwin* >( queryControl->ControlByLayoutOrNull( ENumberLayout ) );
-        if( edwin )
-            {
-            edwin->SetAknEditorNumericKeymap( EAknEditorPlainNumberModeKeymap );
-            }
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// CGSSimSecPlugin::HandleResourceChangeL( TInt aType )
-// Updates view layout
-//  
-// ---------------------------------------------------------------------------
-//
-void CGSSimSecPlugin::HandleResourceChangeL( TInt aType )
-    {
-    if( aType == KAknsMessageSkinChange ||
-        aType == KEikDynamicLayoutVariantSwitch )
-        {
-        //iContainer->HandleResourceChangeL( aType );
-        }
-    }
-
-
-// ---------------------------------------------------------------------------
-// CGSSimSecPlugin::HandleNotifyPSL
-//
-// Handling PS keys change
-// ---------------------------------------------------------------------------
-//  
-void CGSSimSecPlugin::HandleNotifyPSL( const TUid aUid, const TInt& aKey,
-                                       const TRequestStatus& /* aStatus */ )
-    {
-    if ( aUid == KPSUidBluetoothSapConnectionState && 
-         aKey == KBTSapConnectionState )
-        {
-        Visible();
-        }
-    }
-
-
-// ========================= From CGSPluginInterface ==================
-
-// ----------------------------------------------------------------------------
-// CGSSimSecPlugin::GetCaption
-// 
-// Return application/view caption.
-// ----------------------------------------------------------------------------
-//
-void CGSSimSecPlugin::GetCaptionL( TDes& aCaption ) const
-    {
-    // the resource file is already opened.
-    HBufC* result = StringLoader::LoadL( R_GS_SIM_SECURITY_VIEW_CAPTION );
-    
-    aCaption.Copy( *result );
-    delete result;
-    }
-    
-
-// ----------------------------------------------------------------------------
-// CGSSimSecPlugin::PluginProviderCategory
-// 
-// A means to identify the location of this plug-in in the framework.
-// ----------------------------------------------------------------------------
-//
-TInt CGSSimSecPlugin::PluginProviderCategory() const
-    {
-    //To identify internal plug-ins.
-    return KGSPluginProviderInternal;
-    }
-    
-
-// ----------------------------------------------------------------------------
-// CGSSimSecPlugin::Visible
-// 
-// Provides the visibility status of self to framework.
-// ----------------------------------------------------------------------------
-//    
-TBool CGSSimSecPlugin::Visible() const
-    {
-    TInt btSapConnectionState;
-    TBool visible = ETrue;
-
-    iBtSapListener->Get( btSapConnectionState );
-
-    if ( btSapConnectionState == EBTSapConnected )
-        {
-        visible = EFalse;
-        }
-    
-    return visible;
-    }
-
-
-
-// ---------------------------------------------------------------------------
-// CGSSimSecPlugin::SetRemoteLockStatusL()
-// 
-// 
-// ---------------------------------------------------------------------------
-TInt CGSSimSecPlugin::SetRemoteLockStatusL( TInt aAutoLockPeriod )
-    {
-    #ifdef RD_REMOTELOCK
-    #ifdef _DEBUG
-    RDebug::Print( _L( "(GS)CGSSettListSimSecurityView::SetRemoteLockStatusL() - Enter" ) );
-    #endif // DEBUG
-
-    TInt retValue( KErrNone );
-    TBool remoteLockStatus( EFalse );
-    TBuf<KRLockMaxLockCodeLength> remoteLockCode;
-
-    CRemoteLockSettings* remoteLockSettings = CRemoteLockSettings::NewLC();
-
-    // Get the current remote lock status 
-    if ( remoteLockSettings->GetEnabled( remoteLockStatus ) )
-        {
-        // Show remote lock setting page
-        retValue = iSecurity->ChangeRemoteLockStatusL( remoteLockStatus, remoteLockCode, aAutoLockPeriod );
-
-        if ( retValue == KErrNone )
-            {
-            if ( remoteLockStatus )
-                {
-                // Set remote lock status
-                if ( remoteLockSettings->SetEnabledL( remoteLockCode ) )
-                    {
-                    // Remote lock status was set successfully
-                    #ifdef _DEBUG
-                    RDebug::Print( _L( "(GS)CGSSettListSimSecurityView::SetRemoteLockStatusL() - Remote lock enabled and code set" ) );
-                    #endif // DEBUG
-                    }
-                else
-                    {
-                    // Failed to enabled remote lock 
-                    retValue = KErrGeneral;
-
-                    #ifdef _DEBUG
-                    RDebug::Print( _L( "(GS)CGSSettListSimSecurityView::SetRemoteLockStatusL() - remoteLockSettings->SetEnabledL failed" ) );
-                    #endif // DEBUG
-                    }
-                }
-            else
-                {
-                // Disable remote lock
-                if ( remoteLockSettings->SetDisabled() )
-                    {
-                    // Remote lock disabled
-                    #ifdef _DEBUG
-                    RDebug::Print( _L( "(GS)CGSSettListSimSecurityView::SetRemoteLockStatusL() - Remote lock disabled" ) );
-                    #endif // DEBUG
-                    }
-                else
-                    {
-                    // Failed to disable remote lock
-                    retValue = KErrGeneral;
-
-                    #ifdef _DEBUG
-                    RDebug::Print( _L( "(GS)CGSSettListSimSecurityView::SetRemoteLockStatusL() - remoteLockSettings->SetDisabled failed" ) );
-                    #endif // DEBUG
-                    }
-                }
-            }
-        else
-            {
-            // User interaction (setting page) failed for some reason
-            #ifdef _DEBUG
-            RDebug::Print( _L( "(GS)CGSSettListSimSecurityView::SetRemoteLockStatusL() - iSecurity->ChangeRemoteLockStatusL failed" ) );
-            #endif // DEBUG
-            }
-        }
-    else
-        {
-        // Failed to retreive the current remote lock status
-        retValue = KErrGeneral;
-
-        #ifdef _DEBUG
-        RDebug::Print( _L( "(GS)CGSSettListSimSecurityView::SetRemoteLockStatusL() - remoteLockSettings->GetEnabled failed" ) );
-        #endif // DEBUG
-        }
-
-    CleanupStack::PopAndDestroy( remoteLockSettings );
-    remoteLockSettings = NULL;
-
-    UpdateListBoxL( EGSSettIdRemoteLock );
-
-    #ifdef _DEBUG
-    RDebug::Print( _L( "(GS)CGSSettListSimSecurityView::SetRemoteLockStatusL() - Exit" ) );
-    #endif // DEBUG
-	return retValue;
-	#else //!RD_REMOTELOCK 
-    return KErrNotSupported;
-    #endif // RD_REMOTELOCK  
-    }
-    
-    
-// ----------------------------------------------------------------------------
-// CGSSimSecPlugin::DynInitMenuPaneL()
-// 
-// Display the dynamic menu
-// ----------------------------------------------------------------------------
-void CGSSimSecPlugin::DynInitMenuPaneL( TInt aResourceId,
-                                          CEikMenuPane* aMenuPane )
-    {
-
-	// show or hide the 'help' menu item when supported
-    if( aResourceId == R_GS_SIM_SEC_MENU_ITEM_HELP )
-        {
-        User::LeaveIfNull( aMenuPane );    
-        if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
-            {
-            aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse );
-            }
-        else
-            {
-            aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue );
-            }
-        }
-
-    } 
-// End of File  
--- a/securitydialogs/SecUi/GSSimSecPlugin/Src/GSSimSecPluginContainer.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,943 +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:  Container for the Device & SIM security sub-folder
-*
-*/
-
-
-#include "GSSimSecPluginContainer.h"
-#include "GSSimSecPluginModel.h"
-#include "GSSimSecPlugin.hrh"
-
-#include <aknlists.h>
-#include <etelmm.h>
-#include <RSSSettings.h>
-#include <StringLoader.h>
-#include <featmgr.h>
-#include <csxhelp/cp.hlp.hrh>
-#include <gsfwviewuids.h>
-#include <GSSimSecPluginRsc.rsg>
-#include <gslistbox.h>
-#include <AknsConstants.h>
-#include <secuisecuritysettings.h>
-
-
-#ifdef RD_REMOTELOCK
-#include <RemoteLockSettings.h>
-_LIT( KRemoteLockEmptyItem, " " );
-#endif
-
-#include    <SCPClient.h>                                                  
-// EXTERNAL DATA STRUCTURES
-
-// EXTERNAL FUNCTION PROTOTYPES  
-
-// CONSTANTS
-
-// MACROS
-
-// LOCAL CONSTANTS AND MACROS
-_LIT( CodeItem,"****" );
-_LIT( SecurityCodeItem, "*****" );
-
-const TInt KMaxStringLength = 50;
-
-// MODULE DATA STRUCTURES
-
-// LOCAL FUNCTION PROTOTYPES
-
-// FORWARD DECLARATIONS
-
-// ============================= LOCAL FUNCTIONS ==============================
-
-
-// ---------------------------------------------------------------------------
-// CGSSimSecPluginContainer::ConstructL()
-// 
-// Symbian OS two phased constructor
-// ---------------------------------------------------------------------------
-//
-void CGSSimSecPluginContainer::ConstructL( const TRect& aRect )
-    { 
-    iListBox = new( ELeave ) CAknSettingStyleListBox;
-    BaseConstructL( aRect, R_GS_SIM_SECURITY_VIEW_TITLE, R_SIM_SECURITY_LBX );
-    FeatureManager::InitializeLibL();
-    }
-
-
-// ---------------------------------------------------------------------------
-// CGSSimSecPluginContainer::~CGSSettListSecurityContainer()
-// 
-// Destructor 
-// ---------------------------------------------------------------------------
-//
-
-CGSSimSecPluginContainer::~CGSSimSecPluginContainer()
-    {
-    if(iCodeItems)
-        delete iCodeItems;
-    if(iUpinItems)
-        delete iUpinItems;
-    if(iAutoLockItems)
-        delete iAutoLockItems;
-    if(iPinItems)
-        delete iPinItems;
-    if(iSecurityItems)
-        delete iSecurityItems;
-    if(iSatItems)
-        delete iSatItems;
-    if(iSecurity)
-        delete iSecurity;
-    if(iListboxItemArray)
-        delete iListboxItemArray;
-#ifdef RD_REMOTELOCK
-    if(iRemoteLockItems)
-        delete iRemoteLockItems;
-#endif // RD_REMOTELOCK    
-FeatureManager::UnInitializeLib();
-    }
-
-
-// ---------------------------------------------------------------------------
-// CGSSimSecPluginContainer::CGSSimSecPluginContainer()
-// 
-// Constructor
-// ---------------------------------------------------------------------------
-//
-CGSSimSecPluginContainer::CGSSimSecPluginContainer(
-                          CGSSimSecPluginModel* aModel )
-    : iModel ( aModel )
-    {
-    }
-
-
-// ---------------------------------------------------------------------------
-// CGSSimSecPluginContainer::ConstructListBoxL()
-// 
-//  
-// ---------------------------------------------------------------------------
-//
-void CGSSimSecPluginContainer::ConstructListBoxL( TInt aResLbxId )
-    {
-    iSecurity= CSecuritySettings::NewL();
-    TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ));
-    TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin ));
-    if(wcdmaSupported || upinSupported)
-        {
-        //check if UPIN code is supported and not rejected
-        TBool resp = iSecurity->IsUpinSupportedL();
-        if( resp )
-            {
-            iUpinCodeSupported = ETrue;
-    
-            //check if UPIN code is active
-            if( iSecurity->IsUpinActive() )
-                {
-                iUpinCodeActive = ETrue;
-                }
-            else
-                {
-                iUpinCodeActive = EFalse;
-                }
-            
-            //Check whether UPIN is blocked
-            resp = iSecurity->IsUpinBlocked();
-    
-            if( !resp )
-                {
-                iUpinCodeRejected = EFalse;
-                }
-            else
-                {
-                iUpinCodeRejected = ETrue;    
-                }
-            }
-        else
-            {
-            iUpinCodeSupported = EFalse;
-            iUpinCodeActive = EFalse;
-            }
-        }
-    
-
-    iListBox->ConstructL( this, EAknListBoxSelectionList );
-    iListboxItemArray = CGSListBoxItemTextArray::NewL( aResLbxId, 
-                        *iListBox, *iCoeEnv );
-    iListBox->Model()->SetItemTextArray( iListboxItemArray );
-    iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
-
-    iAutoLockItems = iCoeEnv->ReadDesC16ArrayResourceL( R_AUTOLOCK_ARRAY );
-
-#ifdef RD_REMOTELOCK
-    #ifdef _DEBUG
-    RDebug::Print( _L( "(GS)CGSSettListSimSecurityContainer::ConstructListBoxL() - Reading R_REMOTELOCK_ARRAY resource" ) );
-    #endif // DEBUG
-
-    iRemoteLockItems = iCoeEnv->ReadDesC16ArrayResourceL( R_REMOTELOCK_ARRAY );
-#endif // RD_REMOTELOCK
-
-
-    if(wcdmaSupported || upinSupported)
-      {
-        iUpinItems = iCoeEnv->ReadDesC16ArrayResourceL( R_UPIN_ARRAY );
-        iCodeItems = iCoeEnv->ReadDesC16ArrayResourceL( R_CODE_ARRAY );
-      }
-    else
-        {
-        iUpinItems = NULL;
-        iCodeItems = NULL;
-        }
-
-    iPinItems = iCoeEnv->ReadDesC16ArrayResourceL( R_PIN_ARRAY );
-    iSecurityItems = iCoeEnv->ReadDesC16ArrayResourceL( R_SECURITY_ARRAY );
-    iSatItems = iCoeEnv->ReadDesC16ArrayResourceL( R_SAT_ARRAY );
-
-    CreateListBoxItemsL();
-    }
-
-
-// ---------------------------------------------------------------------------
-// CGSSettListIdleContainer::CreateListBoxItemsL()
-// 
-//  
-// ---------------------------------------------------------------------------
-//
-void CGSSimSecPluginContainer::CreateListBoxItemsL()
-    {
-    TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ));
-    TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin ));
-
-    if(wcdmaSupported || upinSupported)
-      {
-        if( iUpinCodeSupported && !iUpinCodeRejected )
-            {
-            MakeCodeInUseItemL();
-            }
-    
-        if( iUpinCodeActive )
-            {
-            MakeUpinRequestItemL();
-            MakeCodeItemL( EGSSettIdUpinCode );
-            }
-        else
-            {
-            MakePinRequestItemL();
-            MakeCodeItemL( EGSSettIdPinCode );
-            }
-       }
-    else //not wcdma or upin
-        {   
-            MakePinRequestItemL();
-            MakeCodeItemL( EGSSettIdPinCode );
-        }
-
-    MakeCodeItemL( EGSSettIdPin2Code );
-    MakeAutolockItemL();
-    
-#ifdef RD_REMOTELOCK
-    MakeRemoteLockItemL();
-#endif // RD_REMOTELOCK
-    
-    MakeCodeItemL( EGSSettIdSecurityCode );
-    MakeSimChangeItemL();
-		if(!FeatureManager::FeatureSupported( KFeatureIdFfNoCugSupport ))
-    	{ 
-    		#ifdef _DEBUG
-    		RDebug::Print( _L( "(GS)CGSSettListSimSecurityContainer::CreateListBoxItemsL() CUG supported!" ) );
-    		#endif // DEBUG
-    		MakeClosedUserGroupItemL();
-    	}
-    else
-    {
-    #ifdef _DEBUG
-    RDebug::Print( _L( "(GS)CGSSettListSimSecurityContainer::CreateListBoxItemsL() CUG Not supported!" ) );
-    #endif // DEBUG
-    }
-    
-    TInt support = iModel->ConfirmSatOperationsSupport();
-    
-    if ( support == 1 ) // Confirmation allowed.
-        {
-        MakeSatOperationsItemL();
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// CGSSettListIdleContainer::UpdateListBoxL( TInt aFeatureId )
-// 
-//  
-// ---------------------------------------------------------------------------
-//
-void CGSSimSecPluginContainer::UpdateListBoxL( TInt aFeatureId )
-    {
-    TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ));
-    TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin ));
-    switch( aFeatureId )
-        {
-        case EGSSettIdCodeInUse:
-            if(wcdmaSupported || upinSupported)
-              {
-                  RecreatePinItemsL();
-              }
-            break;
-        case EGSSettIdUpinRequest:
-            if(wcdmaSupported || upinSupported)
-              {
-                  MakeUpinRequestItemL();
-              }
-            break;
-        case EGSSettIdUpinCode:
-            if(wcdmaSupported || upinSupported)
-              {
-                  MakeCodeItemL( EGSSettIdUpinCode );
-              }
-            break;
-        case EGSSettIdPinRequest:
-            MakePinRequestItemL();
-            break;
-        case EGSSettIdPinCode:
-            MakeCodeItemL( EGSSettIdPinCode );
-            break;
-        case EGSSettIdPin2Code:
-            MakeCodeItemL( EGSSettIdPin2Code );
-            break;
-        case EGSSettIdAutolock:
-            MakeAutolockItemL();
-            break;
-        case EGSSettIdSecurityCode:
-            MakeCodeItemL( EGSSettIdSecurityCode );
-            break;
-        case EGSSettIdSimChange:
-            MakeSimChangeItemL();
-            break;
-            
-    #ifdef RD_REMOTELOCK
-        case EGSSettIdRemoteLock:
-            MakeRemoteLockItemL();
-            break;
-    #endif // RD_REMOTELOCK    
-        case EGSSettIdClosedUserGroup:
-        		if(!FeatureManager::FeatureSupported( KFeatureIdFfNoCugSupport ))
-    				{ 
-            	MakeClosedUserGroupItemL();
-            }
-            break;
-        case EGSSettIdSatOperations:
-            MakeSatOperationsItemL();
-            break;
-        default:
-            return;
-        }
-    
-    iListBox->HandleItemAdditionL();
-    }
-
-// ---------------------------------------------------------------------------
-// CGSSimSecPluginContainer::MakeCodeItemL()
-// 
-//  
-// ---------------------------------------------------------------------------
-//
-void CGSSimSecPluginContainer::MakeCodeItemL( const TInt aItemType )
-    {
-    HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 );
-    TPtr ptrBuffer ( dynamicText->Des() );
-    
-    TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ));
-    TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin ));
-
-    if(wcdmaSupported || upinSupported)
-      {
-        iUpinCodeSupported = iSecurity->IsUpinSupportedL();
-        iUpinCodeActive = iSecurity->IsUpinActive(); 
-        iUpinCodeRejected = iSecurity->IsUpinBlocked();
-      }
-    else
-      {
-        iUpinCodeSupported = EFalse;
-        iUpinCodeActive = EFalse; 
-        iUpinCodeRejected = EFalse;
-      }
-
-    switch ( aItemType )
-        {
-        case EGSSettIdUpinCode:
-            if( iUpinCodeSupported && !iUpinCodeRejected && iUpinCodeActive )
-                {
-                ptrBuffer =  CodeItem;
-                iListboxItemArray->SetDynamicTextL( EGSSettIdUpinCode, ptrBuffer );
-                iListboxItemArray->SetItemVisibilityL( EGSSettIdUpinCode,
-                                   CGSListBoxItemTextArray::EVisible );
-                }
-            else
-                {
-                iListboxItemArray->SetItemVisibilityL( EGSSettIdUpinCode,
-                                   CGSListBoxItemTextArray::EInvisible );
-                }
-            break;
-        case EGSSettIdPin2Code:
-            ptrBuffer =  CodeItem;
-            iListboxItemArray->SetDynamicTextL( EGSSettIdPin2Code, ptrBuffer );
-            iListboxItemArray->SetItemVisibilityL( EGSSettIdPin2Code, 
-                               CGSListBoxItemTextArray::EVisible );
-            break;
-        case EGSSettIdSecurityCode:
-            ptrBuffer =  SecurityCodeItem;
-            iListboxItemArray->SetDynamicTextL( EGSSettIdSecurityCode, 
-                                                ptrBuffer );
-        if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw ))
-        {
-        
-            {                                                      
-            // Check the code change policy from the SCP server.
-            TInt allowChange = 1;
-            
-            RSCPClient scpClient;
-            TInt ret = scpClient.Connect();
-            if ( ret == KErrNone )
-                {                                
-                TBuf<KSCPMaxIntLength> policyBuf;
-                policyBuf.Zero();
-                if ( scpClient.GetParamValue( ESCPCodeChangePolicy, policyBuf ) == KErrNone )
-                    {
-                    TLex lex( policyBuf );
-                    lex.Val( allowChange );
-                    #if defined(_DEBUG)
-                        RDebug::Print(_L("(GS)CGSSettListSimSecurityContainer::\
-                            MakeCodeInUseItemL(): Policy retrieved: %d"), allowChange );
-                    #endif //DEBUG                    
-                    }
-                else
-                    {
-                    #if defined(_DEBUG)
-                       RDebug::Print(_L("(GS)CGSSettListSimSecurityContainer::\
-                            MakeCodeInUseItemL(): ERROR: Failed to retrieve the policy value") );
-                    #endif //DEBUG                                                      
-                    }
-                scpClient.Close();
-                }
-            else
-                {
-                #if defined(_DEBUG)
-                    RDebug::Print(_L("(GS)CGSSettListSimSecurityContainer::MakeCodeInUseItemL(): \
-                        ERROR: Failed to connect to SCP") );
-                #endif //DEBUG                                  
-                }
-            
-            if ( allowChange == 1 )
-                {            
-                #if defined(_DEBUG)
-                    RDebug::Print(_L("(GS)CGSSettListSimSecurityContainer::MakeCodeInUseItemL(): \
-                        Code change allowed"));
-                #endif //DEBUG                                        
-        
-                iListboxItemArray->SetItemVisibilityL( EGSSettIdSecurityCode, 
-		        CGSListBoxItemTextArray::EVisible );		        				
-                }
-            else
-                {
-                #if defined(_DEBUG)
-                    RDebug::Print(_L("(GS)CGSSettListSimSecurityContainer::MakeCodeInUseItemL():\
-                        Code change disallowed"));
-                #endif //DEBUG
-                
-                iListboxItemArray->SetItemVisibilityL( EGSSettIdSecurityCode, 
-    		        CGSListBoxItemTextArray::EInvisible );
-                }
-            }
-            
-      }  
-      else
-      {      
-        
-            iListboxItemArray->SetItemVisibilityL( EGSSettIdSecurityCode, 
-                               CGSListBoxItemTextArray::EVisible );
-		                		        
-	}
-            break;
-        case EGSSettIdPinCode:
-        default:
-            if( !iUpinCodeSupported || iUpinCodeRejected || !iUpinCodeActive )
-                {
-                ptrBuffer =  CodeItem;
-                iListboxItemArray->SetDynamicTextL( EGSSettIdPinCode, 
-                                                    ptrBuffer );
-                iListboxItemArray->SetItemVisibilityL( EGSSettIdPinCode, 
-                                   CGSListBoxItemTextArray::EVisible );
-                }
-            else
-                {
-                iListboxItemArray->SetItemVisibilityL( EGSSettIdPinCode, 
-                                   CGSListBoxItemTextArray::EInvisible );
-                }
-            break;
-        }
-    CleanupStack::PopAndDestroy( dynamicText );
-    
-    }
-
-
-// ---------------------------------------------------------------------------
-// CGSSimSecPluginContainer::MakeAutolockItemL()
-// 
-//  
-// ---------------------------------------------------------------------------
-//
-void CGSSimSecPluginContainer::MakeAutolockItemL()
-    {
-    HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 );
-    TPtr ptrBuffer ( dynamicText->Des() );
-
-    TInt period = iModel->AutoLockPeriod();
-    
-    switch ( period )
-        {
-        case 0:
-            ptrBuffer = ( *iAutoLockItems )[ 0 ];
-            break;
-        case 1:
-            {
-            TBuf<KGSBufSize128> tempString;
-            StringLoader::Format( tempString, 
-                                ( ( *iAutoLockItems )[1] ),
-                                  -1, // no index in the key string
-                                  period );
-            ptrBuffer = tempString;
-            }
-            break;
-        default:
-            {
-            TBuf<KGSBufSize128> tempString;
-            StringLoader::Format( tempString, 
-                                ( ( *iAutoLockItems )[2] ),
-                                  -1, // no index in the key string
-                                  period );
-            ptrBuffer = tempString;
-            }
-            break;
-        }
-    iListboxItemArray->SetDynamicTextL( EGSSettIdAutolock, ptrBuffer );
-    CleanupStack::PopAndDestroy( dynamicText );
-    iListboxItemArray->SetItemVisibilityL( EGSSettIdAutolock, 
-                       CGSListBoxItemTextArray::EVisible );
-    }
-
-// ---------------------------------------------------------------------------
-// CGSSimSecPluginContainer::MakeSimChangeItemL()
-// 
-//  
-// ---------------------------------------------------------------------------
-//
-void CGSSimSecPluginContainer::MakeSimChangeItemL()
-    {
-    HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 );
-    TPtr ptrBuffer ( dynamicText->Des() );
-   
-    if ( iSecurity->IsLockEnabledL( RMobilePhone::ELockPhoneToICC ) )
-        {
-        ptrBuffer = ( *iSecurityItems )[0];
-        }
-    else
-        {
-        ptrBuffer = ( *iSecurityItems )[1];
-        }
-
-    iListboxItemArray->SetDynamicTextL( EGSSettIdSimChange, ptrBuffer );
-    CleanupStack::PopAndDestroy( dynamicText );
-    iListboxItemArray->SetItemVisibilityL( EGSSettIdSimChange, 
-                       CGSListBoxItemTextArray::EVisible );
-    }
-
-
-// ---------------------------------------------------------------------------
-// CGSSimSecPluginContainer:: MakePinRequestItemL()
-// 
-//  
-// ---------------------------------------------------------------------------
-//
-void CGSSimSecPluginContainer:: MakePinRequestItemL()
-    {
-    HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 );
-    TPtr ptrBuffer ( dynamicText->Des() );
-
-    TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ));
-    TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin ));
-    if(wcdmaSupported || upinSupported)
-      {
-        iUpinCodeSupported = iSecurity->IsUpinSupportedL();
-        iUpinCodeActive = iSecurity->IsUpinActive(); 
-        iUpinCodeRejected = iSecurity->IsUpinBlocked();
-      }
-    else
-        {
-         iUpinCodeSupported = EFalse;
-         iUpinCodeActive = EFalse; 
-         iUpinCodeRejected = EFalse;       
-        }
-
-    if( !iUpinCodeSupported || !iUpinCodeActive || iUpinCodeRejected )
-        {
-        if ( iSecurity->IsLockEnabledL( RMobilePhone::ELockICC ) )
-            {
-            ptrBuffer = ( *iPinItems )[0];
-            }
-        else
-            {
-            ptrBuffer = ( *iPinItems )[1];
-            }   
-
-        iListboxItemArray->SetDynamicTextL( EGSSettIdPinRequest, ptrBuffer );
-        iListboxItemArray->SetItemVisibilityL( EGSSettIdPinRequest, 
-                           CGSListBoxItemTextArray::EVisible );
-        }
-    else
-        {
-        iListboxItemArray->SetItemVisibilityL( EGSSettIdPinRequest, 
-                           CGSListBoxItemTextArray::EInvisible );
-        }
-    CleanupStack::PopAndDestroy( dynamicText );
-    }
-
-
-// ---------------------------------------------------------------------------
-// CGSSimSecPluginContainer:: MakeUpinRequestItemL()
-// 
-//  
-// ---------------------------------------------------------------------------
-//
-void CGSSimSecPluginContainer:: MakeUpinRequestItemL()
-    {
-    TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ));
-    TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin ));
-    if(wcdmaSupported || upinSupported)
-      {   
-        HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 );
-        TPtr ptrBuffer ( dynamicText->Des() );
-    
-        iUpinCodeSupported = iSecurity->IsUpinSupportedL();
-        iUpinCodeActive = iSecurity->IsUpinActive();
-        iUpinCodeRejected = iSecurity->IsUpinBlocked();
-    
-    
-        if( iUpinCodeSupported && !iUpinCodeRejected && iUpinCodeActive )
-            {
-        
-            if ( iSecurity->IsLockEnabledL( RMobilePhone::ELockUniversalPin ) )
-                {
-                ptrBuffer = ( *iPinItems )[0];
-                }
-            else
-                {
-                ptrBuffer = ( *iPinItems )[1];
-                }
-    
-            iListboxItemArray->SetDynamicTextL( EGSSettIdUpinRequest, ptrBuffer );
-            iListboxItemArray->SetItemVisibilityL( EGSSettIdUpinRequest, 
-                               CGSListBoxItemTextArray::EVisible );
-            }
-        else
-            {
-            iListboxItemArray->SetItemVisibilityL( EGSSettIdUpinRequest,
-                               CGSListBoxItemTextArray::EInvisible );
-            }
-        
-        CleanupStack::PopAndDestroy( dynamicText );
-      }
-    }
-
-
-// ---------------------------------------------------------------------------
-// CGSSimSecPluginContainer:: MakeCodeInUseItemL()
-// 
-//  
-// ---------------------------------------------------------------------------
-//
-void CGSSimSecPluginContainer:: MakeCodeInUseItemL()
-    {
-    TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ));
-    TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin ));
-    if(wcdmaSupported || upinSupported)
-      {
-        HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 );
-        TPtr ptrBuffer ( dynamicText->Des() );
-        iUpinCodeSupported = iSecurity->IsUpinSupportedL();
-        iUpinCodeRejected = iSecurity->IsUpinBlocked();
-        if( iUpinCodeSupported && !iUpinCodeRejected )
-            {
-            if ( !iSecurity->IsUpinActive() )
-                {
-                ptrBuffer = ( *iCodeItems )[0];
-                }
-            else
-                {
-                ptrBuffer = ( *iCodeItems )[1];
-                }
-    
-            iListboxItemArray->SetDynamicTextL( EGSSettIdCodeInUse, ptrBuffer );
-            iListboxItemArray->SetItemVisibilityL( EGSSettIdCodeInUse, 
-                               CGSListBoxItemTextArray::EVisible );
-            }
-        else
-            {
-    
-             iListboxItemArray->SetItemVisibilityL( EGSSettIdCodeInUse, 
-                                CGSListBoxItemTextArray::EInvisible );
-            }
-        
-        CleanupStack::PopAndDestroy( dynamicText );
-      }
-    }
-
-
-// ---------------------------------------------------------------------------
-// CGSSimSecPluginContainer:: MakeClosedUserGroupItemL()
-// 
-//  
-// ---------------------------------------------------------------------------
-//
-void CGSSimSecPluginContainer::MakeClosedUserGroupItemL()
-    {
-    HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 );
-    TPtr ptrBuffer ( dynamicText->Des() );
-
-    TInt cugMode = 0;
-    TInt cugDefault;
-    TInt err = KErrNone;
-
-    RSSSettings cugSettings;
-    User::LeaveIfError( cugSettings.Open() );
-
-    err = cugSettings.Get( ESSSettingsDefaultCug, cugDefault );
-    User::LeaveIfError( err );
-
-    if ( cugSettings.Get( ESSSettingsCug , cugMode ) != KErrNone )
-        {// getting mode was not succesful
-        cugMode = cugDefault;
-        }
-    
-    TBuf<KMaxStringLength> string;
-
-    if ( cugMode == cugDefault )
-        {
-        StringLoader::Load( string, R_CUG_NETWORK_DEFAULT );
-        ptrBuffer = string;
-        }
-    else
-        {
-        switch ( cugMode )
-            {
-            case ESSSettingsCugSuppress:
-                StringLoader::Load( string, R_CUG_OFF );
-                ptrBuffer = string;    
-                break;
-            default:
-                StringLoader::Load( string, R_CUG_ON );
-                ptrBuffer = string;    
-                break;
-            }
-        }
-    
-    cugSettings.Close();
-    
-    iListboxItemArray->SetDynamicTextL( EGSSettIdClosedUserGroup, ptrBuffer );
-    iListboxItemArray->SetItemVisibilityL( EGSSettIdClosedUserGroup, 
-                       CGSListBoxItemTextArray::EVisible );
-    CleanupStack::PopAndDestroy( dynamicText );
-
-    }
-
-
-// ---------------------------------------------------------------------------
-// CGSSimSecPluginContainer:: MakeSatOperationsItemL()
-// 
-//  
-// ---------------------------------------------------------------------------
-//
-void CGSSimSecPluginContainer::MakeSatOperationsItemL()
-    {
-    HBufC* dynamicText = HBufC::NewLC( KGSBufSize128 );
-    TPtr ptrBuffer ( dynamicText->Des() );
-
-    TInt satOperation = iModel->SatOperations();
-        
-    if ( satOperation == 1 )
-        {
-        ptrBuffer = ( *iSatItems )[1];
-        }
-    else
-        {
-        ptrBuffer = ( *iSatItems )[0];
-        }
-
-    iListboxItemArray->SetDynamicTextL( EGSSettIdSatOperations, ptrBuffer );
-    iListboxItemArray->SetItemVisibilityL( EGSSettIdSatOperations, 
-                       CGSListBoxItemTextArray::EVisible );
-    CleanupStack::PopAndDestroy( dynamicText );
-
-    }
-
-
-// ---------------------------------------------------------------------------
-// CGSSimSecPluginContainer::CurrentFeatureId()
-//  
-// ---------------------------------------------------------------------------
-//
-TInt CGSSimSecPluginContainer::CurrentFeatureId() const
-    {
-    return iListboxItemArray->CurrentFeature( );
-    }
-
-
-// ---------------------------------------------------------------------------
-// CGSSimSecPluginContainer::GetHelpContext() const
-// Gets Help 
-//  
-// ---------------------------------------------------------------------------
-//
-void CGSSimSecPluginContainer::GetHelpContext( TCoeHelpContext& aContext ) const
-    {
-    aContext.iMajor = KUidGS;
-    aContext.iContext = KSET_HLP_SECURITY_DEVICE_SIM;
-    }
-
-
-// ---------------------------------------------------------------------------
-// CGSSettListIdleContainer::RecreatePinItemsL()
-// 
-//  
-// ---------------------------------------------------------------------------
-//
-void CGSSimSecPluginContainer::RecreatePinItemsL()
-    {
-    TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ));
-    TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin ));
-    if(wcdmaSupported || upinSupported)
-      {
-        //check if UPIN code is supported and not rejected
-        if( iSecurity->IsUpinSupportedL() )
-            {
-            iUpinCodeSupported = ETrue;
-    
-            //check if UPIN code is active
-            if( iSecurity->IsUpinActive() )
-                {
-                iUpinCodeActive = ETrue;
-                }
-            else
-                {
-                iUpinCodeActive = EFalse;
-                }
-            
-            //Check whether UPIN is blocked
-    
-            if( !iSecurity->IsUpinBlocked() )
-                {
-                iUpinCodeRejected = EFalse;
-                }
-            else
-                {
-                iUpinCodeRejected = ETrue;
-                }
-        }
-        else
-            {
-            iUpinCodeSupported = EFalse;
-            iUpinCodeActive = EFalse;
-            }
-    
-        MakeCodeInUseItemL();
-        MakeUpinRequestItemL();
-        MakeCodeItemL( EGSSettIdUpinCode );
-        MakePinRequestItemL();
-        MakeCodeItemL( EGSSettIdPinCode );
-      }
-    }
-
-
-// ---------------------------------------------------------------------------
-// CGSSimSecPluginContainer::HandleResourceChangeL()
-// 
-// Updates view layout 
-// ---------------------------------------------------------------------------
-//
-void CGSSimSecPluginContainer::HandleResourceChangeL( TInt aType )
-    {
-    if( aType == KAknsMessageSkinChange ||
-        aType == KEikDynamicLayoutVariantSwitch )
-        {
-        TRect mainPaneRect;
-        AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, 
-                                           mainPaneRect );
-        SetRect( mainPaneRect );
-        DrawNow();
-        }
-    }
-    
-    
-
-// ---------------------------------------------------------------------------
-// CGSSimSecPluginContainer::MakeRemoteLockItemL()
-// 
-//  
-// ---------------------------------------------------------------------------
-//
-void CGSSimSecPluginContainer::MakeRemoteLockItemL()
-    {
-    #ifdef RD_REMOTELOCK
-    #ifdef _DEBUG
-    RDebug::Print( _L( "(SECUI)CGSSimSecPluginContainer::MakeRemoteLockItemL() - Enter" ) );
-    #endif // DEBUG
-
-    HBufC* statusItemText = HBufC::NewLC( KGSBufSize128 );
-    TPtr ptrRemoteLockStatus( statusItemText->Des() );
-    TBool remoteLockStatus( EFalse );
-    CRemoteLockSettings* remoteLockSettings = CRemoteLockSettings::NewLC();
-
-    if ( remoteLockSettings->GetEnabled( remoteLockStatus ) )
-        {
-        if ( remoteLockStatus )
-            {
-            // Remote lock enabled
-            ptrRemoteLockStatus = (*iRemoteLockItems)[0];
-            }
-        else
-            {
-            // Remote lock disabled
-            ptrRemoteLockStatus = (*iRemoteLockItems)[1];
-            }
-        }
-    else
-        {
-        // Failed to get remote lock status
-        // Undefined situation. Display empty item
-        ptrRemoteLockStatus = KRemoteLockEmptyItem;
-        }
-
-    CleanupStack::PopAndDestroy( remoteLockSettings );
-    remoteLockSettings = NULL;
-
-    // Remote Lock item
-	iListboxItemArray->SetDynamicTextL( EGSSettIdRemoteLock, ptrRemoteLockStatus );
-    CleanupStack::PopAndDestroy( statusItemText );
-	iListboxItemArray->SetItemVisibilityL( EGSSettIdRemoteLock, CGSListBoxItemTextArray::EVisible );
-
-    #ifdef _DEBUG
-    RDebug::Print( _L( "(SECUI)CGSSimSecPluginContainer::MakeRemoteLockItemL() - Exit" ) );
-    #endif // DEBUG
-	#endif // RD_REMOTELOCK
-    return;
-    }
-    
-    
-//End of File
--- a/securitydialogs/SecUi/GSSimSecPlugin/Src/GSSimSecPluginImplementationTable.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +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 proxy table for this plugin
-*
-*/
-
-
-// System includes
-#include <e32std.h>
-#include <ecom/implementationproxy.h>
-
-// User includes
-#include "GSSimSecPlugin.h"
-
-// Constants
-const TImplementationProxy KGSSimSecPluginImplementationTable[] = 
-	{
-	IMPLEMENTATION_PROXY_ENTRY( 0x10207439,	CGSSimSecPlugin::NewL )
-	};
-
-
-// ---------------------------------------------------------------------------
-// ImplementationGroupProxy
-// Gate/factory function
-//
-// ---------------------------------------------------------------------------
-//
-EXPORT_C const TImplementationProxy* ImplementationGroupProxy( 
-    TInt& aTableCount )
-	{
-	aTableCount = sizeof( KGSSimSecPluginImplementationTable ) 
-        / sizeof( TImplementationProxy );
-	return KGSSimSecPluginImplementationTable;
-	}
-
-
-// ---------------------------------------------------------------------------
-// E32Dll
-// EKA1 entry point
-//
-// ---------------------------------------------------------------------------
-//
-#ifndef EKA2
-GLDEF_C TInt E32Dll( TDllReason /*aReason*/ )
-	{
-	return( KErrNone );
-	}
-#endif // EKA2
-
-// End of File
--- a/securitydialogs/SecUi/GSSimSecPlugin/Src/GSSimSecPluginModel.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,184 +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:  Model for Device & SIM security plug-in.
-*
-*/
-
-
-// INCLUDES
-#include "GSSimSecPluginModel.h"
-
-#include <settingsinternalcrkeys.h>
-
-// EXTERNAL DATA STRUCTURES
-
-// EXTERNAL FUNCTION PROTOTYPES  
-
-// CONSTANTS
-
-// MACROS
-
-// LOCAL CONSTANTS AND MACROS
-const TInt KGSSettingOff = 0;
-// default value for autolock period
-const TInt KGSDefaultAutoLockTime = 0;
-
-// MODULE DATA STRUCTURES
-
-// LOCAL FUNCTION PROTOTYPES
-
-// ============================= LOCAL FUNCTIONS ==============================
-
-// ========================= MEMBER FUNCTIONS =================================
-
-// ----------------------------------------------------------------------------
-// CGSSimSecPluginModel::NewL
-// 
-// Symbian OS two-phased constructor
-// ----------------------------------------------------------------------------
-//
-CGSSimSecPluginModel* CGSSimSecPluginModel::NewL()
-    {
-    CGSSimSecPluginModel* self = new( ELeave ) CGSSimSecPluginModel;
-    CleanupStack::PushL( self );
-    self->ConstructL();
-
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-
-// ----------------------------------------------------------------------------
-// CGSSimSecPluginModel::CGSSimSecPluginModel
-// 
-// 
-// C++ default constructor can NOT contain any code, that might leave.
-// ----------------------------------------------------------------------------
-//
-CGSSimSecPluginModel::CGSSimSecPluginModel()
-    {
-    
-    }
-
-
-// ----------------------------------------------------------------------------
-// CGSSimSecPluginModel::ConstructL
-// 
-// Symbian OS default constructor can leave.
-// ----------------------------------------------------------------------------
-//
-void CGSSimSecPluginModel::ConstructL()
-    {
-    iSecurityRepository = CRepository::NewL( KCRUidSecuritySettings );
-    iPersonalizationRepository = 
-        CRepository::NewL( KCRUidPersonalizationSettings );
-    }
-
-
-// ----------------------------------------------------------------------------
-// CGSSimSecPluginModel::~CGSSimSecPluginModel
-// 
-// Destructor
-// ----------------------------------------------------------------------------
-//
-CGSSimSecPluginModel::~CGSSimSecPluginModel()
-    {
-    delete iSecurityRepository;
-    iSecurityRepository = NULL;
-
-    delete iPersonalizationRepository;
-    iPersonalizationRepository = NULL;
-    }
-
-
-// ----------------------------------------------------------------------------
-// CGSSimSecPluginModel::AutoLockPeriod()
-// 
-// Reads Autolock period from .ini file and returns it
-// ----------------------------------------------------------------------------
-//
-TInt CGSSimSecPluginModel::AutoLockPeriod()
-    {
-    TInt period = KGSSettingOff;
-    
-    if ( iSecurityRepository->
-         Get( KSettingsAutoLockTime, period ) != KErrNone )
-            {
-            period = KGSDefaultAutoLockTime;
-            iSecurityRepository->Set( KSettingsAutoLockTime, period );
-            }
-    
-    return period;
-    }
-            
-// ----------------------------------------------------------------------------
-// CGSSimSecPluginModel::SetAutoLockPeriod
-// 
-// Writes Autolock period time to Cenrep
-// ----------------------------------------------------------------------------
-//
-TBool CGSSimSecPluginModel::SetAutoLockPeriod( TInt aLockTime )
-    {
-    TInt ret = iSecurityRepository->Set( KSettingsAutoLockTime, aLockTime );
-    
-    return ret;
-    }
-
-// ----------------------------------------------------------------------------
-// CGSSimSecPluginModel::SatOperations()
-// 
-// Reads SatOperations value from .ini file and returns it
-// ----------------------------------------------------------------------------
-//
-TInt CGSSimSecPluginModel::SatOperations()
-    {
-    TInt value = KGSSettingOff;
-    
-    iPersonalizationRepository->Get( KSettingsConfirmSatOperations, value );
-    
-    return value;
-    }
-
-
-// ----------------------------------------------------------------------------
-// CGSSimSecPluginModel::SetSatOperations
-// 
-// Write user changes to the .ini file
-// ----------------------------------------------------------------------------
-//
-TBool CGSSimSecPluginModel::SetSatOperations( TInt aValue )
-    {
-    TInt ret = iPersonalizationRepository->
-            Set( KSettingsConfirmSatOperations, aValue );
-    
-    return ret;
-    }
-
-
-// ----------------------------------------------------------------------------
-// CGSSimSecPluginModel::ConfirmSatOperationsSupport
-// 
-// Get Confirm Sat Operations supported value
-// ----------------------------------------------------------------------------
-//
-TInt CGSSimSecPluginModel::ConfirmSatOperationsSupport()
-    {
-    TInt ret = 0;
-    iPersonalizationRepository->
-        Get( KSettingsConfirmSatOperationsSupported, ret );
-    
-    return ret;
-    }
-  
-// End of File
--- a/securitydialogs/SecUi/GSSimSecPlugin/loc/gssecurity.loc	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,233 +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:  Localization strings for Device & SIM Security view
-*
-*/
-
-
-//-------------------------------------------------------------
-// security view
-//-------------------------------------------------------------
-
-//d: Command in general settings security folder, opens Device & Sim security view
-//l: list_setting_pane_t1
-//w:
-//r:3.0
-#define qtn_set_dev_sim_security "Device & Sim security"
-
-//d:Text in title pane
-//d:Device and SIM Security view
-//l:title_pane_t2/opt9
-//w:
-//r: 3.1
-#define qtn_set_title_security_phone_and_sim "Phone and SIM"
-
-//-------------------------------------------------------------
-// device & sim security view
-//-------------------------------------------------------------
-//d:Code in use setting item in device & sim security settings folder
-//l: list_setting_pane_t1
-//w:
-//r:3.0
-#define qtn_set_code_in_use "Code in use"
-
-
-//d: pin code request setting item in device & sim security settings folder
-//l: list_setting_pane_t1
-//w:
-//r:3.0
-#define text_pin_code_cntrl "PIN code request"
-
-//d: Upin code request setting item in device & sim security settings folder
-//l: list_setting_pane_t1
-//w:
-//r:3.0
-#define qtn_set_upin_code_req "UPIN code request"
-
-
-//d: sim change security setting item in device & sim security settings folder
-//l: list_setting_pane_t1
-//w:
-//r:3.0
-#define qtn_set_sim_change_sec "SIM change security"
-
-//d: atulock period setting item in device & sim security settings folder
-//l: list_setting_pane_t1
-//w:
-//r:3.0
-#define qtn_set_autolock "Autolock period"
-
-//d: security code setting item in device & sim security settings folder
-//l: list_setting_pane_t1
-//w:
-//r:3.0
-#define qtn_set_sec_code "Security code"
-
-//d:Number query: autolock period time in minutes.
-//l:popup_query_data_window
-//w:
-//r:3.0
-#define qtn_set_autolock_define_time "Autolock period time (min)"
-
-//d: pin code setting item in device & sim security settings folder
-//l: list_setting_pane_t1
-//w:
-//r:3.0
-#define text_pin_change "PIN code"
-
-//d: upin code setting item in device & sim security settings folder
-//l: list_setting_pane_t1
-//w:
-//r:3.0
-#define qtn_set_upin_code "UPIN code"
-
-//d: pin2 code setting item in device & sim security settings folder
-//l: list_setting_pane_t1
-//w:
-//r:3.0
-#define text_pin2_change "PIN2 code"
-
-//d: closed user group setting item in device & sim security settings folder
-//l: list_setting_pane_t1
-//w:
-//r:3.0
-#define text_closed_user_groups "Closed user group"
-
-//d: item, network default, to closed user group popup list
-//l: list_set_graphic_pane_t1
-//w:
-//r:3.0
-#define text_cug_default "Network default"
-
-//d: item, on,  to closed user group popup list
-//l: list_set_graphic_pane_t1
-//w:
-//r:3.0
-#define text_cug_group "On"
-
-//d: item, off, to closed user group popup list
-//l: list_set_graphic_pane_t1
-//w:
-//r:3.0
-#define text_cug_suppress "Off"
-
-//d: text to number query asking for cug index
-//l: popup_query_data_window
-//w:
-//r:3.0
-#define text_give_group_number "Group number:"
-
-//d: text to cug error note when entered index is too large
-//l: popup_note_window
-//w:
-//r:3.0
-#define text_cug_error "Value too large"		
-	
-//d:sat operations setting item in device & sim security settings folder
-//l:list_setting_pane_t1
-//w:
-//r:3.0
-#define text_simatk_setting "Confirm SAT operations"
-
-//d:list item in pin code request setting page
-//l:list_set_graphic_pane_t1
-//w:
-//r:3.0
-#define text_pin_code_off "Off"
-
-//d:list item in pin code request setting page
-//l:list_set_graphic_pane_t1
-//w:
-//r:3.0
-#define text_pin_code_on  "On"
-
-//d:list item in code in use setting page
-//l:list_set_graphic_pane_t1
-//w:
-//r:3.0
-#define qtn_set_pin "PIN"
-
-//d:list item in code in use setting page
-//l:list_set_graphic_pane_t1
-//w:
-//r:3.0
-#define qtn_set_upin "UPIN"
-
-//d:list item in sim change security setting page
-//l:list_set_graphic_pane_t1
-//w:
-//r:3.0
-#define qtn_set_sim_change_sec_off "Off"
-
-//d:list item in sim change security setting page
-//l:list_set_graphic_pane_t1
-//w:
-//r:3.0
-#define qtn_set_sim_change_sec_on "On"
-
-//d:List item in autolock period setting page
-//l:list_set_graphic_pane_t1
-//w:
-//r:3.0
-#define qtn_set_autolock_off "Autolock off"
-
-//d:List item in autolock period setting page
-//l:list_set_graphic_pane_t1
-//w:
-//r:3.0
-#define qtn_set_autolock_defined "User defined"
-
-//d:Autolock period settings (plural) item edit - setting selection data, %N is number 2-999
-//l:list_set_graphic_pane_t1
-//w:
-//r:3.0
-#define qtn_set_autolock_value_min "%N minutes"
-
-//d:Autolock period settings (singular) item edit - setting selection data, %N is number 1
-//l:list_set_graphic_pane_t1
-//w:
-//r:3.0
-#define qtn_set_autolock_min_one "%N minute"
-
-//d:Confirm SAT operations value on
-//l:list_set_graphic_pane_t1
-//w:
-//r:3.0
-#define text_simatk_notes_on "Asked"
-
-//d:Confirm SAT operations value off
-//l:list_set_graphic_pane_t1
-//w:
-//r:3.0
-#define text_simatk_notes_off "Not asked"
-
-//d: Remote lock setting item in device & sim security settings folder
-//l: list_setting_pane_t1
-//w:
-//r:3.2
-#define qtn_set_remotelock_status "Allow remote lock"
-
-//d:Remote lock setting state in remote lock setting item in device & sim security settings folder
-//l:list_set_graphic_pane_t1
-//w:
-//r:3.2
-#define qtn_set_remotelock_off "No"
-
-//d:Remote lock setting state in remote lock setting item in device & sim security settings folder
-//l:list_set_graphic_pane_t1
-//w:
-//r:3.2
-#define qtn_set_remotelock_on  "Yes"
-
-//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/SecUi/Inc/SecQueryUi.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,249 @@
+/*
+* 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:  CSecQueryUi API can be used to implement UI dialogs for
+*               SecUi plugins.
+*/
+
+
+#ifndef C_SECQUERYUI_H
+#define C_SECQUERYUI_H
+
+#include <e32base.h>                            // CActive
+#include <hb/hbcore/hbdevicedialogsymbian.h>    // MHbDeviceDialogObserver
+#include <etelmm.h>
+#include <e32property.h>
+
+#define ESecUiTypeMask  0x0FFFFFF
+#define ESecUiBasicTypeMask    0x00F0000
+
+#define ESecUiCancelSupported  0x1000000
+#define ESecUiCancelNotSupported  0x0000000
+
+#define ESecUiEmergencySupported  0x2000000
+#define ESecUiEmergencyNotSupported  0x0000000
+
+#define ESecUiAlphaSupported  0x4000000
+#define ESecUiAlphaNotSupported  0x0000000
+
+#define ESecUiSecretSupported  0x8000000
+#define ESecUiSecretNotSupported  0x0000000
+
+#define ESecUiBasicTypeCheck   0x0010000
+#define ESecUiBasicTypeMultiCheck   0x0020000
+
+class MSecQueryUiCertificateDetailsProvider;
+class MSecQueryUiDrmDetailsProvider;
+class CHbDeviceDialogSymbian;
+class CHbSymbianVariantMap;
+class CActiveSchedulerWait;
+class CApaMaskedBitmap;
+
+typedef TBuf<80> TSecUiPassword;
+
+enum R_SECUI_ERROR_CODES
+	{
+	R_CODE_ERROR=0x58ED0100,
+	R_SEC_BLOCKED,
+	R_CONFIRMATION_NOTE,
+	R_PIN_CODE_CHANGED_NOTE,
+	R_PIN2_CODE_CHANGED_NOTE,
+	R_PIN2_REJECTED,
+	R_UPIN_CODE_CHANGED_NOTE,
+	R_SIM_NOT_ALLOWED,
+	R_SIM_ALLREADY_OFF,
+	R_SIM_OFF,
+	R_SIM_ALLREADY_ON,
+	R_OPERATION_NOT_ALLOWED,
+	R_SECUI_TEXT_AUTOLOCK_MUST_BE_ACTIVE,
+	R_PIN_NOT_ALLOWED,
+	R_REMOTELOCK_INVALID_CODE,
+	R_SIM_ON,
+	R_INSERT_SIM,
+	R_CODES_DONT_MATCH,
+	R_PIN_BLOCKED_NOTE,
+	R_UPIN_NOT_ALLOWED,
+	R_SECURITY_CODE_CHANGED_NOTE,
+	R_SECUI_ERROR_CODE_LAST
+	};
+
+/**
+ * CSecQueryUi provides UI dialogs for SW installation. UI dialogs are
+ * global and they can be used in a non-UI code (like in SIF plugins).
+ * SW install device dialog plugin implements the UI dialogs.
+ *
+ * @lib SecQueryUi.lib
+ * @since 10.1
+ */
+typedef TBuf<80> TSecUiPassword;
+
+class CSecQueryUi : public CActive, public MHbDeviceDialogObserver
+    {
+    public:  // constructor and destructor
+        /**
+         * Creates new CSecQueryUi object and pushes it into cleanup stack.
+         * @returns CSecQueryUi* -- new CSecQueryUi object
+         */
+        IMPORT_C static CSecQueryUi* NewLC();
+
+        /**
+         * Creates new CSecQueryUi object.
+         * @returns CSecQueryUi* -- new CSecQueryUi object
+         */
+        IMPORT_C static CSecQueryUi* NewL();
+
+        /**
+         * Destructor.
+         */
+        CSecQueryUi::~CSecQueryUi();
+
+    public:  // new functions
+        /**
+         * Displays install confirmation query synchronously. Synchronous function
+         * returns after the user has accepted or cancelled the query.
+         * @param aAppDetails - other application details (like supplier)
+         * @return TBool - ETrue if user accepted the query, EFalse otherwise
+         */
+        IMPORT_C TBool InstallConfirmationQueryL( TInt aType, RMobilePhone::TMobilePassword& password );
+        IMPORT_C TInt  SecQueryDialog(const TDesC& aCaption, TDes& aDataText, TInt aMinLength,TInt aMaxLength,TInt aMode);
+        /*
+        IMPORT_C TBool InstallConfirmationQueryL( const TDesC& aAppName,
+                const TDesC& aIconFile, const TDesC& aAppVersion, TInt aAppSize,
+                const TDesC& aAppDetails );
+        */
+
+        /**
+         * Displays information note. If the information note is already displayed, then
+         * only the dialog text is updated. Information note is closed automatically after
+         * pre-defined time (e.g. after 1.5 seconds). User can also press any key to close
+         * the note faster.
+         * @param aText - info text to be displayed
+         */
+        IMPORT_C void DisplayInformationNoteL( const TDesC& aText );
+
+        /**
+         * Displays warning note. If the warning note is already displayed, then only the note
+         * text is updated. Warning note is closed automatically after pre-defined time (e.g.
+         * after three seconds). User can also press any key to close the note faster.
+         * @param aText - error text to be displayed
+         */
+        IMPORT_C void DisplayWarningNoteL( const TDesC& aText );
+
+        /**
+         * Displays error note. If the error note is already displayed, then only the dialog
+         * text is updated. Error note is closed automatically after pre-defined time (e.g.
+         * after three seconds). User can also press any key to close the note faster.
+         * @param aText - error text to be displayed
+         */
+        IMPORT_C void DisplayErrorNoteL( const TDesC& aText );
+
+        /**
+         * Displays permanent note. If the permanent note is already displayed, then only the
+         * dialog text is updated. User cannot cancel or close permanent notes. Permanent note
+         * is displayed until ClosePermanentNote() is called. Delayed notes are displayed after
+         * pre-defined delay time, and they may be closed before they appear on the screen.
+         * @param aText - text to be displayed
+         * @param aIsDelayed - ETrue if delayed dialog should be used
+         */
+        IMPORT_C void DisplayPermanentNoteL( const TDesC& aText );
+
+        /**
+         * Closes the permanent note.
+         */
+        IMPORT_C void ClosePermanentNote();
+
+        /**
+         * Displays progress note using aFinalValue. Use UpdateProgressNoteValueL() to
+         * update the progress bar. If the progress note is already active, then only
+         * the note text and final value are updated.
+         * @param aText - text displayed in progress note
+         * @param aFinalValue - final value of the progress bar
+         */
+        IMPORT_C void DisplayProgressNoteL( const TDesC& aText, TInt aFinalValue );
+
+        /**
+         * Updates the progress bar in progress note. Progress bar shows 0% when
+         * aNewValue is zero (or less than zero), and full 100% when aNewValue is
+         * equal (or more than) the final value set with SetProgressNoteFinalValueL().
+         * @param aNewValue - new value for the progress bar
+         */
+        IMPORT_C void UpdateProgressNoteValueL( TInt aNewValue );
+
+        /**
+         * Closes the progress note. TRequestStatus set in DisplayProgressNoteL() is
+         * completed with KErrNone. Note that it is completed with KErrCancel if user
+         * cancels the note, or with error code if some error happens.
+         */
+        IMPORT_C void CloseProgressNoteL();
+
+        /**
+         * Displays wait note. If the wait note is already displayed, then only the note
+         * text is updated. Wait note is like progress note, except that it is not known
+         * how long the operation takes. User can cancel the operation as in progress note.
+         * @param aText - text to be displayed
+         * @param aStatus - request status that indicates if user cancels the note
+         */
+        IMPORT_C void DisplayWaitNoteL( const TDesC& aText, TRequestStatus& aStatus );
+
+        /**
+         * Closes the wait note.
+         */
+        IMPORT_C void CloseWaitNote();
+
+        /**
+         * Launches help with the help context aContext for application aUid.
+         * @param aContext - help context to be displayed
+         * @param aUid - application which help needs to be launched
+         */
+        IMPORT_C void LaunchHelpL( const TDesC& aContext, const TUid& aUid );
+
+        /**
+         * Launches SW Install application (UID 0x101F8512) help using the
+         * help context aContext.
+         * @param aContext - help context to be displayed
+         */
+        IMPORT_C void LaunchHelpL( const TDesC& aContext );
+
+    protected:  // from CActive
+        void DoCancel();
+        void RunL();
+
+    private:    // from MHbDeviceDialogObserver
+        void DataReceived( CHbSymbianVariantMap& aData );
+        void DeviceDialogClosed( TInt aCompletionCode );
+
+    private:    // new functions
+        CSecQueryUi();
+        void ConstructL();
+        void ClearParamsL();
+        void ClearParamsAndSetNoteTypeL( TInt aType );
+        void AddParamL( const TDesC& aKey, TInt aValue );
+        void AddParamL( const TDesC& aKey, const TDesC& aValue );
+        void DisplayDeviceDialogL();
+        TInt WaitUntilDeviceDialogClosed();
+
+    private:    // data
+        CHbDeviceDialogSymbian* iDeviceDialog;
+        CHbSymbianVariantMap* iVariantMap;
+        CActiveSchedulerWait* iWait;
+        TBool iIsDisplayingDialog;
+        TInt iCompletionCode;
+        TInt iReturnValue;
+public:
+	   // previoulsy it was RMobilePhone::TMobilePassword iPassword; but this was only 10 bytes
+        TSecUiPassword iPassword;
+    };
+
+
+#endif  // C_SECQUERYUI_H
+
--- a/securitydialogs/SecUi/Inc/SecUiAutoLockSettingPage.h	Thu Aug 19 10:45:23 2010 +0300
+++ b/securitydialogs/SecUi/Inc/SecUiAutoLockSettingPage.h	Tue Aug 31 16:04:40 2010 +0300
@@ -23,7 +23,7 @@
 #include    <aknradiobuttonsettingpage.h>
 #include    <eikmobs.h>
 
-class CAutoLockSettingPage : public CAknRadioButtonSettingPage
+class CAutoLockSettingPage : public CBase
 	{
 	public:
 		/**
@@ -59,6 +59,7 @@
     	void HandlePointerEventL(const TPointerEvent& aPointerEvent);
     	
 	private: // data
+		// CEikButtonGroupContainer* iPopoutCba;
 		TInt& iAutoLockValue;
 		TInt iMaximum;
 		TInt iOriginalIndex;
--- a/securitydialogs/SecUi/Inc/SecUiRemoteLockSettingPage.h	Thu Aug 19 10:45:23 2010 +0300
+++ b/securitydialogs/SecUi/Inc/SecUiRemoteLockSettingPage.h	Tue Aug 31 16:04:40 2010 +0300
@@ -71,6 +71,8 @@
 
 	private: // data
 
+		CEikButtonGroupContainer* iPopoutCba;
+
         /** Remote lock status */
 		TInt& iRemoteLockStatus;
 		TInt iPrevSelectionItem;
--- a/securitydialogs/SecUi/Inc/SecUiWait.h	Thu Aug 19 10:45:23 2010 +0300
+++ b/securitydialogs/SecUi/Inc/SecUiWait.h	Tue Aug 31 16:04:40 2010 +0300
@@ -76,9 +76,24 @@
         TInt iRequestType;
     };
 
+// CAutolockQuery, absorbs all the key presses.
+class CAutolockQuery : public CBase
+    {
+    public:
+        static CAutolockQuery* NewLC();
+        virtual ~CAutolockQuery();
+    private:
+        virtual TKeyResponse OfferKeyEventL(const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/);
+    private:
+        CAutolockQuery();
+        void ConstructL();
+    private: // Data
+         CEikAppUi*  iAppUi;
 
+
+    };
 // CWaitAbsorbingControl, absorbs all the key presses.
-class CWaitAbsorbingControl : public CCoeControl
+class CWaitAbsorbingControl : public CBase
     {
     public:
         static CWaitAbsorbingControl* NewLC();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/SecUi/Src/SecQueryUi.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,603 @@
+/*
+* 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 RSecQueryUiCli class.
+*
+*/
+
+#include "SecQueryUi.h"                              // CSecQueryUi
+// #include <SecQueryUidefs.h>                          // SIF UI device dialog parameters
+#include <hb/hbcore/hbdevicedialogsymbian.h>    // CHbDeviceDialogSymbian
+#include <hb/hbcore/hbsymbianvariant.h>         // CHbSymbianVariantMap
+#include <apgicnfl.h>                           // CApaMaskedBitmap
+#include <securityuisprivatepskeys.h>
+
+#include <cphcltemergencycall.h>
+#include <SCPClient.h>
+#include "SecUi.h"
+
+const TUid KSWInstHelpUid =
+    {
+    0x101F8512
+    }; // TODO
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CSecQueryUi::NewLC()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CSecQueryUi* CSecQueryUi::NewLC()
+    {
+    CSecQueryUi* self = new (ELeave) CSecQueryUi();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CSecQueryUi::NewL()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CSecQueryUi* CSecQueryUi::NewL()
+    {
+    CSecQueryUi* self = CSecQueryUi::NewLC();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CSecQueryUi::~CSecQueryUi()
+// ---------------------------------------------------------------------------
+//
+CSecQueryUi::~CSecQueryUi()
+    {
+    Cancel();
+    delete iWait;
+    delete iDeviceDialog;
+    delete iVariantMap;
+    }
+
+// ---------------------------------------------------------------------------
+// CSecQueryUi::InstallConfirmationQueryL()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CSecQueryUi::InstallConfirmationQueryL(TInt aType,
+        RMobilePhone::TMobilePassword& password)
+/*
+ const TDesC& aAppName,
+ const TDesC& aIconFile, const TDesC& aAppVersion, TInt aAppSize,
+ const TDesC& aAppDetails ) */
+    {
+    // this is never used. Kept as a reference
+    RDEBUG("This should never be called. Obsolete aType", aType);
+    return KErrAbort;
+    }
+
+// ---------------------------------------------------------------------------
+// CSecQueryUi::SecQueryDialog()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CSecQueryUi::SecQueryDialog(const TDesC& aCaption,
+        TDes& aDataText, TInt aMinLength, TInt aMaxLength, TInt aMode)
+    {
+    RDEBUG("aCaption", 0);
+    RDEBUGSTR(aCaption);
+    RDEBUG("aMode", aMode);
+    TInt secUiOriginatedQuery(ESecurityUIsSecUIOriginatedUninitialized);
+    TInt err = RProperty::Get(KPSUidSecurityUIs,
+            KSecurityUIsSecUIOriginatedQuery, secUiOriginatedQuery);
+    RDEBUG("secUiOriginatedQuery", secUiOriginatedQuery);
+    if (secUiOriginatedQuery == ESecurityUIsSecUIOriginatedUninitialized )	// &&  )
+        {
+        // set only if not set
+        err = RProperty::Set(KPSUidSecurityUIs,
+                KSecurityUIsSecUIOriginatedQuery,
+                ESecurityUIsETelAPIOriginated);
+        RDEBUG("setting secUiOriginatedQuery", ESecurityUIsETelAPIOriginated);
+      	}
+		else if ( secUiOriginatedQuery != ESecurityUIsSecUIOriginated )
+				{
+        RDEBUG("!!!! warning: secUiOriginatedQuery", secUiOriginatedQuery);
+        // The query is already shown. This is valid for ESecurityUIsSecUIOriginated, and maybe for ESecurityUIsETelAPIOriginated
+        // For ESecurityUIsSystemLockOriginated it means that the "lock" dialog is already present.
+        // Try to dismiss the dialog. Do same as CSecurityHandler::CancelSecCodeQuery
+        TInt aDismissDialog = -1;
+        err = RProperty::Get(KPSUidSecurityUIs, KSecurityUIsDismissDialog, aDismissDialog);
+        // it might happen that the dialog is already dismissing. Well, it won't harm to try again.
+        RDEBUG("aDismissDialog", aDismissDialog);
+        RDEBUG("err", err);
+        RDEBUG("set KSecurityUIsDismissDialog", ESecurityUIsDismissDialogOn);
+        err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsDismissDialog, ESecurityUIsDismissDialogOn);
+        RDEBUG("err", err);
+        }
+		RDEBUG("calling ClearParamsAndSetNoteTypeL aMode", aMode);
+    ClearParamsAndSetNoteTypeL(aMode);
+    AddParamL(_L("KSecQueryUiApplicationName"), aCaption);
+
+    _LIT(KTitle, "title");
+    // _LIT(KTitleValue1, "Enter PIN");
+    AddParamL(KTitle, aCaption);
+    AddParamL(_L("MinLength"), aMinLength);
+    AddParamL(_L("MaxLength"), aMaxLength);
+
+    switch (aMode & ESecUiBasicTypeMask) {
+    	case ESecUiBasicTypeCheck:
+                             _LIT(KChecboxDialog, "ChecboxDialog");
+                             _LIT(KChecbox, "ChecboxDialog");
+                             AddParamL(KChecboxDialog,KChecbox);
+                             break;
+    	case ESecUiBasicTypeMultiCheck:
+                            _LIT(KMultiChecboxDialog, "MultiChecboxDialog");
+                            _LIT(KMultiChecbox, "MultiChecboxDialog");
+                            AddParamL(KMultiChecboxDialog,KMultiChecbox);
+                            break;
+    	default:
+                            _LIT(KCodeTop, "codeTop");
+                            _LIT(KCodeTopValue, "codeTop");
+                            AddParamL(KCodeTop, KCodeTopValue);
+    }
+
+    if (aCaption.Find(_L("|")) > 0)
+        {
+        RDEBUG("codeBottom aMode", aMode);
+        _LIT(KCodeBottom, "codeBottom");
+        _LIT(KCodeBottomValue, "codeBottom");
+        AddParamL(KCodeBottom, KCodeBottomValue);
+        }
+    if (aDataText.Length() > 0)
+        {
+        RDEBUG("aDataText", 1);
+        _LIT(KDefaultCode, "DefaultCode");
+        AddParamL(KDefaultCode, aDataText);
+        }
+
+    RDEBUG("0", 0);
+    DisplayDeviceDialogL();
+    TSecUi::UnInitializeLib();	// the counterpart is at DisplayDeviceDialogL
+    TInt error = WaitUntilDeviceDialogClosed();
+    RDEBUG("error", error);
+    User::LeaveIfError(error);
+    RDEBUG("iPassword", 0);
+		RDEBUGSTR(iPassword);
+    aDataText.Copy(iPassword);
+
+    err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery,
+            ESecurityUIsSecUIOriginatedUninitialized);
+    RDEBUG("clearing secUiOriginatedQuery",
+            ESecurityUIsSecUIOriginatedUninitialized);
+
+    RDEBUG("iReturnValue", iReturnValue);
+    return iReturnValue;
+    }
+
+// ---------------------------------------------------------------------------
+// CSecQueryUi::DisplayInformationNoteL()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CSecQueryUi::DisplayInformationNoteL(const TDesC& aText)
+    {
+    // this is never used. Kept as a reference
+    RDEBUG("This should never be called. Obsolete", 0);
+    /*
+     ClearParamsAndSetNoteTypeL( SecQueryUiInformationNote );
+     AddParamL( KNotifDeviceDialogKeyText, aText );
+     AddParamL( KNotifDeviceDialogKeyTimeOut, 0 );
+     iDeviceDialog->Show( KNotifDeviceDialogLiteral, *iVariantMap, this );
+     User::LeaveIfError( WaitUntilDeviceDialogClosed() );
+     */
+    }
+
+// ---------------------------------------------------------------------------
+// CSecQueryUi::DisplayWarningNoteL()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CSecQueryUi::DisplayWarningNoteL(const TDesC& aText)
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CSecQueryUi::DisplayErrorNoteL()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CSecQueryUi::DisplayErrorNoteL(const TDesC& aText)
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CSecQueryUi::DisplayPermanentNoteL()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CSecQueryUi::DisplayPermanentNoteL(const TDesC& aText)
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CSecQueryUi::ClosePermanentNote()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CSecQueryUi::ClosePermanentNote()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CSecQueryUi::DisplayProgressNoteL()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CSecQueryUi::DisplayProgressNoteL(const TDesC& aText,
+        TInt aFinalValue)
+    {
+    /*
+     ClearParamsAndSetNoteTypeL( ESecQueryUiProgressNoteType );
+     AddParamL( KSecQueryUiProgressNoteText, aText );
+     AddParamL( KSecQueryUiProgressNoteFinalValue, aFinalValue );
+     DisplayDeviceDialogL();
+     */}
+
+// ---------------------------------------------------------------------------
+// CSecQueryUi::UpdateProgressNoteValueL()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CSecQueryUi::UpdateProgressNoteValueL(TInt aNewValue)
+    {
+    /*
+     ClearParamsAndSetNoteTypeL( ESecQueryUiProgressNoteType );
+     AddParamL( KSecQueryUiProgressNoteValue, aNewValue );
+     DisplayDeviceDialogL();
+     */}
+
+// ---------------------------------------------------------------------------
+// CSecQueryUi::CloseProgressNoteL()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CSecQueryUi::CloseProgressNoteL()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CSecQueryUi::DisplayWaitNoteL()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CSecQueryUi::DisplayWaitNoteL(const TDesC& aText,
+        TRequestStatus& aStatus)
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CSecQueryUi::CloseWaitNote()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CSecQueryUi::CloseWaitNote()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CSecQueryUi::LaunchHelpL()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CSecQueryUi::LaunchHelpL(const TDesC& aContext,
+        const TUid& aUid)
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CSecQueryUi::LaunchHelpL()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CSecQueryUi::LaunchHelpL(const TDesC& aContext)
+    {
+    LaunchHelpL(aContext, KSWInstHelpUid);
+    }
+
+// ---------------------------------------------------------------------------
+// CSecQueryUi::DoCancel()
+// ---------------------------------------------------------------------------
+//
+void CSecQueryUi::DoCancel()
+    {
+    RDEBUG("0", 0);
+    if (iWait && iWait->IsStarted() && iWait->CanStopNow())
+        {
+        iCompletionCode = KErrCancel;
+        iWait->AsyncStop();
+        }
+    RDEBUG("0", 0);
+    }
+
+// ---------------------------------------------------------------------------
+// CSecQueryUi::RunL()
+// ---------------------------------------------------------------------------
+//
+void CSecQueryUi::RunL()
+    {
+    RDEBUG("0", 0);
+    if (iWait)
+        {
+        iWait->AsyncStop();
+        }
+    RDEBUG("0", 0);
+    }
+
+// ---------------------------------------------------------------------------
+// CSecQueryUi::DataReceived()
+// ---------------------------------------------------------------------------
+//
+void CSecQueryUi::DataReceived(CHbSymbianVariantMap& aData)
+    {
+    RDEBUG("0", 0);
+    const CHbSymbianVariant* acceptedVariant = aData.Get(_L("accepted")); // KSecQueryUiQueryAccepted
+    RDEBUG("0", 0);
+    if (acceptedVariant)
+        {
+        RDEBUG("0", 0);
+        TInt* acceptedValue = acceptedVariant->Value<TInt> ();
+        RDEBUG("acceptedValue", acceptedValue);
+        RDEBUG("*acceptedValue", *acceptedValue);
+        if (acceptedValue)
+            {
+            iReturnValue = *acceptedValue;
+            }
+        }
+    const CHbSymbianVariant* acceptedVariantTop = aData.Get(_L("codeTop")); // KSecQueryUiQueryAccepted
+    RDEBUG("0", 0);
+    if (acceptedVariantTop)
+        {
+        TPtrC acceptedValueTop = *acceptedVariantTop->Value<TDesC> ();
+        RDEBUG("acceptedValueTop", 0);
+        RDEBUGSTR(acceptedValueTop);
+        iPassword.Copy(acceptedValueTop);
+
+        if (iReturnValue == KErrCompletion) // the user didn't OK. It was send automatically because validating new lock code through TARM
+            {
+            _LIT(KInvalidNewLockCode, "invalidNewLockCode");
+            _LIT(KInvalidNewLockCode0, "invalidNewLockCode$-1");
+            AddParamL(KInvalidNewLockCode, KInvalidNewLockCode0); // for starter
+            RSCPClient scpClient;
+            TSCPSecCode newCode;
+            newCode.Copy(acceptedValueTop);
+            RDEBUG("scpClient.Connect", 0);
+            if (scpClient.Connect() == KErrNone)
+                {
+                 RArray<TDevicelockPolicies> aFailedPolicies;
+                 TDevicelockPolicies failedPolicy;
+                 TInt retLockcode = KErrNone;
+                 TInt nPoliciesFailed = 0;
+                 RDEBUG( "scpClient.VerifyNewLockcodeAgainstPolicies", 0 );
+                 retLockcode = scpClient.VerifyNewLockcodeAgainstPolicies( newCode, aFailedPolicies );
+                 RDEBUG( "retLockcode", retLockcode );
+                 nPoliciesFailed = aFailedPolicies.Count();
+                 RDEBUG( "nPoliciesFailed", nPoliciesFailed );
+                 for(TInt i=0; i<nPoliciesFailed; i++)
+	                 {
+	                 failedPolicy = aFailedPolicies[i];
+	                 RDEBUG( "failedPolicy", failedPolicy );
+	                 TBuf<0x100> KInvalidNewLockCodeX;   KInvalidNewLockCodeX.Zero();    KInvalidNewLockCodeX.Append(_L("invalidNewLockCode"));  KInvalidNewLockCodeX.Append(_L("$"));
+	                 KInvalidNewLockCodeX.AppendNum(failedPolicy);
+	                 AddParamL( KInvalidNewLockCode, KInvalidNewLockCodeX );	// it overwrites the previous one
+	                 }
+                // TODO this should be able to modify MinLenght, MaxLenght
+                scpClient.Close();
+                }
+            RDEBUG("iDeviceDialog->Update", 0);
+            iDeviceDialog->Update(*iVariantMap);
+            } // KErrCompletion
+
+        if (acceptedValueTop.Length() <= 4) // TODO store aMinLenght and check it here, instead of "4"
+            {
+            RDEBUG("CPhCltEmergencyCall", 0);
+            CPhCltEmergencyCall* emergencyCall = CPhCltEmergencyCall::NewL(
+                    NULL);
+            RDEBUG("PushL", 0);
+            CleanupStack::PushL(emergencyCall);
+            TPhCltEmergencyNumber emNumber;
+
+            // this relies on the fact that emergency has 3 digits, and password needs at least 4
+            TBool isEmergency(EFalse);
+            RDEBUG("calling IsEmergencyPhoneNumber", 0);
+            TInt error = emergencyCall->IsEmergencyPhoneNumber(
+                    acceptedValueTop, isEmergency);
+            RDEBUG("error", error);
+            RDEBUG("emNumber", 0);
+
+            RDEBUG("isEmergency", isEmergency);
+#ifdef __WINS__
+            RDEBUG( "__WINS__ checking", 0 );
+            if(!acceptedValueTop.CompareF(_L("112")) || !acceptedValueTop.CompareF(_L("911")) || !acceptedValueTop.CompareF(_L("555")) )
+                {
+                isEmergency = ETrue;
+                error = KErrNone;
+                RDEBUG( "__WINS__ isEmergency", isEmergency );
+                }
+#endif
+
+            if (!error) // oddly enough, missing capabilities also gives KErrNone
+                {
+                if (iReturnValue == KErrAbort) // the user didn't OK. It was send automatically because short code
+                    {
+                    _LIT(KEmergency, "emergency");
+                    _LIT(KEmergencyValueYes, "emergencyYes");
+                    _LIT(KEmergencyValueNo, "emergencyNo");
+                    if (isEmergency)
+                        {
+                        RDEBUG("KEmergencyValueYes", 1);
+                        AddParamL(KEmergency, KEmergencyValueYes);
+                        }
+                    else
+                        {
+                        RDEBUG("KEmergencyValueNo", 0);
+                        AddParamL(KEmergency, KEmergencyValueNo);
+                        }
+                    iDeviceDialog->Update(*iVariantMap);
+                    }
+                else if (iReturnValue == KErrNone)
+                    { // user pressed Call and number is valid
+                    if (isEmergency)
+                        {
+                        RDEBUG("DialEmergencyCallL", isEmergency);
+                        emergencyCall->DialEmergencyCallL(emNumber);
+                        iReturnValue = KErrAbort; // this means emergency call
+                        }
+                    }
+                } // if !error
+            RDEBUG("0", 0);
+            CleanupStack::PopAndDestroy(emergencyCall);
+            } // lenght<3
+        } // acceptedVariantTop
+    RDEBUG("iReturnValue", iReturnValue);
+    }
+
+// ---------------------------------------------------------------------------
+// CSecQueryUi::DeviceDialogClosed()
+// ---------------------------------------------------------------------------
+//
+void CSecQueryUi::DeviceDialogClosed(TInt aCompletionCode)
+    {
+    RDEBUG("aCompletionCode", aCompletionCode);
+    iCompletionCode = aCompletionCode;
+    iIsDisplayingDialog = EFalse;
+
+    TRequestStatus* status(&iStatus);
+    RDEBUG("0", 0);
+    User::RequestComplete(status, KErrNone);
+    RDEBUG("0", 0);
+    }
+
+// ---------------------------------------------------------------------------
+// CSecQueryUi::CSecQueryUi()
+// ---------------------------------------------------------------------------
+//
+CSecQueryUi::CSecQueryUi() :
+    CActive(CActive::EPriorityStandard)
+    {
+    RDEBUG("0", 0);
+    CActiveScheduler::Add(this);
+    }
+
+// ---------------------------------------------------------------------------
+// CSecQueryUi::ConstructL()
+// ---------------------------------------------------------------------------
+//
+void CSecQueryUi::ConstructL()
+    {
+    RDEBUG("0", 0);
+    iWait = new (ELeave) CActiveSchedulerWait;
+    // iDeviceDialog is allocated later, first call of DisplayDeviceDialogL()
+    }
+
+// ---------------------------------------------------------------------------
+// CSecQueryUi::ClearParamsL()
+// ---------------------------------------------------------------------------
+//
+void CSecQueryUi::ClearParamsL()
+    {
+    RDEBUG("0", 0);
+    if (iVariantMap)
+        {
+        delete iVariantMap;
+        iVariantMap = NULL;
+        }
+    iVariantMap = CHbSymbianVariantMap::NewL();
+    }
+
+// ---------------------------------------------------------------------------
+// CSecQueryUi::ClearParamsAndSetNoteTypeL()
+// ---------------------------------------------------------------------------
+//
+void CSecQueryUi::ClearParamsAndSetNoteTypeL(TInt aType)
+    {
+    RDEBUG("aType", aType);
+    ClearParamsL();
+    AddParamL(_L("type"), aType);
+    }
+
+// ---------------------------------------------------------------------------
+// CSecQueryUi::AddParamL()
+// ---------------------------------------------------------------------------
+//
+void CSecQueryUi::AddParamL(const TDesC& aKey, TInt aValue)
+    {
+    RDEBUG("aValue", aValue);
+    CHbSymbianVariant* variant = NULL;
+    variant = CHbSymbianVariant::NewL(&aValue, CHbSymbianVariant::EInt);
+    iVariantMap->Add(aKey, variant);
+    }
+
+// ---------------------------------------------------------------------------
+// CSecQueryUi::AddParamL()
+// ---------------------------------------------------------------------------
+//
+void CSecQueryUi::AddParamL(const TDesC& aKey, const TDesC& aValue)
+    {
+    RDEBUG("0", 0);
+    CHbSymbianVariant* variant = NULL;
+    variant = CHbSymbianVariant::NewL(&aValue, CHbSymbianVariant::EDes);
+    iVariantMap->Add(aKey, variant);
+    }
+
+// ---------------------------------------------------------------------------
+// CSecQueryUi::DisplayDeviceDialogL()
+// ---------------------------------------------------------------------------
+//
+void CSecQueryUi::DisplayDeviceDialogL()
+    {
+    RDEBUG("0", 0);
+    TInt err = KErrNone;
+    RDEBUG("iIsDisplayingDialog", iIsDisplayingDialog);
+    if (iDeviceDialog && iIsDisplayingDialog)
+        {
+    		RDEBUG("iDeviceDialog", 1);
+        iDeviceDialog->Update(*iVariantMap);
+        }
+    else
+        {
+    		RDEBUG("!iDeviceDialog", 0);
+        if (!iDeviceDialog)
+            {
+            RDEBUG("new iDeviceDialog", 0);
+            iDeviceDialog = CHbDeviceDialogSymbian::NewL();
+            }
+        _LIT(KSecQueryUiDeviceDialog, "com.nokia.secuinotificationdialog/1.0");
+        RDEBUG("Show", 0);
+        err = iDeviceDialog->Show(KSecQueryUiDeviceDialog, *iVariantMap, this);
+        RDEBUG("err", err);
+        TSecUi::InitializeLibL();
+        RDEBUG("iIsDisplayingDialog", iIsDisplayingDialog);
+        iIsDisplayingDialog = ETrue;
+        RDEBUG("iIsDisplayingDialog", iIsDisplayingDialog);
+        }
+    RDEBUG("0", 0);
+    }
+
+// ---------------------------------------------------------------------------
+// CSecQueryUi::WaitUntilDeviceDialogClosed()
+// ---------------------------------------------------------------------------
+//
+TInt CSecQueryUi::WaitUntilDeviceDialogClosed()
+    {
+    RDEBUG("0", 0);
+    iCompletionCode = KErrInUse;
+    iReturnValue = KErrUnknown;
+    if (!IsActive() && iWait && !iWait->IsStarted())
+        {
+        RDEBUG("KRequestPending", KRequestPending);
+        iStatus = KRequestPending;
+        SetActive();
+        RDEBUG("Start", 0);
+        iWait->Start();
+        RDEBUG("Started", 1);
+        }
+    RDEBUG("iCompletionCode", iCompletionCode);
+    return iCompletionCode;
+    }
+
--- a/securitydialogs/SecUi/Src/SecUi.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/securitydialogs/SecUi/Src/SecUi.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -24,9 +24,6 @@
 #include "secui.h"
 #include 	<data_caging_path_literals.hrh>
 
-_LIT(KDirAndFile,"z:SecUi.rsc");
-
-
 // ================= MEMBER FUNCTIONS =======================
 //
 // ----------------------------------------------------------
@@ -38,20 +35,19 @@
 	{
 	if (Dll::Tls()!=NULL)
     {//Secui has been initialized already; increase client count.
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI): InitializeLibL: Secui has been initialized already"));
-        #endif
+        RDEBUG("Secui has been initialized already", 0);
         TSecUi* instance=(TSecUi*) Dll::Tls();
         instance->IncreaseClientCount();
+        instance->iDialogOpened++;
+        RDEBUG("instance->iDialogOpened", instance->iDialogOpened);
         return;
     }
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI): InitializeLibL: First initialization"));
-    #endif
+    RDEBUG("First initialization", 0);
 	TSecUi* self = new (ELeave) TSecUi();
 	CleanupStack::PushL(self);
 	self->ConstructL();
     self->IncreaseClientCount();
+    self->iDialogOpened=0;
 	Dll::SetTls(self);
 	CleanupStack::Pop();
 	}
@@ -63,19 +59,19 @@
 //
 EXPORT_C void TSecUi::UnInitializeLib()
 	{
+    RDEBUG("0", 0);
     if (Dll::Tls()==NULL)
+    		{
+    		RDEBUG("!!!!!!!!!! Dll::Tls not yet initialized: 0", 0);
         return;
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI): UnInitializeLibL"));
-    #endif
+      	}
+    RDEBUG("0", 0);
 	TSecUi* instance=(TSecUi*) Dll::Tls();
     instance->DecreaseClientCount();
     //only delete the lib is there are no clients using it
     if(instance->CanBeFreed())
         {
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI): UnInitializeLibL: Last uninitialize"));
-        #endif
+        RDEBUG("Last uninitialize", 0);
 	    delete instance;
 	    Dll::SetTls(NULL);
         }
@@ -89,7 +85,6 @@
 //
 TSecUi::TSecUi()
 	{
-	
 	}
 //
 // ----------------------------------------------------------
@@ -99,10 +94,6 @@
 //
 TSecUi::~TSecUi()
 	{
-	if (iResourceFileOffset >= 0)
-		{
-		CEikonEnv::Static()->DeleteResourceFile(iResourceFileOffset);
-		}
 	}
 //
 // ----------------------------------------------------------
@@ -112,25 +103,9 @@
 //
 void TSecUi::ConstructL()
 	{
-	iResourceFileOffset = CCoeEnv::Static()->AddResourceFileL(ResourceFileName());
+		RDEBUG("iClientCount", iClientCount);
     iClientCount = 0;
 	}
-//
-// ----------------------------------------------------------
-// TSecUi::ResourceFileName
-// Returns the resource file name of SecurityUI dll.
-// ----------------------------------------------------------
-//
-TFileName TSecUi::ResourceFileName()
-	{
-	
-	TParse parse;
-    parse.Set(KDirAndFile, &KDC_RESOURCE_FILES_DIR, NULL); 
-	TFileName resourceFileName(parse.FullName());
-	BaflUtils::NearestLanguageFile(CCoeEnv::Static()->FsSession(), resourceFileName);
-	return resourceFileName;
-	
-	}
 
 // -----------------------------------------------------------------------------
 // TSecUi::CanBeFreed()
@@ -138,18 +113,13 @@
 //
 TBool TSecUi::CanBeFreed()
     {
+    	RDEBUG("iClientCount", iClientCount);
 	if (iClientCount <= 0)
 	{
-        #if defined(_DEBUG)
-		RDebug::Print(_L("(SECUI): No clients; Can be freed: clients(%d) "), iClientCount);
-        #endif
 		return ETrue;
 	}
 	else
 	{
-        #if defined(_DEBUG)
-		RDebug::Print(_L("(SECUI): Can NOT be freed: clients(%d) "), iClientCount);
-		#endif
         return EFalse;
 	}
     }
@@ -161,9 +131,7 @@
 void TSecUi::IncreaseClientCount()
     {
 	++iClientCount;
-    #if defined(_DEBUG)
-	RDebug::Print(_L("(SECUI): IncreaseClientCount, clients now(%d) "), iClientCount);
-    #endif
+	RDEBUG("iClientCount", iClientCount);
     }
 
 // -----------------------------------------------------------------------------
@@ -174,9 +142,7 @@
 void TSecUi::DecreaseClientCount()
     {
 	--iClientCount;
-    #if defined(_DEBUG)
-	RDebug::Print(_L("(SECUI): DecreaseClientCount, clients now(%d) "), iClientCount);
-    #endif
+	RDEBUG("iClientCount", iClientCount);
     }
 
 	
--- a/securitydialogs/SecUi/Src/SecUiAutoLockSettingPage.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/securitydialogs/SecUi/Src/SecUiAutoLockSettingPage.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -23,23 +23,8 @@
 #include "SecUiAutoLockSettingPage.h"
 #include "secui.hrh"
 #include <featmgr.h>
-/**
-*CAutolockQuery used in autolock period query
-*/
-class CAutolockQuery
-	: public CAknNumberQueryDialog
-	{
-	public: // Constructors and destructors
-		/**
-		* C++ constructor.
-		*/
-		CAutolockQuery(TInt& aNumber,const TTone aTone = ENoTone);
-	protected: // From base classes
-		/**
-		* From CCAknNumberQueryDialog 
-		*/
-		void PreLayoutDynInitL();
-	};
+
+
 //
 // ----------------------------------------------------------
 // CAutoLockSettingPage::CAutoLockSettingPage()
@@ -47,10 +32,9 @@
 // ----------------------------------------------------------
 // 
 CAutoLockSettingPage::CAutoLockSettingPage(TInt aResourceId, TInt& aCurrentSelectionItem, CDesCArrayFlat* aItemArray, TInt& aAutoLockValue) : 
-					CAknRadioButtonSettingPage(aResourceId, aCurrentSelectionItem, aItemArray),iAutoLockValue(aAutoLockValue)
+					CBase(),iAutoLockValue(aAutoLockValue)
 
 	{
-        iOriginalIndex = aCurrentSelectionItem;
 	}
 
 //
@@ -61,9 +45,6 @@
 // 
 void CAutoLockSettingPage::ConstructL()
 	{
-	CAknRadioButtonSettingPage::ConstructL();
-	const TSize screenSize = iCoeEnv->ScreenDevice()->SizeInPixels();
-	FeatureManager::InitializeLibL();
 	}
 
 //
@@ -74,7 +55,6 @@
 // 
 CAutoLockSettingPage::~CAutoLockSettingPage()
 	{
-	FeatureManager::UnInitializeLib();
 	}
 
 //
@@ -85,54 +65,7 @@
 // 
 void CAutoLockSettingPage::ProcessCommandL(TInt aCommandId)
 	{
-	TInt cur = ListBoxControl()->CurrentItemIndex();
-	// Respond to softkey events
-
-	switch (aCommandId)
-		{
-		case EAknSoftkeySelect:
-		case EAknSoftkeyOk:
-			// autolock off
-			if (cur == 0)
-				{
-				iAutoLockValue = 0;
-				if(iOriginalIndex == 0)
-				    { //User re-selected "Autolock off"; no use in changing lock setting
-				        AttemptExitL(EFalse);
-				    }
-				else
-				    {
-				        AttemptExitL(ETrue);
-				    }
-				
-				}
-			// user defined
-			if (cur == 1)
-				{
-				CAutolockQuery* dlg = new (ELeave) CAutolockQuery(iAutoLockValue);
-				dlg->PrepareLC(R_AUTOLOCK_TIME_QUERY);
-				if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw ))
-				{
-				//set min and max values from SCP server to the dialog.
-				TInt minimum = 0;
-				if(iMaximum <= 0) //maximum value has not been defined; default value used instead.
-				    iMaximum = 1440;
-				dlg->SetMinimumAndMaximum(minimum, iMaximum);
-			}
-				if(dlg->RunLD())
-					{
-					AttemptExitL(ETrue);
-					}
-				else
-					AttemptExitL(EFalse);
-				}
-			break;
-
-		default:
-			CAknSettingPage::ProcessCommandL(aCommandId);
-			break;
-		}
-
+	
 	}
 //
 // ----------------------------------------------------------
@@ -142,10 +75,6 @@
 // 
 void CAutoLockSettingPage::SetPeriodMaximumValue(TInt aMaximumValue)
 	{
-	if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw ))
-	{
-		iMaximum = aMaximumValue;
-}
 	}
 	
 //---------------------------------------------------------------------------------------
@@ -157,80 +86,6 @@
 
 void CAutoLockSettingPage::HandlePointerEventL(const TPointerEvent& aPointerEvent)
     {
-    if ( AknLayoutUtils::PenEnabled() )
-        {
-        	TInt cur = ListBoxControl()->CurrentItemIndex();
-         	CAknRadioButtonSettingPage::HandlePointerEventL(aPointerEvent);
-         	//only take into account the "Up" event. Otherwise we'll end up having 2 dialogs.
-         	if(aPointerEvent.iType == TPointerEvent::EButton1Up)
-         	{
-
-         	    //only react to the event if the pen is actually inside the dialog.
-         	    if(ListBoxControl()->Rect().Contains(aPointerEvent.iPosition))
-         	        {
-         	            // autolock off
-        				if (cur == 0)
-        					{
-        					    iAutoLockValue = 0;
-        						if(iOriginalIndex == 0)
-                				    { //User re-selected "Autolock off"; no use in changing lock setting
-                				        AttemptExitL(EFalse);
-                				    }
-                				else
-                				    {
-                				        AttemptExitL(ETrue);
-                				    }
-        					}
-        				// user defined
-        				if (cur == 1)
-        					{
-        					CAutolockQuery* dlg = new (ELeave) CAutolockQuery(iAutoLockValue);
-						dlg->PrepareLC(R_AUTOLOCK_TIME_QUERY);
-					if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw ))
-					{
-        					//set min and max values from SCP server to the dialog.
-        					TInt minimum = 0;			
-				          if(iMaximum <= 0) //maximum value has not been defined; default value used instead.
-				            iMaximum = 1440;        						
-        					dlg->SetMinimumAndMaximum(minimum, iMaximum);
-				}
-        					if(dlg->RunLD())
-        						{
-        						AttemptExitL(ETrue);
-        						}
-        					else
-        						AttemptExitL(EFalse);
-         	        }
-         		
-				}
-		    }
-         	}
-        }
-//
-// ---------------------------------------------------------
-// CAutolockQuery::CAutolockQuery()
-// 
-// ---------------------------------------------------------
-//
-CAutolockQuery::CAutolockQuery(TInt& aNumber,const TTone aTone)
-	: CAknNumberQueryDialog( aNumber, aTone)
-	{
-	}
-	
-//
-// ---------------------------------------------------------
-// CAutolockQuery::PreLayoutDynInitL()
-// 
-// ---------------------------------------------------------
-//
-void CAutolockQuery::PreLayoutDynInitL()
-	{
-	CAknNumberQueryDialog::PreLayoutDynInitL();
-	if (iNumber == 0)
-		{
-		MakeLeftSoftkeyVisible(EFalse);
-		}
-	}
-    
+    }
 // End of file
 
--- a/securitydialogs/SecUi/Src/SecUiCodeQueryControl.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/securitydialogs/SecUi/Src/SecUiCodeQueryControl.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -16,7 +16,7 @@
 *
 *
 */
-
+#include <e32notif.h>
 #include <aknQueryControl.h>
 #include <aknsoundsystem.h>
 #include <aknappui.h>
--- a/securitydialogs/SecUi/Src/SecUiCodeQueryDialog.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/securitydialogs/SecUi/Src/SecUiCodeQueryDialog.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -18,13 +18,6 @@
 
 #include <AknQueryDialog.h>
 #include "secuicodequerydialog.h"
-#include <eikseced.h>
-#include "SecUiCodeQueryControl.h"
-#include "secui.hrh"
-#include <SecUi.rsg>
-#include <aknsoundsystem.h>
-#include <aknappui.h> 
-#include <AknIncallBubbleNotify.h>
 
 // ================= MEMBER FUNCTIONS =======================
 //
@@ -33,9 +26,7 @@
 // C++ constructor
 // ----------------------------------------------------------
 //
-EXPORT_C CCodeQueryDialog::CCodeQueryDialog(TDes& aDataText,TInt aMinLength,TInt aMaxLength,TInt aMode, TBool aIsRemoteLockQuery):
-			CAknTextQueryDialog(aDataText,ENoTone), iMinLength(aMinLength), iMaxLength(aMaxLength), iMode(aMode), iIsRemoteLockQuery(aIsRemoteLockQuery)
-
+EXPORT_C CCodeQueryDialog::CCodeQueryDialog(TDes& aDataText,TInt aMinLength,TInt aMaxLength,TInt aMode, TBool aIsRemoteLockQuery) : CBase()
 	{		
 	}
 //
@@ -46,462 +37,7 @@
 //
 CCodeQueryDialog::~CCodeQueryDialog()
 	{
-	#if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CCodeQueryDialog::~CCodeQueryDialog()"));
-    #endif
-    
-    if ( AknLayoutUtils::PenEnabled() )
-        {
-        TRAP_IGNORE ( SetIncallBubbleAllowedInUsualL( ETrue ) );
-        }
-    
-	if (iFront)
-		{
-		// uncapture keys  
-		if (iMode != ESecUiNone)		
-			{
-			RWindowGroup& groupWin=iCoeEnv->RootWin();
-			groupWin.CancelCaptureKeyUpAndDowns(iAppKey);
-			groupWin.CancelCaptureKeyUpAndDowns(iVoiceKey2);
-			groupWin.CancelCaptureKey(iVoiceKey1);
-			}
-			
-		CAknAppUi* aknappui =static_cast<CAknAppUi*>(iEikonEnv->EikAppUi());
-		
-		if(!iIsRemoteLockQuery)
-		    {
-		    // return normal high-priority in case there are other notifiers active 
-    		// and were are not going to lose foregroung right after following call     
-        	if (!aknappui->IsFullScreenApp())//check that we are autolock and not a "normal" i.e. full screen application.	
-    			iEikonEnv->RootWin().SetOrdinalPosition(0,ECoeWinPriorityAlwaysAtFront); 
-		    }
-		
-		 
-		iEikonEnv->BringForwards(EFalse);	
-		iEikonEnv->EikAppUi()->RemoveFromStack(this);
-		aknappui->KeySounds()->ReleaseContext();
-		aknappui->KeySounds()->PopContext();		
-		iFront = EFalse;
-		}
-	#if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CCodeQueryDialog::~CCodeQueryDialog() END"));
-    #endif
 	}
-//
-// ----------------------------------------------------------
-// CCodeQueryDialog::PreLayoutDynInitL()
-// Called by framework before dialog is shown 
-// ----------------------------------------------------------
-//
-void CCodeQueryDialog::PreLayoutDynInitL()
-    {
-    CAknTextQueryDialog::PreLayoutDynInitL();
-    
-    //disable in call bubble.
-    if ( AknLayoutUtils::PenEnabled() )
-        {
-        SetIncallBubbleAllowedInUsualL( EFalse );
-        }
-    
-	SetMaxLength(iMaxLength);
-	// Add this higher than the environment filter, otherwise
-	// we cannot capture keys from the EikSrvUi KeyFilter. 
-	// Used because this query might be called from notifier
-	if (iMode == ESecUiNone)
-		{
-		iEikonEnv->EikAppUi()->AddToStackL(this,ECoeStackPriorityEnvironmentFilter+100,ECoeStackFlagRefusesAllKeys);
-		}
-	else
-		{
-		iEikonEnv->EikAppUi()->AddToStackL(this,ECoeStackPriorityEnvironmentFilter+100,ECoeStackFlagRefusesFocus);
-		}
-	
-	// capture app,voice and end keys if necessary
-	if (iMode != ESecUiNone)		
-		{
-		
-		RWindowGroup& groupWin=iCoeEnv->RootWin();
-		// Capture app key
-		iAppKey = groupWin.CaptureKeyUpAndDowns(EStdKeyApplication0, 0, 0);
-		// capture voice key
-		iVoiceKey1 = groupWin.CaptureKey(EKeySide,0,0);
-		iVoiceKey2 = groupWin.CaptureKeyUpAndDowns(EStdKeyDevice6, 0, 0);
-		}
-    if (!iIsRemoteLockQuery)
-        {
-        MakeLeftSoftkeyVisible(EFalse);
-
-        RWsSession& wsSession = iEikonEnv->WsSession();
-        TInt myWgId = iEikonEnv->RootWin().Identifier();
-
-        TInt wgPrio = wsSession.GetWindowGroupOrdinalPriority(myWgId);
-        // we are already on forgeround, need to update priority differently
-        /*
-         if (wgPrio == ECoeWinPriorityAlwaysAtFront)
-         {
-         iEikonEnv->RootWin().SetOrdinalPosition(0,ECoeWinPriorityAlwaysAtFront+1); 
-         }
-         */
-
-        // this must be done always to keep the reference count in synch  
-        // this does not have any effect if autoforwarding has not been set true (normal application.)
-        iEikonEnv->BringForwards(ETrue, ECoeWinPriorityAlwaysAtFront + 1);
-
-        /// -- Change Window Priority for dialog and CBA 	
-        DrawableWindow()->SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront); //
-        ButtonGroupContainer().ButtonGroup()->AsControl()->DrawableWindow()->SetOrdinalPosition(
-                0, ECoeWinPriorityAlwaysAtFront);
-        }
-    	
-	//key sounds
-	static_cast<CAknAppUi*>(iEikonEnv->EikAppUi())->KeySounds()->PushContextL(R_AVKON_DEFAULT_SKEY_LIST);
-	static_cast<CAknAppUi*>(iEikonEnv->EikAppUi())->KeySounds()->BringToForeground();
-	static_cast<CAknAppUi*>(iEikonEnv->EikAppUi())->KeySounds()->LockContext();
-	iFront = ETrue;
-
-	}
-//
-// ---------------------------------------------------------
-// CCodeQueryDialog::OfferKeyEventL
-// called by framework when any key is pressed
-// ---------------------------------------------------------
-//
-TKeyResponse CCodeQueryDialog::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
-	{
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CCodeQueryDialog::OfferKeyEventL"));
-    TInt keycode = aKeyEvent.iCode;
-    RDebug::Print(_L("(SECUI)CCodeQueryDialog::OfferKeyEventL keycode: %d"), keycode);
-    TInt scancode = aKeyEvent.iScanCode;
-    RDebug::Print(_L("(SECUI)CCodeQueryDialog::OfferKeyEventL scancode: %d"), scancode);
-    #endif
-    if(!iIsRemoteLockQuery)
-        {
-        // '#' key 
-    	if( aKeyEvent.iScanCode == EStdKeyHash  && aType == EEventKeyUp)
-    		{ 
-    		TryExitL(EEikBidOk);
-    		return EKeyWasConsumed;
-    		}
-    	
-    	// '*' key
-    	if (aKeyEvent.iCode == '*')
-    		{
-    		return EKeyWasConsumed;
-    		}
-
-        }
-	
-	// app key
-	if (aKeyEvent.iScanCode == EStdKeyApplication0)
-		{
-		if (iMode == ESecUiNone)
-			{
-			TryExitL(EAknSoftkeyCancel);
-			return EKeyWasNotConsumed;	
-			}
-		return EKeyWasConsumed;
-		}
-		
-	// end key
-	if (aKeyEvent.iCode == EKeyPhoneEnd)
-		{
-		#if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CCodeQueryDialog::OfferKeyEventL: EKeyPhoneEnd"));
-        #endif
-		TryExitL(EAknSoftkeyCancel);
-		return EKeyWasConsumed;
-		}
-	if ((aKeyEvent.iScanCode == EStdKeyYes))
-	    {//Since dialler listens to down/up event, 
-	     //have to consume those to prevent it from opening
-	    if(AknLayoutUtils::PenEnabled())
-	       {
-	       CCodeQueryControl* control = STATIC_CAST(CCodeQueryControl*,Control(EGeneralQuery));
-	       if(!control->IsEmergencyCallSupportOn())
-	         { //Only needed in dialogs where there is no emergency call support
-                #if defined(_DEBUG)
-                RDebug::Print(_L("(SECUI)CCodeQueryDialog::OfferKeyEventL: Send down/up event consumed."));
-                #endif
-                return EKeyWasConsumed;
-	         }
-	       }    
-	    }
-	if (aKeyEvent.iCode == EKeyPhoneSend)
-		 {
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CCodeQueryDialog::OfferKeyEventL: EKeyPhoneSend"));
-            #endif
-		    if(AknLayoutUtils::PenEnabled())
-		        {
-		        #if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CCodeQueryDialog::OfferKeyEventL: pen enabled"));
-            #endif
-	    		 	CCodeQueryControl* control = STATIC_CAST(CCodeQueryControl*,Control(EGeneralQuery));
-	    		 	if(control->IsEmergencyCallSupportOn())
-	    		 	  {
-			    		 	#if defined(_DEBUG)
-		            RDebug::Print(_L("(SECUI)CCodeQueryDialog::OfferKeyEventL: ECS on"));
-		            #endif
-		    		 	if(!control->IsEmergencyNumber())
-		    		 	  {
-		    		 	  	#if defined(_DEBUG)
-			            RDebug::Print(_L("(SECUI)CCodeQueryDialog::OfferKeyEventL: Not E number!"));
-			            #endif
-            			
-		    		 	    ShowWarningNoteL();
-		    		 	 
-		    		 	    #if defined(_DEBUG)
-			            RDebug::Print(_L("(SECUI)CCodeQueryDialog::OfferKeyEventL: send key consumed!"));
-			            #endif
-		    		 	      return EKeyWasConsumed;
-		    		 	  }
-	    		 	  }
-	    		 	else //consume the key to prevent dialler from opening
-	    		 	    {
-                        #if defined(_DEBUG)
-                        RDebug::Print(_L("(SECUI)CCodeQueryDialog::OfferKeyEventL: No ECS. send key consumed!"));
-                        #endif
-	    		 	        return EKeyWasConsumed;
-	    		 	    }
-			      }
-		 }
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CCodeQueryDialog::OfferKeyEventL: To AVKON"));
-    #endif
-	return CAknTextQueryDialog::OfferKeyEventL(aKeyEvent,aType);
-	}
-//
-// ---------------------------------------------------------
-// CCodeQueryDialog::NeedToDismissQueryL()
-// Handles '#' key called by CAknTextQueryDialog::OfferKeyEventL()
-// ---------------------------------------------------------
-//
-TBool CCodeQueryDialog::NeedToDismissQueryL(const TKeyEvent& /*aKeyEvent*/)
-	{
-	return EFalse;
-	}
-//
-// ---------------------------------------------------------
-// CCodeQueryDialog::OkToExitL()
-// called by framework when the Softkey is pressed
-// ---------------------------------------------------------
-//
-TBool CCodeQueryDialog::OkToExitL(TInt aButtonId)
-	{
-	#if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CCodeQueryDialog::OkToExitL:%d"), aButtonId);
-    #endif
-	CCodeQueryControl* control = STATIC_CAST(CCodeQueryControl*,Control(EGeneralQuery));
-	TInt lenght = 0;
-	TBool returnvalue;
-	switch(aButtonId)
-	    {
-	    case EAknSoftkeyOk:
-		    #if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CCodeQueryDialog::OkToExitL:EAknSoftkeyOk"));
-            #endif
-            if(control)
-              {
-                lenght = control->GetTextLength();
-              }
-		    if (lenght < iMinLength)
-			    {
-			    #if defined(_DEBUG)
-                RDebug::Print(_L("(SECUI)CCodeQueryDialog::OkToExitL:length < MIN: %d"), lenght);
-                #endif	
-		    	// code was too short -> play error tone & clear editor
-			    if (lenght != 0)
-				    {
-				    #if defined(_DEBUG)
-                    RDebug::Print(_L("(SECUI)CCodeQueryDialog::OkToExitL:length < MIN, Play Sound"));
-                    #endif
-                    if(control)
-                        {
-                        
-			    	    control->PlaySound(EAvkonSIDErrorTone);
-				        #if defined(_DEBUG)
-                        RDebug::Print(_L("(SECUI)CCodeQueryDialog::OkToExitL:length < MIN, Reset Editor"));
-                        #endif
-				        control->ResetEditorL();
-                        }
-				    }
-			    returnvalue = EFalse;
-			    }	
-		    else
-			    {
-			    #if defined(_DEBUG)
-                RDebug::Print(_L("(SECUI)CCodeQueryDialog::OkToExitL:length >= MIN: %d"), lenght);
-                #endif		
-			    returnvalue = CAknTextQueryDialog::OkToExitL(aButtonId);
-			    }
-            break;
-		
-	    case EEikBidCancel: //Also includes EAknSoftkeyCancel as they have the same numerical value
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CCodeQueryDialog::OkToExitL:EEikBidCancel"));
-            #endif       
-            if(iMode != ESecUiNone) //PUK1 code or PIN1 in boot. Must not exit until code has been input.
-                {
-                #if defined(_DEBUG)
-                RDebug::Print(_L("(SECUI)CCodeQueryDialog::OkToExitL:EEikBidCancel: get length."));
-                #endif   
-                if(control)
-                  {
-                    lenght = control->GetTextLength();
-                  }
-                returnvalue = EFalse;
-                if (lenght > 0) //reset editor
-                    {  
-                    #if defined(_DEBUG)
-                    RDebug::Print(_L("(SECUI)CCodeQueryDialog::OkToExitL:EEikBidCancel: length >0."));
-                    #endif              
-                     if (control)
-                       {
-                        #if defined(_DEBUG)
-                        RDebug::Print(_L("(SECUI)CCodeQueryDialog::OkToExitL:EEikBidCancel, reset editor"));
-                        #endif
-                        control->ResetEditorL();
-                       }
-                    }
-                }
-            else
-                returnvalue = ETrue;
-            break;
-        case  ESecUiEmergencyCall: //user has called emergency number from dialog; exit.
-        	#if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CCodeQueryDialog::OkToExitL:Emergency Call"));
-            #endif
-        	returnvalue = ETrue;
-        	break;
-        case EAknSoftkeyEmergencyCall:
-            returnvalue = ETrue;
-            CAknTextQueryDialog::OkToExitL(aButtonId);
-            break;
-	    case ESecUiDeviceLocked: //Dialog was left open when Device lock was activated by timer and must be closed.
-	    	#if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CCodeQueryDialog::OkToExitL:Phone Locked"));
-            #endif
-	    	if(iMode == ESecUiNone)  
-                 returnvalue = ETrue;//Not a PUK1 code query.
-            else
-            	 returnvalue = EFalse;
-	    	break;
-        default:
-        	#if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CCodeQueryDialog::OkToExitL:DEFAULT!"));
-            #endif  
-            if(iMode == ESecUiNone)
-		        returnvalue = ETrue;
-		    else
-                returnvalue = EFalse;
-            break;
-	    }
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CCodeQueryDialog::OkToExitL:END: %d"), returnvalue);
-    #endif
-	return returnvalue;
-	}
-//
-// ---------------------------------------------------------
-// CCodeQueryDialog::HandleQueryEditorStateEventL()
-// Gets called when editor sends state event
-// ---------------------------------------------------------
-//
-TBool CCodeQueryDialog::HandleQueryEditorStateEventL(CAknQueryControl* aQueryControl, 
-													TQueryControlEvent aEventType, 
-													TQueryValidationStatus aStatus)
-{
-	
-    if (aEventType == MAknQueryControlObserver::EEmergencyCallAttempted)
-        {
-        TryExitL(ESecUiEmergencyCall);
-        return EFalse;
-        }
-    else
-    	{
-    	return CAknQueryDialog::HandleQueryEditorStateEventL(aQueryControl, aEventType, aStatus );
-    	}
-    
-
-}
-//
-// ---------------------------------------------------------
-// CCodeQueryDialog::TryCancelQueryL()
-// Gets called when a client wishes to cancel the query
-// ---------------------------------------------------------
-//
-void CCodeQueryDialog::TryCancelQueryL(TInt aReason)
-{
-	#if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CCodeQueryDialog::TryCancelQuery BEGIN"));
-    #endif
-	TryExitL(aReason);
-	#if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CCodeQueryDialog::TryCancelQuery END"));
-    #endif
-}
-
-// -----------------------------------------------------------------------------
-// CCodeQueryDialog::CheckIfEntryTextOk()
-// -----------------------------------------------------------------------------
-//
-TBool CCodeQueryDialog::CheckIfEntryTextOk() const
-    {
-	CCodeQueryControl* control = STATIC_CAST(CCodeQueryControl*,Control(EGeneralQuery));
-	if (control)
-	{
-		control->GetText(iDataText);
-	}
-	const TInt textLength = Text().Length();
-	return (textLength <= iMaxLength && textLength >= iMinLength);
-    }
-
-// -----------------------------------------------------------------------------
-// CCTPinQueryDialog::UpdateLeftSoftKeyL()
-// -----------------------------------------------------------------------------
-//
-void CCodeQueryDialog::UpdateLeftSoftKeyL()
-    {
-	CAknTextQueryDialog::UpdateLeftSoftKeyL();
-    if(iIsRemoteLockQuery)
-	    MakeLeftSoftkeyVisible(CheckIfEntryTextOk());
-    }
-// -----------------------------------------------------------------------------
-// CCodeQueryDialog::ShowWarningNoteL()
-// -----------------------------------------------------------------------------
-//
-void CCodeQueryDialog::ShowWarningNoteL()
-    {
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CCodeQueryDialog::ShowWarningNoteL BEGIN"));
-    #endif
-    
-    CAknNoteDialog* noteDlg = new (ELeave) CAknNoteDialog();
-    noteDlg->PrepareLC(R_EMERGENCY_CALLS_ONLY);
-    noteDlg->SetTimeout(CAknNoteDialog::ELongTimeout);
-    noteDlg->SetTone(CAknNoteDialog::EErrorTone);
-    
-    noteDlg->DrawableWindow()->SetOrdinalPosition(0,ECoeWinPriorityAlwaysAtFront+1); //
-    noteDlg->ButtonGroupContainer().ButtonGroup()->AsControl()->DrawableWindow()->SetOrdinalPosition(0,ECoeWinPriorityAlwaysAtFront+1); 
-    
-    noteDlg->RunLD();
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CCodeQueryDialog::ShowWarningNoteL END"));
-    #endif
-    }
-
-// -----------------------------------------------------------------------------
-// CCodeQueryDialog::SetIncallBubbleAllowedInUsualL()
-// -----------------------------------------------------------------------------
-//
-void CCodeQueryDialog::SetIncallBubbleAllowedInUsualL(TBool aAllowed)
-    {
-    CAknIncallBubble *incallBubble =  CAknIncallBubble::NewL();
-    CleanupStack::PushL(incallBubble);
-    incallBubble->SetIncallBubbleAllowedInUsualL( aAllowed );
-    CleanupStack::PopAndDestroy();
-    }
 
 // End of file
 
--- a/securitydialogs/SecUi/Src/SecUiManualSecuritySettings.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/securitydialogs/SecUi/Src/SecUiManualSecuritySettings.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -18,9 +18,11 @@
 
 
 #include <rmmcustomapi.h>
-#include <SecUi.rsg>
+#include "SecQueryUi.h"
 #include "secuimanualsecuritysettings.h"
+#include "secuisecuritysettings.h"
 #include <exterror.h>
+#include "SecUi.h"
 #include "SecUiWait.h"
 #include <mmtsy_names.h>
     /*****************************************************
@@ -107,6 +109,7 @@
         // May also return KErrAlreadyExists if something else
         // has already loaded the TSY module. And that is
         // not an error.
+        RDEBUG("err", err);
         User::LeaveIfError( err );
         }
 
@@ -132,15 +135,11 @@
     *    Series 60 Customer / TSY
     *    Needs customer TSY implementation
     *****************************************************/
-	#if defined(_DEBUG)
-	RDebug::Print(_L("(SECUI)CManualSecuritySettings::~CManualSecuritySettings()"));
-	#endif
+		RDEBUG("0", 0);
     // Cancel active requests
     if(iWait->IsActive())
     {
-        #if defined(_DEBUG)
-	    RDebug::Print(_L("(SECUI)CManualSecuritySettings::~CManualSecuritySettings() CANCEL REQ"));
-	    #endif
+      RDEBUG("CancelAsyncRequest", 0);
         iPhone.CancelAsyncRequest(iWait->GetRequestType());
     }
     // close phone
@@ -157,9 +156,7 @@
         }
     delete iNote;
     delete iWait;
-	#if defined(_DEBUG)
-	RDebug::Print(_L("(SECUI)CManualSecuritySettings::~CManualSecuritySettings() END"));
-	#endif  
+	RDEBUG("0", 0);
     }
 
 //
@@ -174,14 +171,10 @@
     *    Series 60 Customer / ETel
     *    Series 60  ETel API
     *****************************************************/
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CManualSecuritySettings::ChangePinL()"));
-    #endif        
+    RDEBUG("aPin", aPin);
     if (aPin == EPin1)
         {
-		#if defined(_DEBUG)
-		RDebug::Print(_L("(SECUI)CManualSecuritySettings::ChangePinL() PIN1"));
-		#endif        
+				RDEBUG("EPin1", EPin1);
         RMobilePhone::TMobilePhoneLock lockType;
         RMobilePhone::TMobilePhoneLockInfoV1 lockInfo;
         RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo);
@@ -192,13 +185,12 @@
         // The following is required, since the new multimode Etel is asynchronous
         // rather than synchronous.
     
-		#if defined(_DEBUG)
-		RDebug::Print(_L("(SECUI)CManualSecuritySettings::ChangePinL() GetLockInfo"));
-		#endif
-
+				RDEBUG("SetRequestType", EMobilePhoneGetLockInfo);
         iWait->SetRequestType(EMobilePhoneGetLockInfo);
         iPhone.GetLockInfo(iWait->iStatus, lockType, lockInfoPkg);
+        RDEBUG("WaitForRequestL", 0);
         TInt res = iWait->WaitForRequestL();
+        RDEBUG("WaitForRequestL res", res);
          
         if (res != KErrNone)
             return EFalse;
@@ -210,9 +202,7 @@
             }
         }
     
-	#if defined(_DEBUG)
-	RDebug::Print(_L("(SECUI)CManualSecuritySettings::ChangePinL() CompareF"));
-	#endif
+		RDEBUG("CompareF", 0);
     if (aNew.CompareF(aVerifyNew) != 0)     
         {
         // codes do not match note 
@@ -235,17 +225,13 @@
     aChange.iOldPassword = aOld;
     aChange.iNewPassword = aNew;
 
-	#if defined(_DEBUG)
-	RDebug::Print(_L("(SECUI)CManualSecuritySettings::ChangePinL() ChangeSecurityCode"));
-	#endif
+		RDEBUG("EMobilePhoneChangeSecurityCode", EMobilePhoneChangeSecurityCode);
     iWait->SetRequestType(EMobilePhoneChangeSecurityCode);
     iPhone.ChangeSecurityCode(iWait->iStatus,secCodeType,aChange);
+    RDEBUG("WaitForRequestL", 0);
     TInt res = iWait->WaitForRequestL();
+    RDEBUG("WaitForRequestL res", res);
     
-	#if defined(_DEBUG)
-	RDebug::Print(_L("(SECUI)CManualSecuritySettings::ChangePinL() ChangeSecurityCode RES: %d"), res);
-	#endif
-
     switch(res)
         {        
         case KErrNone:
@@ -267,7 +253,9 @@
             else
                 {
                 iCustomPhone.CheckSecurityCode(iWait->iStatus,RMmCustomAPI::ESecurityCodePuk2);
+               	RDEBUG("WaitForRequestL", 0);
                 TInt res = iWait->WaitForRequestL();
+                RDEBUG("WaitForRequestL res", res);
                 }
             break;
         case KErrGsm0707OperationNotAllowed:
@@ -288,9 +276,7 @@
 //
 EXPORT_C void CManualSecuritySettings::CancelChangePin()
     {
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CManualSecuritySettings::CancelChangePin()"));
-    #endif    
+    RDEBUG("0", 0);
     delete iNote;
     iNote = NULL;
     }
@@ -306,9 +292,7 @@
     *    Series 60 Customer / ETel
     *    Series 60  ETel API
     *****************************************************/
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CManualSecuritySettings::UnblockPinL()"));
-    #endif        
+    RDEBUG("0", 0);  
     if (aNew.CompareF(aVerifyNew) != 0)     
         {
         // codes do not match note 
@@ -326,10 +310,12 @@
         {
         blockCodeType = RMobilePhone::ESecurityCodePuk2;
         }
-
+		RDEBUG("blockCodeType", blockCodeType);
     iWait->SetRequestType(EMobilePhoneVerifySecurityCode);
     iPhone.VerifySecurityCode(iWait->iStatus, blockCodeType, aNew, aPuk);
+    RDEBUG("WaitForRequestL", 0);
     TInt res = iWait->WaitForRequestL();
+    RDEBUG("WaitForRequestL res", res);
 
     switch(res)
         {        
@@ -368,9 +354,7 @@
 //    
 EXPORT_C void CManualSecuritySettings::CancelUnblockPin()
     {
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CManualSecuritySettings::CancelUnblockPinL()"));
-    #endif        
+    RDEBUG("0", 0);      
     delete iNote;
     iNote = NULL;        
     }
@@ -386,19 +370,15 @@
     *    Series 60 Customer / ETel
     *    Series 60  ETel API
     *****************************************************/
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CManualSecuritySettings::LockSimL()"));
-    #endif
-
-    
+    RDEBUG("0", 0);
     RMmCustomAPI::TLockNumber aLockType;
     TInt ret = KErrGsm0707IncorrectPassword;
     TInt length = aLockCode.Length();
 
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CManualSecuritySettings::LockSimL(): Param length: %d"), length);
-    #endif
-
+    RDEBUG("length", length);
+		// from now on, it accepts restricted lengths, although some locks are 20, others are 13
+    if(aLockCode.Length() <= KSimLockMaxPasswordSize)
+    {
     if (aType.CompareF(Operator) == 0)
         {
         aLockType = RMmCustomAPI::EOperator;
@@ -434,10 +414,9 @@
         aLockType = RMmCustomAPI::EOperator_Gid2;
         ret = iCustomPhone.ActivateSimLock( aLockCode,aLockType );
         }
+    }
 
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CManualSecuritySettings::LockSimL() RESULT: %d"), ret);
-    #endif
+    RDEBUG("ret", ret);
     switch (ret)
         {
         case KErrNone:
@@ -472,9 +451,7 @@
 //        
 EXPORT_C void CManualSecuritySettings::CancelLockSim()
     {
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CManualSecuritySettings::CancelLockSimL()"));
-    #endif
+    RDEBUG("0", 0);
     delete iNote;
     iNote = NULL;    
     }    
@@ -490,17 +467,15 @@
     *    Series 60 Customer / ETel
     *    Series 60  ETel API
     *****************************************************/
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CManualSecuritySettings::UnLockSimL()"));
-    #endif
+    RDEBUG("0", 0);
     RMmCustomAPI::TLockNumber aLockType;
     TInt ret = KErrGsm0707IncorrectPassword;
     TInt length = aUnlockCode.Length();
 
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CManualSecuritySettings::UnLockSimL(): Param length: %d"), length);
-    #endif
-    
+    RDEBUG("length", length);
+		// from now on, it accepts restricted lengths, although some locks are 20, others are 13
+    if(aUnlockCode.Length() <= KSimLockMaxPasswordSize)
+    {
     if (aType.CompareF(Operator) == 0)
         {
         aLockType = RMmCustomAPI::EOperator;
@@ -542,9 +517,8 @@
         ret = iCustomPhone.DeActivateSimLock( aUnlockCode,aLockType );
         }    
         
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CManualSecuritySettings::UnLockSimL() RESULT: %d"), ret);
-    #endif
+    }
+    RDEBUG("ret", ret);
     switch (ret)
         {
         case KErrNone:
@@ -577,9 +551,7 @@
 //                
 EXPORT_C void CManualSecuritySettings::CancelUnlockSim()
     {
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CManualSecuritySettings::CancelUnLockSimL()"));
-    #endif
+    RDEBUG("0", 0);
     delete iNote;
     iNote = NULL;
     }
@@ -592,13 +564,8 @@
 //
 void CManualSecuritySettings::ShowResultNoteL(CAknNoteDialog::TTone aTone, TInt aResourceID)
     {
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CManualSecuritySettings::CancelUnLockSimL()"));
-    #endif
-    iNote = new (ELeave) CAknNoteDialog(REINTERPRET_CAST(CEikDialog**,&iNote));
-    iNote->SetTimeout(CAknNoteDialog::ELongTimeout);
-    iNote->SetTone(aTone);
-    iNote->ExecuteLD(aResourceID);
+    RDEBUG("aResourceID", aResourceID);
+    CSecuritySettings::ShowResultNoteL(aResourceID, aTone);
     }
 
 // End of file
--- a/securitydialogs/SecUi/Src/SecUiRemoteLockSettingPage.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/securitydialogs/SecUi/Src/SecUiRemoteLockSettingPage.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -54,6 +54,8 @@
 
     CAknRadioButtonSettingPage::ConstructL();
     const TSize screenSize = iCoeEnv->ScreenDevice()->SizeInPixels();
+    iPopoutCba = CEikButtonGroupContainer::NewL( CEikButtonGroupContainer::ECba, CEikButtonGroupContainer::EHorizontal, this, R_AVKON_SOFTKEYS_OK_CANCEL__OK );
+    iPopoutCba->SetBoundingRect( TRect( screenSize ) );
 
     #ifdef _DEBUG
     RDebug::Print( _L( "(SecUi)CRemoteLockSettingPage::ConstructL() - Exit" ) );
@@ -74,6 +76,9 @@
     RDebug::Print( _L( "(SecUi)CRemoteLockSettingPage::~CRemoteLockSettingPage() - Enter" ) );
     #endif // DEBUG
 
+    delete iPopoutCba;
+    iPopoutCba = NULL;
+
     #ifdef _DEBUG
     RDebug::Print( _L( "(SecUi)CRemoteLockSettingPage::~CRemoteLockSettingPage() - Exit" ) );
     #endif // DEBUG
--- a/securitydialogs/SecUi/Src/SecUiSecurityHandler.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/securitydialogs/SecUi/Src/SecUiSecurityHandler.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -1,64 +1,65 @@
 /*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Provides api for handling security events.
-*
-*
-*/
-
-
+ * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  Provides api for handling security events.
+ *
+ *
+ */
+#include <e32notif.h>
 #include <aknnotedialog.h>
 #include <etelmm.h>
-#include <SecUi.rsg>
+// #include <SecUi.rsg>
 #include <exterror.h>
 #include <textresolver.h>
 
 #ifdef __COVER_DISPLAY
 #include <aknmediatorfacade.h>
-#include <secondarydisplay/SecondaryDisplayStartupAPI.h>
 #endif //__COVER_DISPLAY
+#include <centralrepository.h> 
+#include <e32property.h>
 
-#include <centralrepository.h> 
-#include <starterclient.h>     //used for RemoveSplashScreen
-#include <e32property.h>
 #include <PSVariables.h>   // Property values
 #include <coreapplicationuisdomainpskeys.h>
 #include <startupdomainpskeys.h>
-#include <uikon/eiksrvui.h>
+// #include <uikon/eiksrvui.h>
 #include <settingsinternalcrkeys.h>
 #include <securityuisprivatepskeys.h>
-#include <AknNotiferAppServerApplication.h>
+// #include <AknNotiferAppServerApplication.h>
 
 #include <SCPClient.h>
 #include <securitynotification.h>
 #include "secui.hrh"
+#include "SecUi.h"
 #include "secuisecurityhandler.h"
 #include "secuicodequerydialog.h"
 #include "secuisecuritysettings.h"
 #include "SecUiWait.h"
-#include "SecUiLockObserver.h"
-#ifdef RD_REMOTELOCK
+// #include "SecUiLockObserver.h"
 #include <RemoteLockSettings.h>
-#endif // RD_REMOTELOCK
 #include <StringLoader.h>
 #include <featmgr.h>
+#include <hb/hbcore/hbtextresolversymbian.h>
+
+#include "SecQueryUi.h"
+
 //  LOCAL CONSTANTS AND MACROS
 const TInt KMaxNumberOfPUKAttempts(10);
 const TInt KMaxNumberOfPINAttempts(3);
-const TInt KLastRemainingInputAttempt(1);
+// not used
+// const TInt KLastRemainingInputAttempt(1);
 
-const TInt KTriesToConnectServer( 2 );
-const TInt KTimeBeforeRetryingRequest( 50000 );
+const TInt KTriesToConnectServer(2);
+const TInt KTimeBeforeRetryingRequest(50000);
 
 // ================= MEMBER FUNCTIONS =======================
 //
@@ -66,12 +67,21 @@
 // CSecurityHandler::CSecurityHandler()
 // C++ constructor
 // ----------------------------------------------------------
-//
-EXPORT_C CSecurityHandler::CSecurityHandler(RMobilePhone& aPhone):
-        iPhone(aPhone), iQueryCanceled(ETrue), iSecurityDlg(NULL), iNoteDlg(NULL) 
+// qtdone
+EXPORT_C CSecurityHandler::CSecurityHandler(RMobilePhone& aPhone) :
+    iPhone(aPhone), iQueryCanceled(ETrue), iSecurityDlg(NULL), iNoteDlg(NULL)
     {
-        TInt result = iCustomPhone.Open(aPhone);
-        TRAP_IGNORE( FeatureManager::InitializeLibL() ); //Shouldn't this panic if FM does not initialise??
+    RDEBUG("0", 0);
+
+    TInt result = iCustomPhone.Open(aPhone);
+    RDEBUG("result", result);
+    TRAP_IGNORE(FeatureManager::InitializeLibL()); //Shouldn't this panic if FM does not initialise??
+
+    _LIT(KFileName, "secui_");
+    _LIT(KPath, "z:/resource/qt/translations/");
+    RDEBUG("HbTextResolverSymbian", 0);
+    result = HbTextResolverSymbian::Init(KFileName, KPath);
+    RDEBUG("result", result);
     }
 
 //
@@ -79,32 +89,49 @@
 // CSecurityHandler::~CSecurityHandler()
 // Destructor
 // ----------------------------------------------------------
-//
+// qtdone
 EXPORT_C CSecurityHandler::~CSecurityHandler()
     {
-    #if defined(_DEBUG)
-    RDebug::Print(_L("CSecurityHandler::~CSecurityHandler()"));
-    #endif
-    if ( iDestroyedPtr )
+    RDEBUG("0", 0);
+
+    if (iDestroyedPtr)
         {
         *iDestroyedPtr = ETrue;
         iDestroyedPtr = NULL;
         }
-    CancelSecCodeQuery();
+    RDEBUG("calling CancelOpenQuery", 0);
+    TInt err = CancelOpenQuery(-1);
+    RDEBUG("err", err);
     iCustomPhone.Close();
     FeatureManager::UnInitializeLib();
+    RDEBUG("1", 1);
     }
 //
 // ----------------------------------------------------------
 // CSecurityHandler::HandleEventL()
 // Handles different security events
 // ----------------------------------------------------------
+// qtdone
+EXPORT_C void CSecurityHandler::HandleEventL(RMobilePhone::TMobilePhoneSecurityEvent aEvent)
+    {
+    RDEBUG("0", 0);
+
+    TInt result = KErrNone;
+    HandleEventL(aEvent, result);
+    }
+
 //
-EXPORT_C void CSecurityHandler::HandleEventL(
-    RMobilePhone::TMobilePhoneSecurityEvent aEvent )
+// ----------------------------------------------------------
+// CSecurityHandler::HandleEventL()
+// Handles different security events
+// ----------------------------------------------------------
+// qtdone
+EXPORT_C void CSecurityHandler::HandleEventL(RMobilePhone::TMobilePhoneSecurityEvent aEvent, TBool aStartup, TInt& aResult)
     {
-    TInt result = KErrNone;
-    HandleEventL( aEvent, result );
+    RDEBUG("0", 0);
+
+    iStartup = aStartup;
+    HandleEventL(aEvent, aResult);
     }
 
 //
@@ -112,422 +139,300 @@
 // CSecurityHandler::HandleEventL()
 // Handles different security events
 // ----------------------------------------------------------
-//
-EXPORT_C void CSecurityHandler::HandleEventL(
-    RMobilePhone::TMobilePhoneSecurityEvent aEvent,
-    TBool aStartup, TInt& aResult )
+// qtdone
+EXPORT_C void CSecurityHandler::HandleEventL(RMobilePhone::TMobilePhoneSecurityEvent aEvent, TInt& aResult)
     {
-    iStartup = aStartup;
-    HandleEventL( aEvent, aResult );
-    }
-    
-//
-// ----------------------------------------------------------
-// CSecurityHandler::HandleEventL()
-// Handles different security events
-// ----------------------------------------------------------
-//
-EXPORT_C void CSecurityHandler::HandleEventL(
-    RMobilePhone::TMobilePhoneSecurityEvent aEvent, TInt& aResult )
-    {
+    RDEBUG("0", 0);
+
     /*****************************************************
-    *    Series 60 Customer / ETel
-    *    Series 60  ETel API
-    *****************************************************/
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecurityHandler::HandleEventL()"));
-    RDebug::Print(_L("(SECUI)CSecurityHandler::HandleEventL() EVENT: %d"), aEvent);
-    #endif
-    TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ));
-    TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin ));
- 
-    switch(aEvent)
-            {
-            case RMobilePhone::EPin1Required:
-                #if defined(_DEBUG)
-                RDebug::Print(_L("(SECUI)CSecurityHandler::HandleEventL() Pin1Required"));
-                #endif
-                aResult = Pin1RequiredL();
-                break;
-            case RMobilePhone::EPuk1Required:
-                #if defined(_DEBUG)
-                RDebug::Print(_L("(SECUI)CSecurityHandler::HandleEventL() PUK1Required"));
-                #endif
-                ((CAknNotifierAppServerAppUi*)(CEikonEnv::Static())->EikAppUi())->SuppressAppSwitching(ETrue);
-                TRAPD(err,aResult = Puk1RequiredL());
-                ((CAknNotifierAppServerAppUi*)(CEikonEnv::Static())->EikAppUi())->SuppressAppSwitching(EFalse);
-                User::LeaveIfError(err);
-                break;
-            case RMobilePhone::EPin2Required:
-                Pin2RequiredL();
-                break;
-            case RMobilePhone::EPuk2Required:
-                Puk2RequiredL();        
-                break;
-            case RMobilePhone::EUniversalPinRequired:
-                if(wcdmaSupported || upinSupported)
-                   {
-                       aResult = UPinRequiredL();
-                   }
-                else
-                    aResult = KErrNotSupported;
-                break;
-            case RMobilePhone::EUniversalPukRequired:
-                if(wcdmaSupported || upinSupported)
-                   {
-                       aResult = UPukRequiredL();
-                   }
-                else
-                    aResult = KErrNotSupported;
-                break;
-            case RMobilePhone::EPhonePasswordRequired:
-                aResult = PassPhraseRequiredL();
-                break;
-            case RMobilePhone::EICCTerminated:
-                SimLockEventL();
-                break;
-            default:
-                break;
-            }
-    #if defined(_DEBUG)
-    RDebug::Print( _L( "CSecurityHandler::HandleEventL() returning %d." ), aResult );
-    #endif
+     *    Series 60 Customer / ETel
+     *    Series 60  ETel API
+     *****************************************************/
+    TBool wcdmaSupported(FeatureManager::FeatureSupported(KFeatureIdProtocolWcdma));
+    TBool upinSupported(FeatureManager::FeatureSupported(KFeatureIdUpin));
+    RDEBUG("aEvent", aEvent);
+
+    switch (aEvent)
+        {
+        case RMobilePhone::EPin1Required:
+            RDEBUG("RMobilePhone::EPin1Required", 0)
+            ;
+            aResult = Pin1RequiredL();
+            break;
+        case RMobilePhone::EPuk1Required:
+            RDEBUG("RMobilePhone::EPuk1Required", 0)
+            ;
+            Puk1RequiredL();
+            break;
+        case RMobilePhone::EPin2Required:
+            Pin2RequiredL();
+            break;
+        case RMobilePhone::EPuk2Required:
+            Puk2RequiredL();
+            break;
+        case RMobilePhone::EUniversalPinRequired:
+            if (wcdmaSupported || upinSupported)
+                {
+                aResult = UPinRequiredL();
+                }
+            else
+                aResult = KErrNotSupported;
+            break;
+        case RMobilePhone::EUniversalPukRequired:
+            if (wcdmaSupported || upinSupported)
+                {
+                aResult = UPukRequiredL();
+                }
+            else
+                aResult = KErrNotSupported;
+            break;
+        case RMobilePhone::EPhonePasswordRequired:
+            aResult = PassPhraseRequiredL();
+            break;
+        case RMobilePhone::EICCTerminated:
+            SimLockEventL();
+            break;
+        default:
+            RDEBUG("default", aEvent)
+            ;
+            break;
+        }
+    RDEBUG("aResult", aResult);
     }
 //
 // ----------------------------------------------------------
 // CSecurityHandler::AskSecCodeL()
 // For asking security code e.g in settings
 // ----------------------------------------------------------
-//
+// qtdone
 EXPORT_C TBool CSecurityHandler::AskSecCodeL()
-    {        
+    {
     /*****************************************************
-    *    Series 60 Customer / ETel
-    *    Series 60  ETel API
-    *****************************************************/
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecurityHandler::AskSecCodeL()"));
-    #endif
+     *    Series 60 Customer / ETel
+     *    Series 60  ETel API
+     *****************************************************/
+    RDEBUG("0", 0);
+    // if code is still not initialized, then there's no need to ask it. This fixes the error when the RFS requests the code.
+    const TUid KCRUidSCPLockCode =
+        {
+        0x2002677B
+        };
+    const TUint32 KSCPLockCodeDefaultLockCode = 0x00000001;
 
-    /* if code is still not initialized, then there's no need to ask it. This fixes the error when the RFS requests the code */
-    const TUid KCRUidSCPLockCode = {0x2002677B};
-    const TUint32 KSCPLockCodeDefaultLockCode = 0x00000001;
-	
     CRepository* repository = CRepository::NewL(KCRUidSCPLockCode);
     TInt currentLockStatus = -1;
-    TInt res=-1;
+    TInt res = -1;
+    TInt lAlphaSupported = 0;
+    TInt lCancelSupported = 0;
+    RMobilePhone::TMobilePassword iSecUi_password;
 
-    res = repository->Get(KSCPLockCodeDefaultLockCode , currentLockStatus);
-    #if defined(_DEBUG)
-    RDebug::Printf( "%s %s (%u) res=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, res );
-    RDebug::Printf( "%s %s (%u) currentLockStatus=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, currentLockStatus );
-    #endif
+    res = repository->Get(KSCPLockCodeDefaultLockCode, currentLockStatus);	// 0x3039 = 12345
+    RDEBUG("res", res);
+    RDEBUG("currentLockStatus", currentLockStatus);
     delete repository;
-    if(res==0 && currentLockStatus>=1 )
+    if (res == 0 && (currentLockStatus == 1 || currentLockStatus == 12345) )
         {
-        // code is the default one; no need to request it.
-        return ETrue;
+        // code is the default one
+        RDEBUG("code is the default one; supply as default", 1);
+        iSecUi_password.Copy(_L("12345"));
+        // RDEBUG("code is the default one; no need to request it", 1);
+        // return ETrue;
         }
-    /* end check for default code */
+    // end check for default code
 
-    // Destructor sets thisDestroyed to ETrue
-    TBool thisDestroyed( EFalse );
-    iDestroyedPtr = &thisDestroyed;
-    
-    iQueryCanceled = EFalse;
-    RMobilePhone::TMobilePassword password;
     RMobilePhone::TMobilePassword required_fourth;
-        
+
     TInt ret = KErrNone;
-    TInt err = KErrNone;
     TInt status = KErrNone;
-    if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw ) &&
-    		FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements))
-    {
-        // Connect to the SCP server, and request the code query
-        RSCPClient scpClient;
-        User::LeaveIfError( scpClient.Connect() );
-        CleanupClosePushL( scpClient );      
-        status = scpClient.SecCodeQuery( password, 
-                                      RSCPClient::SCP_OK_CANCEL,
-                                      EFalse,
-                                      0 );         
-                                              
-        if ( status != KErrCancel )
-            {
-            // Set this "true" to indicate that the input wasn't cancelled
-            ret = ETrue;
-            }
-        else
+
+    TInt queryAccepted = KErrCancel;
+
+    while (queryAccepted != KErrNone)
+        {
+        RMobilePhone::TMobilePhoneSecurityCode secCodeType;
+        secCodeType = RMobilePhone::ESecurityCodePhonePassword;
+
+        /* request PIN using QT */
+        CSecQueryUi *iSecQueryUi;
+        RDEBUG("CSecQueryUi", 0);
+        iSecQueryUi = CSecQueryUi::NewL();
+        iQueryCanceled = EFalse;
+        lAlphaSupported = ESecUiAlphaSupported;
+        lCancelSupported = ESecUiCancelSupported;
+        TBuf<0x100> title;
+        title.Zero();
+        HBufC* stringHolder = HbTextResolverSymbian::LoadLC(_L("txt_pin_code_dialog_sec_code"));
+        title.Append(stringHolder->Des());
+        CleanupStack::PopAndDestroy(stringHolder);
+        title.Append(_L("$"));
+        title.AppendNum(-1);	// Don't know the number of remaining attempts
+        queryAccepted = iSecQueryUi->SecQueryDialog(title, iSecUi_password, SEC_C_SECURITY_CODE_MIN_LENGTH, SEC_C_SECURITY_CODE_MAX_LENGTH, ESecUiSecretSupported | lAlphaSupported
+                | lCancelSupported | secCodeType);
+        RDEBUG("iSecUi_password", 0);
+        RDEBUGSTR(iSecUi_password);
+        RDEBUG("delete", 0);
+        iQueryCanceled = ETrue;
+        delete iSecQueryUi;
+        RDEBUG("queryAccepted", queryAccepted);
+        /* end request PIN using QT */
+        if (queryAccepted != KErrNone)
             {
             ret = EFalse;
+            return ret;
             }
-        
-        CleanupStack::PopAndDestroy(); //scpClient                       
-  }
-  else
-  {
-    iSecurityDlg = new (ELeave) CCodeQueryDialog (password,SEC_C_SECURITY_CODE_MIN_LENGTH,SEC_C_SECURITY_CODE_MAX_LENGTH,ESecUiNone);
-    #ifdef __COVER_DISPLAY
-    iSecurityDlg->PublishDialogL(SecondaryDisplay::ECmdShowSecurityQuery, SecondaryDisplay::KCatStartup);
-    CAknMediatorFacade* covercl = AknMediatorFacade(iSecurityDlg); // uses MOP, so control provided
-	if (covercl) // returns null if __COVER_DISPLAY is not defined
-    	{
-    	// … -  add data that cover ui is interested in
-    	covercl->BufStream().WriteInt32L(SecondaryDisplay::EShowSecCode);// adds int to additional data to be posted to cover ui
-    	covercl->BufStream().CommitL(); // no more data to send so commit buf
-     	}  
-    #endif //__COVER_DISPLAY
-	    CSecUiLockObserver* deviceLockStatusObserver = CSecUiLockObserver::NewL(iSecurityDlg);
-		CleanupStack::PushL(deviceLockStatusObserver);
-		err =KErrNone;
-	    TRAP(err,ret = iSecurityDlg->ExecuteLD(R_SECURITY_QUERY));
-		CleanupStack::PopAndDestroy(deviceLockStatusObserver);
-  }
-    
-    // check if CSecurityHandler has been "killed"
-    if ( thisDestroyed )
-        {
-        return EFalse;
-        }
 
-    iDestroyedPtr = NULL;
-    iSecurityDlg = NULL;
+        CWait* wait = CWait::NewL();
+        RDEBUG("VerifySecurityCode", 0);
+        iPhone.VerifySecurityCode(wait->iStatus, secCodeType, iSecUi_password, required_fourth);
+        RDEBUG("WaitForRequestL", 0);
+        status = wait->WaitForRequestL();
+        RDEBUG("status", status);
+        delete wait;
+#ifdef __WINS__
+        if (status == KErrNotSupported || status == KErrTimedOut)
+            {
+            RDEBUG("status", status);
+            status = KErrNone;
+            }
+#endif
 
-    if (err != KErrNone)
-        {
-        User::Leave(err);
-        }
-
-    if (ret)
-        {
-        while (!iQueryCanceled)
+        ret = ETrue;
+        queryAccepted = KErrCancel; // because it's not yet validated
+        switch (status)
             {
-	           if (!FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements))
-		           {           
-		                RMobilePhone::TMobilePhoneSecurityCode secCodeType;
-		                secCodeType = RMobilePhone::ESecurityCodePhonePassword;
-		                CWait* wait = CWait::NewL();
-		                iPhone.VerifySecurityCode(wait->iStatus,secCodeType, password, required_fourth);
-		                status = wait->WaitForRequestL();
-		                delete wait;
-		
-		           }
-            
-            switch(status)
-                {        
-                case KErrNone:
+            case KErrNone:
+                {
+                if (FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw) && !(FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements)))
                     {
-                    if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw ) &&
-    										!(FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements)))
-    								{
-                        RSCPClient scpClient;
-                        User::LeaveIfError( scpClient.Connect() );
-                        CleanupClosePushL( scpClient );
-
-                        TSCPSecCode newCode;
-                        newCode.Copy( password );
-                        scpClient.StoreCode( newCode );
+                    RDEBUG("calling RSCPClient", 0);
+                    RSCPClient scpClient;
+                    User::LeaveIfError(scpClient.Connect());
+                    CleanupClosePushL(scpClient);
 
-                        CleanupStack::PopAndDestroy(); //scpClient  
-                  	}
-                            	
-                    iQueryCanceled = ETrue;
-                    return ETrue;
-                    }                    
-                case KErrGsmSSPasswordAttemptsViolation:
-                case KErrLocked:
-                    {
-                    iDestroyedPtr = &thisDestroyed;
-                    // security code blocked! 
-                    iNoteDlg = new (ELeave) CAknNoteDialog(REINTERPRET_CAST(CEikDialog**,&iNoteDlg));
-                    iNoteDlg->SetTimeout(CAknNoteDialog::ELongTimeout);
-                    iNoteDlg->SetTone(CAknNoteDialog::EErrorTone);
-                    err =KErrNone;
-                    TRAP(err,iNoteDlg->ExecuteLD(R_SEC_BLOCKED));
-                    
-                    // check if CSecurityHandler has been "killed"
-                    if ( thisDestroyed )
-                        {
-                        return EFalse;
-                        }
-                    
-                    iDestroyedPtr = NULL;
-                    iNoteDlg = NULL;
+                    TSCPSecCode newCode;
+                    RDEBUG("iSecUi_password", 1);
+                    RDEBUGSTR(iSecUi_password);
+                    newCode.Copy(iSecUi_password);
+                    RDEBUG(
+                            "!!!!!!! ***** deprecated **** !!!!! scpClient.StoreCode",
+                            0);
+                    scpClient.StoreCode(newCode);
+                    RDEBUG("called StoreCode", 1);
 
-                    if (err != KErrNone)
-                        {
-                        User::Leave(err);
-                        }
-                    break;
+                    CleanupStack::PopAndDestroy(); //scpClient
+                    queryAccepted = KErrNone;
                     }
-                case KErrGsm0707IncorrectPassword:
-                case KErrAccessDenied:
-                    {    
-                    iDestroyedPtr = &thisDestroyed;
-                    // code was entered erroneusly
-                    iNoteDlg = new (ELeave) CAknNoteDialog(REINTERPRET_CAST(CEikDialog**,&iNoteDlg));
-                    iNoteDlg->SetTimeout(CAknNoteDialog::ELongTimeout);
-                    iNoteDlg->SetTone(CAknNoteDialog::EErrorTone);
-                    err =KErrNone;
-                    TRAP(err,iNoteDlg->ExecuteLD(R_CODE_ERROR));    
-                    
-                    // check if CSecurityHandler has been "killed"
-                    if ( thisDestroyed )
-                        {
-                        return EFalse;
-                        }
-                    
-                    iDestroyedPtr = NULL;
-                    iNoteDlg = NULL;
-                    
-                    if (err != KErrNone)
-                        {
-                        User::Leave(err);
-                        }
-                    break;
-                    }    
-                default:
-                    {
-                    iDestroyedPtr = &thisDestroyed;
-                    err =KErrNone;
-                    TRAP(err,ShowGenericErrorNoteL(status));
-                                        
-                    // check if CSecurityHandler has been "killed"
-                    if ( thisDestroyed )
-                        {
-                        return EFalse;
-                        }
-                    
-                    iDestroyedPtr = NULL;
-                    iNoteDlg = NULL;
-                    
-                    if (err != KErrNone)
-                        {
-                        User::Leave(err);
-                        }    
-                    break;
-                    }
-                }     
-        
-            if (iQueryCanceled)
+
+                iQueryCanceled = ETrue;
+                return ETrue;
+                }
+            case KErrGsmSSPasswordAttemptsViolation:
+            case KErrLocked:
                 {
-                ret = EFalse;
+                // security code blocked! 
+                CSecuritySettings::ShowResultNoteL(R_SEC_BLOCKED, CAknNoteDialog::EErrorTone);
                 break;
-                }    
-            
-            password = _L("");
-            iDestroyedPtr = &thisDestroyed;
-             if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw ) &&
-    						FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements))  
-    				{       
-                // Connect to the SCP server, and request the code query
-                RSCPClient scpClient;
-                User::LeaveIfError( scpClient.Connect() );
-                CleanupClosePushL( scpClient );
-                status = scpClient.SecCodeQuery( password, 
-                                      RSCPClient::SCP_OK_CANCEL,
-                                      EFalse,
-                                      0 ); 
-        
-                if ( status != KErrCancel )
-                    {
-                    // Set this "true" to indicate that the input wasn't cancelled
-                    ret = ETrue;
-                    }
-                else
-                    {
-                    ret = EFalse;
-                    }                                
-        
-                CleanupStack::PopAndDestroy(); //scpClient                              
-          }
-          else
-          {
-            iSecurityDlg = new (ELeave) CCodeQueryDialog (password,SEC_C_SECURITY_CODE_MIN_LENGTH,SEC_C_SECURITY_CODE_MAX_LENGTH,ESecUiNone);
-            CSecUiLockObserver* deviceLockStatusObserver = CSecUiLockObserver::NewL(iSecurityDlg);
-						CleanupStack::PushL(deviceLockStatusObserver);
-						err =KErrNone;
-            TRAP(err,ret = iSecurityDlg->ExecuteLD(R_SECURITY_QUERY));         
-						CleanupStack::PopAndDestroy(deviceLockStatusObserver);
-          }
-            
-            // check if CSecurityHandler has been "killed"
-            if ( thisDestroyed )
+                }
+            case KErrGsm0707IncorrectPassword:
+            case KErrAccessDenied:
                 {
-                return EFalse;
+                // code was entered erroneusly
+                CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone);
+                break;
                 }
-    
-            iDestroyedPtr = NULL;
-            iSecurityDlg = NULL;
-            
-            if (err != KErrNone)
+            default:
                 {
-                User::Leave(err);
+                CSecuritySettings::ShowResultNoteL(status, CAknNoteDialog::EErrorTone);
                 }
-
-            if (!ret)
-                break;
+            }
         } // while
-    }    // if
 
     iQueryCanceled = ETrue;
     return ret;
     }
 //
 // ----------------------------------------------------------
-// CSecurityHandler::CancelSecCodeQuery()    
-// Cancels PIN2 and security code queries
+// Cancels all security code queries
+// aStatus = -1     from destructor
+// aStatus =  1     from API. Will kill all dialogs through signal P&S
 // ----------------------------------------------------------
-//
-EXPORT_C void CSecurityHandler::CancelSecCodeQuery()                
+// qtdone
+TInt CSecurityHandler::CancelOpenQuery(TInt aStatus)
     {
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecurityHandler::CancelSecCodeQuery()"));
-    #endif
+    RDEBUG("aStatus", aStatus);
+    RDEBUG("iQueryCanceled", iQueryCanceled);
+    TInt res = 0;
+
+    if (aStatus == 1) // also signal all other dialogs
+        {
+        RDEBUG(
+                "set KSecurityUIsDismissDialog to ESecurityUIsDismissDialogOn",
+                ESecurityUIsDismissDialogOn);
+        TInt err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsDismissDialog, ESecurityUIsDismissDialogOn);
+        RDEBUG("err", err);
+        res += 1;
+        }
+
     if (!iQueryCanceled)
         {
+        // notify all dialogs, in particular SecUiNotificationDialog::subscriberKSecurityUIsDismissDialogChanged
+        // this will cancel only the dialog which was opened by same client.
+        res += 0x10;
         iQueryCanceled = ETrue;
         if (iSecurityDlg != NULL)
             {
+            RDEBUG("deleting iSecurityDlg", 0);
+            res += 0x100;
             delete iSecurityDlg;
             }
         if (iNoteDlg != NULL)
             {
+            RDEBUG("deleting iNoteDlg", 0);
+            res += 0x1000;
             delete iNoteDlg;
             }
         iNoteDlg = NULL;
         iSecurityDlg = NULL;
         }
+    res += 0x10000;
+    RDEBUG("res", res);
+    return res;
+    }
+
+//
+// ----------------------------------------------------------
+// CSecurityHandler::CancelSecCodeQuery()    
+// Cancels PIN2 and security code queries
+// this is used by rfsHandler
+// ----------------------------------------------------------
+// qtdone
+EXPORT_C void CSecurityHandler::CancelSecCodeQuery()
+    {
+    RDEBUG("0", 0);
+
+    TInt err = CancelOpenQuery(1);
+
+    RDEBUG("err", err);
     }
 //
 // ----------------------------------------------------------
 // CSecurityHandler::AskSecCodeInAutoLock()
 // for asking security code in autolock
 // ----------------------------------------------------------
-//
+// qtdone
 EXPORT_C TBool CSecurityHandler::AskSecCodeInAutoLockL()
     {
     /*****************************************************
-    *    Series 60 Customer / ETel
-    *    Series 60  ETel API
-    *****************************************************/
-    
-    #ifdef __WINS__
-    return ETrue;
-    #else
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecurityHandler::AskSecCodeInAutoLockL()"));
-    #endif
+     *    Series 60 Customer / ETel
+     *    Series 60  ETel API
+     *****************************************************/
+
+    RDEBUG("0", 0);
     TInt res;
     CWait* wait;
-        
+
     RMobilePhone::TMobilePhoneLockSetting lockChange(RMobilePhone::ELockSetDisabled);
     RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockPhoneDevice;
-   
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecurityHandler::AskSecCodeInAutoLockL() get autolock period"));
-    #endif
 
     // get autolock period from Central Repository.
     CRepository* repository = CRepository::NewL(KCRUidSecuritySettings);
@@ -535,650 +440,591 @@
     res = repository->Get(KSettingsAutoLockTime, period);
     delete repository;
 
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecurityHandler::AskSecCodeInAutoLockL() autolock period:%d"), res);
-    #endif
+    RDEBUG("res", res);
+    RDEBUG("period", period);
+
     if (res == KErrNone)
         {
         // disable autolock in Domestic OS side too if autolock period is 0.
-        if (period == 0 )
+        if (period == 0)
             {
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecurityHandler::AskSecCodeInAutoLockL() Call SetLockSetting"));
-            #endif
-
-#ifdef RD_REMOTELOCK
+            RDEBUG("period", period);
 
             // If remote lock is enabled, don't disable the domestic OS device lock
             // since that would render the RemoteLock useless.
             // Instead just re-set the DOS lock to enabled which as a side effect
             // requests the security code from the user.
 
-            TBool remoteLockStatus( EFalse );
+            TBool remoteLockStatus(EFalse);
             CRemoteLockSettings* remoteLockSettings = CRemoteLockSettings::NewL();
 
-            if ( remoteLockSettings->GetEnabled( remoteLockStatus ) )
+            if (remoteLockSettings->GetEnabled(remoteLockStatus))
                 {
-                if ( remoteLockStatus )
+                RDEBUG("0", 0);
+                if (remoteLockStatus)
                     {
                     // Remote lock is enabled
-                    #ifdef _DEBUG
-                    RDebug::Print( _L( "(SecUi)CSecurityHandler::AskSecCodeInAutoLockL() - RemoteLock is enabled: lockChange = RMobilePhone::ELockSetEnabled" ) );
-                    #endif // _DEBUG
-
                     lockChange = RMobilePhone::ELockSetEnabled;
+                    RDEBUG("lockChange", lockChange);
                     }
                 else
                     {
                     // Remote lock is disabled
-                    #ifdef _DEBUG
-                    RDebug::Print( _L( "(SecUi)CSecurityHandler::AskSecCodeInAutoLockL() - RemoteLock is disabled: lockChange = RMobilePhone::ELockSetDisabled" ) );
-                    #endif // _DEBUG
-
                     lockChange = RMobilePhone::ELockSetDisabled;
+                    RDEBUG("lockChange", lockChange);
                     }
                 }
             else
                 {
                 // Failed to get remote lock status
-                #ifdef _DEBUG
-                RDebug::Print( _L( "(SecUi)CSecurityHandler::AskSecCodeInAutoLockL() - Failed to get RemoteLock status" ) );
-                #endif // _DEBUG
+                RDEBUG("Failed", lockChange);
                 }
 
             delete remoteLockSettings;
             remoteLockSettings = NULL;
 
-#else // not defined RD_REMOTELOCK
-
-                lockChange = RMobilePhone::ELockSetDisabled;
-
-#endif // RD_REMOTELOCK
-
-                wait = CWait::NewL();
-                iPhone.SetLockSetting(wait->iStatus,lockType,lockChange);
-                res = wait->WaitForRequestL();
-                delete wait;
-                #if defined(_DEBUG)
-                RDebug::Print(_L("(SECUI)CSecurityHandler::AskSecCodeInAutoLockL() SetLockSetting RESULT:%d"), res);
-                #endif
-            }
+            RDEBUG("lockChange", lockChange);
+            wait = CWait::NewL();
+            RDEBUG("0", 0);
+            // this also calls PassPhraseRequiredL ???
+            RDEBUG("SetLockSetting", 1);
+            iPhone.SetLockSetting(wait->iStatus, lockType, lockChange);
+            res = KErrNone;
+            RDEBUG("WaitForRequestL", 0);
+            res = wait->WaitForRequestL();
+            RDEBUG("res", res);
+            delete wait;
+            } // from   period == 0
         else
-            {	// ask security code
-                #if defined(_DEBUG)
-            	RDebug::Print(_L("(SECUI)CSecurityHandler::AskSecCodeInAutoLockL() Ask sec code via notifier"));
-            	#endif
-                RNotifier codeQueryNotifier;
-                User::LeaveIfError(codeQueryNotifier.Connect());
-                CWait* wait = CWait::NewL();
-                CleanupStack::PushL(wait);
-                TInt queryResponse = 0;
-                TPckg<TInt> response(queryResponse);
-                TSecurityNotificationPckg params;
-                params().iEvent = static_cast<TInt>(RMobilePhone::EPhonePasswordRequired);
-                params().iStartup = EFalse;
-                #if defined(_DEBUG)
-    			RDebug::Print(_L("(SECUI)CSecurityHandler::AskSecCodeInAutoLockL() Start Notifier"));
-    			#endif
-                codeQueryNotifier.StartNotifierAndGetResponse(wait->iStatus, KSecurityNotifierUid,params, response);
-                res = wait->WaitForRequestL();
-                CleanupStack::PopAndDestroy(); // wait
-              	#if defined(_DEBUG)
-            	RDebug::Print(_L("(SECUI)CSecurityHandler::AskSecCodeInAutoLockL() results:"));
-            	RDebug::Print(_L("(SECUI)CSecurityHandler::AskSecCodeInAutoLockL() res:%d"), res);
-            	RDebug::Print(_L("(SECUI)CSecurityHandler::AskSecCodeInAutoLockL() queryResponse:%d"), queryResponse);
-            	#endif
-            	if(res == KErrNone)
-                	res = queryResponse;
-            }
+            { // ask security code
+            RDEBUG("codeQueryNotifier 0", 0);
+            RNotifier codeQueryNotifier;
+            User::LeaveIfError(codeQueryNotifier.Connect());
+            CWait* wait = CWait::NewL();
+            CleanupStack::PushL(wait);
+            TInt queryResponse = 0;
+            TPckg<TInt> response(queryResponse);
+            RDEBUG("0", 0);
+            TSecurityNotificationPckg params;
+            params().iEvent = static_cast<TInt> (RMobilePhone::EPhonePasswordRequired);
+            params().iStartup = EFalse;
+
+            RDEBUG("StartNotifierAndGetResponse", 0);
+            codeQueryNotifier.StartNotifierAndGetResponse(wait->iStatus, KSecurityNotifierUid, params, response);
+            // this will eventually call PassPhraseRequiredL
+            RDEBUG("WaitForRequestL", 0);
+            res = wait->WaitForRequestL();
+            RDEBUG("WaitForRequestL", 1);
+            RDEBUG("res", res);
+            CleanupStack::PopAndDestroy(); // wait
+            if (res == KErrNone)
+                res = queryResponse;
+            } // from   else period == 0
+        RDEBUG("0", 0);
         }
     else
-        {
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecurityHandler::AskSecCodeInAutoLockL() KERRSOMETHING:Call SetLockSetting"));
-        #endif
-
-#ifdef RD_REMOTELOCK
+        { // can't read repository for KSettingsAutoLockTime
+        RDEBUG("KERRSOMETHING:Call SetLockSetting", 0);
 
         // If remote lock is enabled, don't disable the domestic OS device lock
         // since that would render the RemoteLock useless.
         // Instead just re-set the DOS lock to enabled which as a side effect
         // requests the security code from the user.
 
-        TBool remoteLockStatus( EFalse );
+        TBool remoteLockStatus(EFalse);
         CRemoteLockSettings* remoteLockSettings = CRemoteLockSettings::NewL();
 
-        if ( remoteLockSettings->GetEnabled( remoteLockStatus ) )
+        if (remoteLockSettings->GetEnabled(remoteLockStatus))
             {
-            if ( remoteLockStatus )
+            if (remoteLockStatus)
                 {
                 // Remote lock is enabled
-                #ifdef _DEBUG
-                RDebug::Print( _L( "(SecUi)CSecurityHandler::AskSecCodeInAutoLockL() - Failed to get AutoLock status and RemoteLock is enabled: lockChange = RMobilePhone::ELockSetEnabled" ) );
-                #endif // _DEBUG
-
                 lockChange = RMobilePhone::ELockSetEnabled;
+                RDEBUG("lockChange", lockChange);
                 }
             else
                 {
                 // Remote lock is disabled
-                #ifdef _DEBUG
-                RDebug::Print( _L( "(SecUi)CSecurityHandler::AskSecCodeInAutoLockL() - Failed to get AutoLock status and RemoteLock is disabled: lockChange = RMobilePhone::ELockSetDisabled" ) );
-                #endif // _DEBUG
-
                 lockChange = RMobilePhone::ELockSetDisabled;
+                RDEBUG("lockChange", lockChange);
                 }
             }
         else
             {
             // Failed to get remote lock status
-            #ifdef _DEBUG
-            RDebug::Print( _L( "(SecUi)CSecurityHandler::AskSecCodeInAutoLockL() - Failed to get AutoLock status and failed to get RemoteLock status" ) );
-            #endif // _DEBUG
+            RDEBUG("Failed", lockChange);
             }
 
         delete remoteLockSettings;
         remoteLockSettings = NULL;
 
-#else // not defined RD_REMOTELOCK
-
-        // could not get the current autolock time... disable autolock in Domestic OS side.
-        lockChange = RMobilePhone::ELockSetDisabled;
-
-#endif // RD_REMOTELOCK
-
+        RDEBUG("0", 0);
         wait = CWait::NewL();
-        iPhone.SetLockSetting(wait->iStatus,lockType,lockChange);
+        RDEBUG("SetLockSetting", 0);
+        iPhone.SetLockSetting(wait->iStatus, lockType, lockChange);
+        RDEBUG("WaitForRequestL", 0);
         res = wait->WaitForRequestL();
+        RDEBUG("WaitForRequestL res", res);
         delete wait;
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecurityHandler::AskSecCodeInAutoLockL() KES: SetLockSetting RESULT:%d"), res);
-        #endif
         }
-        
+
+    RDEBUG("res", res);
     switch (res)
         {
         case KErrNone:
             {
-                return ETrue;
+            return ETrue;
             }
-
         case KErrGsmSSPasswordAttemptsViolation:
         case KErrLocked:
         case KErrGsm0707IncorrectPassword:
         case KErrAccessDenied:
             {
-			return AskSecCodeInAutoLockL();
+            RDEBUG("KErrAccessDenied", KErrAccessDenied);
+            return AskSecCodeInAutoLockL();
+            }
+        case KErrInUse:
+            {
+            RDEBUG("KErrInUse", KErrInUse);
+            return EFalse;
+            }
+        case KErrDied:
+            {
+            RDEBUG("KErrDied ", KErrDied);
+            return EFalse;
+            }
+        case KErrServerTerminated:
+            {
+            RDEBUG("KErrServerTerminated ", KErrServerTerminated);
+            return EFalse;
+            }
+        case KErrServerBusy:
+            {
+            RDEBUG("KErrServerBusy ", KErrServerBusy);
+            return EFalse;
             }
         case KErrAbort:
+            {
+            RDEBUG("KErrAbort", KErrAbort);
+            return EFalse;
+            }
         case KErrCancel:
+            {
+            RDEBUG("KErrCancel", KErrCancel);
             // user pressed "cancel"
             return EFalse;
+            }
         default:
             {
+            RDEBUG("default", res);
             return AskSecCodeInAutoLockL();
             }
         }
-#endif // WINS
     }
 //
 // ----------------------------------------------------------
 // CSecurityHandler::PassPhraseRequired()    
 // Handles PassPhraseRequired event
 // ----------------------------------------------------------
-//
+// qtdone
 TInt CSecurityHandler::PassPhraseRequiredL()
     {
     /*****************************************************
-    *    Series 60 Customer / ETel
-    *    Series 60  ETel API
-    *****************************************************/
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL()"));
-    #endif
+     *    Series 60 Customer / ETel
+     *    Series 60  ETel API
+     *****************************************************/
+    RDEBUG("0", 0);
     TBool StartUp = iStartup;
 
-    RMobilePhone::TMobilePassword password;
+    RMobilePhone::TMobilePassword iSecUi_password;
     RMobilePhone::TMobilePassword required_fourth;
-    TInt status;
-    TInt autolockState;
-    TInt err( KErrGeneral );
+    TInt queryAccepted = KErrCancel;
+
+    TInt autolockState = 0;
+    TInt lCancelSupported = 0;
+    TInt lEmergencySupported = 0;
+
+    TInt err(KErrGeneral);
     err = RProperty::Get(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, autolockState);
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL() Autolock Status result: %d"), err);
-    #endif
-    if(!StartUp)
-        User::LeaveIfError( err );
-TBool isConditionSatisfied = EFalse;
-TInt tarmFlag=0;
-if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw ))
-  	{		
-	TInt tRet = RProperty::Get( KSCPSIDAutolock, SCP_TARM_ADMIN_FLAG_UID, tarmFlag );    
-    
-    if ( tRet != KErrNone )
+    RDEBUG("StartUp", StartUp);
+    RDEBUG("err", err);
+    if (!StartUp)
+        {
+        RDebug::Printf("%s %s (%u) might leave if StartUp=0 and err=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, err);
+        User::LeaveIfError(err);
+        }
+    TBool isConditionSatisfied = EFalse;
+    TInt tarmFlag = 0;
+    if (FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw))
         {
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL():\
-            Warning: failed to get TARM Admin Flag state"));
-        #endif
+        TInt tRet = RProperty::Get(KSCPSIDAutolock, SCP_TARM_ADMIN_FLAG_UID, tarmFlag);
+
+        if (tRet != KErrNone)
+            {
+            RDEBUG("Warning: failed to get TARM Admin Flag state", tRet);
+            }
+        else
+            {
+            RDEBUG("TARM flag", tarmFlag);
+            }
+
+        if ((StartUp) || (tarmFlag & KSCPFlagResyncQuery))
+            isConditionSatisfied = ETrue;
         }
     else
         {
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL(): TARM flag: %d"), tarmFlag );
-        #endif
-        }       
- 
-    if ( ( StartUp ) || ( tarmFlag & KSCPFlagResyncQuery ) )
-	    			isConditionSatisfied = ETrue;  
-		}
-		else
-		{
-		    if (StartUp)
-		    isConditionSatisfied = ETrue;  
-		}
+        if (StartUp)
+            isConditionSatisfied = ETrue;
+        }
 
-	// call TARM so that it verifies that configuration is in sync. This might internally accept the (default) lock code, but doesn't dismiss the query.
-	#if defined(_DEBUG)
-	RDebug::Printf( "%s %s (%u) pre isConditionSatisfied=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, isConditionSatisfied );
-  #endif
-	RSCPClient scpClientConfiguration;
-	User::LeaveIfError( scpClientConfiguration.Connect() );
-  CleanupClosePushL( scpClientConfiguration );
-	#if defined(_DEBUG)
-	RDebug::Printf( "%s %s (%u) calling CheckConfiguration KSCPComplete=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, KSCPComplete );
-  #endif
-	TInt finalConfStatus = scpClientConfiguration.CheckConfiguration( KSCPComplete );
-	#if defined(_DEBUG)
-	RDebug::Printf( "%s %s (%u) finalConfStatus=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, finalConfStatus );
-	RDebug::Printf( "%s %s (%u) isConditionSatisfied=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, isConditionSatisfied );
-  #endif
-	CleanupStack::PopAndDestroy();	// scpClientConfiguration
-
-		if (isConditionSatisfied)
+    // Security code at bootup: No "cancel" softkey; Emergency calls enabled.
+    RMobilePhone::TMobilePhoneSecurityCode secCodeTypeToAsk = RMobilePhone::ESecurityCodePhonePassword;
+    RDEBUG("isConditionSatisfied", isConditionSatisfied);
+    if (isConditionSatisfied)
         {
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL() Dialog 1"));
-        #endif
-        // Security code at bootup: No "cancel" softkey; Emergency calls enabled.
-      if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw ) &&
-    			FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements))
-    		{                   	    		    		    		
-            // Connect to the SCP server, and request the code query
-            RSCPClient scpClient;
-            User::LeaveIfError( scpClient.Connect() );
-            CleanupClosePushL( scpClient );
-                
-            status = scpClient.SecCodeQuery( password, 
-                                             RSCPClient::SCP_OK_ETEL,
-                                             ETrue,
-                                             KSCPEtelRequest );              
-            // Note that SecCodeQuery doesn't indicate the return value from the dialog            
-        
-            CleanupStack::PopAndDestroy();  //scpClient                                         
-      }  
-      else
-      {     
-        CCodeQueryDialog* securityDlg = new (ELeave) CCodeQueryDialog (password,SEC_C_SECURITY_CODE_MIN_LENGTH,SEC_C_SECURITY_CODE_MAX_LENGTH,ESecUiCodeEtelReqest);
-        if(AknLayoutUtils::PenEnabled())
-            securityDlg->SetEmergencyCallSupportForCBA( ETrue );
-        else
-            securityDlg->SetEmergencyCallSupport(ETrue);
-        #ifdef __COVER_DISPLAY
-        securityDlg->PublishDialogL(SecondaryDisplay::ECmdShowSecurityQuery, SecondaryDisplay::KCatStartup);
-        CAknMediatorFacade* covercl = AknMediatorFacade(securityDlg); // uses MOP, so control provided 
-		if (covercl) // returns null if __COVER_DISPLAY is not defined
-    		{
-    		// … -  add data that cover ui is interested in
-    		covercl->BufStream().WriteInt32L(SecondaryDisplay::EShowSecCode); // adds int to additional data to be posted to cover ui
-    		covercl->BufStream().CommitL(); // no more data to send so commit buf
-     		}  
-        #endif //__COVER_DISPLAY
-        status = securityDlg->ExecuteLD(R_SECURITY_REQUEST_QUERY);
-			}
+        // starter or special TARM. NoCancel+Emergency
+        lCancelSupported = ESecUiCancelNotSupported;
+        lEmergencySupported = ESecUiEmergencySupported;
         }
-    else if ( (autolockState > EAutolockOff))    
+    else if (autolockState > EAutolockOff)
+        {
+        // from unlock. Cancel+Emergency
+        lCancelSupported = ESecUiCancelSupported;
+        lEmergencySupported = ESecUiEmergencySupported;
+        }
+    else
         {
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL() Dialog 2"));
-        #endif
-            // Autolock is On. Security event came from user pressing "unlock".
-            // Emergency call support must be enabled and there must be a "cancel" softkey.
-         if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw ) &&
-    				FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements))     
-		    		{                                    
-     	    // Connect to the SCP server, and request the code query
-            RSCPClient scpClient;
-            User::LeaveIfError( scpClient.Connect() );
-            CleanupClosePushL( scpClient );
-              
-            status = scpClient.SecCodeQuery( password, 
-                                             RSCPClient::SCP_OK_CANCEL,
-                                             ETrue,
-                                             KSCPEtelRequest );
-            // Note that SecCodeQuery doesn't indicate the return value from the dialog   
-        
-            CleanupStack::PopAndDestroy(); //scpClient
-		    		}
-			    else
-			    {
-        CCodeQueryDialog* securityDlg = new (ELeave) CCodeQueryDialog (password,SEC_C_SECURITY_CODE_MIN_LENGTH,SEC_C_SECURITY_CODE_MAX_LENGTH,ESecUiNone);
-        if(AknLayoutUtils::PenEnabled())
-            securityDlg->SetEmergencyCallSupportForCBA( ETrue );
-        else
-            securityDlg->SetEmergencyCallSupport(ETrue);
-        #ifdef __COVER_DISPLAY
-        securityDlg->PublishDialogL(SecondaryDisplay::ECmdShowSecurityQuery, SecondaryDisplay::KCatStartup);
-        CAknMediatorFacade* covercl = AknMediatorFacade(securityDlg); // uses MOP, so control provided 
-		if (covercl) // returns null if __COVER_DISPLAY is not defined
-    	{
-    	// … -  add data that cover ui is interested in
-    	covercl->BufStream().WriteInt32L(SecondaryDisplay::EShowSecCode); // adds int to additional data to be posted to cover ui
-    	covercl->BufStream().CommitL(); // no more data to send so commit buf
-     	}  
-        #endif //__COVER_DISPLAY
-        status = securityDlg->ExecuteLD(R_SECURITY_QUERY);
-			     }
+        // from settings. Cancel+NoEmergency
+        lCancelSupported = ESecUiCancelSupported;
+        lEmergencySupported = ESecUiEmergencyNotSupported;
         }
-    else    
+
+    CSecQueryUi *iSecQueryUi;
+    iSecQueryUi = CSecQueryUi::NewL();
+    iQueryCanceled = EFalse;
+    TInt lType = ESecUiSecretSupported | ESecUiAlphaSupported | lCancelSupported | lEmergencySupported | secCodeTypeToAsk;
+    RDEBUG("lType", lType);
+    TBuf<0x100> title;
+    title.Zero();
+    HBufC* stringHolder = HbTextResolverSymbian::LoadLC(_L("txt_pin_code_dialog_sec_code"));
+    title.Append(stringHolder->Des());
+    CleanupStack::PopAndDestroy(stringHolder);
+    queryAccepted = iSecQueryUi->SecQueryDialog(title, iSecUi_password, SEC_C_SECURITY_CODE_MIN_LENGTH, SEC_C_SECURITY_CODE_MAX_LENGTH, lType);
+    RDEBUG("iSecUi_password", 0);
+    RDEBUGSTR(iSecUi_password);
+    RDEBUG("queryAccepted", queryAccepted);
+    iQueryCanceled = ETrue;
+    delete iSecQueryUi;
+
+    TBool wasCancelledOrEmergency = EFalse;
+    RDEBUG("KFeatureIdSapDeviceLockEnhancements",
+            KFeatureIdSapDeviceLockEnhancements);
+    if ((queryAccepted == KErrAbort /* =emergency */) || (queryAccepted == KErrCancel))
+        wasCancelledOrEmergency = ETrue;
+    RDEBUG("wasCancelledOrEmergency", wasCancelledOrEmergency);
+    if (wasCancelledOrEmergency)
         {
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL() Dialog 3"));
-        #endif
-            // Code query due to a setting change; "Cancel" softkey active;
-            // no emergency call support.
-	        if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw ) &&
-	    			FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements))
-	    		{
-     	    // Connect to the SCP server, and request the code query
-            RSCPClient scpClient;
-            User::LeaveIfError( scpClient.Connect() );
-            CleanupClosePushL( scpClient );
-              
-            status = scpClient.SecCodeQuery( password, 
-                                             RSCPClient::SCP_OK_CANCEL,
-                                             EFalse,
-                                             KSCPEtelRequest );            
-            // Note that SecCodeQuery doesn't indicate the return value from the dialog   
-        
-            CleanupStack::PopAndDestroy(); //scpClient
-			    }
-			    else
-			    {
-        iSecurityDlg = new (ELeave) CCodeQueryDialog (password,SEC_C_SECURITY_CODE_MIN_LENGTH,SEC_C_SECURITY_CODE_MAX_LENGTH,ESecUiNone);
-        #ifdef __COVER_DISPLAY
-        iSecurityDlg->PublishDialogL(SecondaryDisplay::ECmdShowSecurityQuery, SecondaryDisplay::KCatStartup);
-        CAknMediatorFacade* covercl = AknMediatorFacade(iSecurityDlg); // uses MOP, so control provided 
-		if (covercl) // returns null if __COVER_DISPLAY is not defined
-    	{
-    	covercl->BufStream().WriteInt32L(SecondaryDisplay::EShowSecCode); // adds int to additional data to be posted to cover ui
-    	covercl->BufStream().CommitL(); // no more data to send so commit buf
-     	}  
-        #endif //__COVER_DISPLAY
-        // read a flag to see whether the query is SecUi originated.
-        TInt secUiOriginatedQuery(ESecurityUIsETelAPIOriginated);
-        RProperty::Get(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, secUiOriginatedQuery);
-        CSecUiLockObserver* deviceLockStatusObserver = CSecUiLockObserver::NewL(iSecurityDlg);
-        CleanupStack::PushL(deviceLockStatusObserver);
-        CSecUiLockObserver* queryStatusObserver = CSecUiLockObserver::NewL(iSecurityDlg, ESecUiRequestStateObserver);
-        CleanupStack::PushL(queryStatusObserver);
-        CSecUiLockObserver* callStatusObserver = NULL;
-        if(secUiOriginatedQuery == ESecurityUIsSystemLockOriginated)
-            {
-                callStatusObserver = CSecUiLockObserver::NewL(iSecurityDlg, ESecUiCallStateObserver);
-                CleanupStack::PushL(callStatusObserver);
-            }
-        status = iSecurityDlg->ExecuteLD(R_SECURITY_QUERY);
-        
-        if(callStatusObserver == NULL)
-            CleanupStack::PopAndDestroy(2); //deviceLockStatusObserver, queryStatusObserver
-        else
-            CleanupStack::PopAndDestroy(3); //deviceLockStatusObserver, queryStatusObserver, callStatusObserver
-        iSecurityDlg = NULL;
-			      }
-        }
-TBool isCondition = EFalse;		
-if(!FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements))
-{
-    if (!status || (status == ESecUiEmergencyCall)  
-        || (status == EAknSoftkeyEmergencyCall) || (status == ESecUiDeviceLocked))
-    isCondition = ETrue;
-}
-else
-{
-    if  ( ( status == KErrCancel ) || (status == ESecUiEmergencyCall)  ||
-         (status == EAknSoftkeyEmergencyCall) || (status == ESecUiDeviceLocked))
-    isCondition = ETrue;
-}
-		if (isCondition)
-        {
-		#if defined(_DEBUG)
-		RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL() DIALOG ERROR"));
-		#endif
+        RDEBUG("StartUp", StartUp);
         if (!StartUp)
             {
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL() ABORT CALLED!!!!!!"));
-            #endif
+            RDEBUG("AbortSecurityCode", 0);
             iPhone.AbortSecurityCode(RMobilePhone::ESecurityCodePhonePassword);
+            RDEBUG("AbortSecurityCode", 1);
             }
         return KErrCancel;
         }
 
     RMobilePhone::TMobilePhoneSecurityCode secCodeType = RMobilePhone::ESecurityCodePhonePassword;
-     CWait* wait = NULL;
-if(!FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements))
-{ 
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL() VerifySecurityCode"));
-        #endif
+    CWait* wait = NULL;
+    TInt status = KErrNone;
+
+		// Validate the code using SCP. This is needed to check expiration
+    RDEBUG("AbortSecurityCode", 0);
+    RSCPClient scpClient;
+    RDEBUG("scpClient.Connect", 0);
+    TInt tRet = scpClient.Connect();
+    RDEBUG("tRet", tRet);
+
+    CleanupClosePushL(scpClient);
+
+    RArray<TDevicelockPolicies> aFailedPolicies;
+    TDevicelockPolicies failedPolicy;
+    TInt retLockcode = KErrNone;
+    RMobilePhone::TMobilePassword aISACode;
+    TInt aFlags = 0;
+    RDEBUG("scpClient.VerifyCurrentLockcode", 0);
+    // this validate on ISA . No need to do iPhone.VerifySecurityCode
+    retLockcode = scpClient.VerifyCurrentLockcode(iSecUi_password, aISACode, aFailedPolicies, aFlags);
+    RDEBUG("retLockcode", retLockcode);
+
+    RDEBUG("aISACode", 0);
+    RDEBUGSTR(aISACode);
+
+    RDEBUG("aFailedPolicies.Count()", aFailedPolicies.Count());
+    RDEBUG("EDeviceLockPasscodeExpiration", EDeviceLockPasscodeExpiration); // 8
+    TInt failedEDeviceLockPasscodeExpiration = 0;
+    for (TInt i = 0; i < aFailedPolicies.Count(); i++)
+        {
+        failedPolicy = aFailedPolicies[i];
+        RDEBUG("failedPolicy", failedPolicy);
+        if (failedPolicy == EDeviceLockPasscodeExpiration)
+            failedEDeviceLockPasscodeExpiration = EDeviceLockPasscodeExpiration;
+        }
+    RDEBUG("Close", 0);
+    scpClient.Close();
+    RDEBUG("PopAndDestroy", 0);
+    CleanupStack::PopAndDestroy(); //scpClient
+
+		RDEBUG("failedEDeviceLockPasscodeExpiration", failedEDeviceLockPasscodeExpiration);
+    if (failedEDeviceLockPasscodeExpiration > 0)
+        {
+    		// the password has expired. Note that it has NOT been validated. It will be revalidated inside ChangeSecCodeParamsL
+        RMobilePhone::TMobilePassword iNewPassword;
+        TInt iFlags = 0;
+        iNewPassword.Copy(_L(""));
+        TBuf<0x80> iCaption;
+        iCaption.Copy(_L("ChangeSecCodeL")); // no need to translate because it's not used
+        TInt iShowError = 1;
+        CSecuritySettings* iSecSettings;
+        iSecSettings = CSecuritySettings::NewL();
+        TSecUi::InitializeLibL();
+        RDEBUG("calling ChangeSecCodeParamsL", 0);
+        status = iSecSettings->ChangeSecCodeParamsL(iSecUi_password, iNewPassword, iFlags, iCaption, iShowError);
+        // note that it might have been aborted. The error KErrAbort is shown in this method, not inside ChangeSecCodeParamsL
+        if(status==KErrAccessDenied || status==KErrGsm0707IncorrectPassword)
+        	{
+        	// the password expired, but the user typed wrongly. The error was already displayed.
+        	RDEBUG("SCP returned ", KErrAccessDenied);
+        	status=R_CODES_DONT_MATCH;
+        	RDEBUG("SCP changed to R_CODES_DONT_MATCH", R_CODES_DONT_MATCH);
+        	}
+        RDEBUG("status", status);
+        RDEBUG("iNewPassword", 0);
+        RDEBUGSTR(iNewPassword);
+        TSecUi::UnInitializeLib();
+        RDEBUG("deleting iSecSettings", 0);
+        delete iSecSettings;
+        RDEBUG("deleted iSecSettings", 1);
+        }
+    else
+        {
+        RDEBUG( "wait", 0 );
         wait = CWait::NewL();
-        iPhone.VerifySecurityCode(wait->iStatus,secCodeType, password, required_fourth);
+        RDEBUG("VerifySecurityCode", 0);
+        iPhone.VerifySecurityCode(wait->iStatus, secCodeType, iSecUi_password, required_fourth);
+        RDEBUG("WaitForRequestL",
+                0);
         status = wait->WaitForRequestL();
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL() VerifySecurityCode STATUS: %d"), status);
-        #endif
+        RDEBUG("WaitForRequestL status",
+                status);
         delete wait;
-  }
-  else
-  {
-		wait = NULL;
-  }
-    
+#ifdef __WINS__
+        if (status == KErrNotSupported || status == KErrTimedOut)
+            {
+            RDEBUG( "status", status );
+            status = KErrNone;
+            }
+#endif
+        }
+
     TInt returnValue = status;
-    switch(status)
-        {        
+    RDEBUG("tarmFlag", tarmFlag);
+    RDEBUG("StartUp", StartUp);
+    RDEBUG("status", status);
+    switch (status)
+        {
         case KErrNone:
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL() KErrNone"));
-            #endif
-            // code approved 
-        if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw))    
-        {
+            // code approved
+            {
+            RDEBUG("KErrNone", KErrNone);
+            if( failedEDeviceLockPasscodeExpiration > 0)
+            	{
+            	RDEBUG("code has just been changed. No need to show Confirmation note. failedEDeviceLockPasscodeExpiration", failedEDeviceLockPasscodeExpiration);
+            	}
+            else
+            	{
+            	CSecuritySettings::ShowResultNoteL(R_CONFIRMATION_NOTE, CAknNoteDialog::EConfirmationTone);
+            	}
+            RDEBUG("R_CONFIRMATION_NOTE", R_CONFIRMATION_NOTE);
+            if (FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw))
+                {
+                RDEBUG("KFeatureIdSapTerminalControlFw",
+                        KFeatureIdSapTerminalControlFw);
                 // Unset the admin flag if set
-                if ( tarmFlag & KSCPFlagResyncQuery )
+                if (tarmFlag & KSCPFlagResyncQuery)
                     {
-                    TInt tRet = RProperty::Get( KSCPSIDAutolock, SCP_TARM_ADMIN_FLAG_UID, tarmFlag );
-                    
-                    if ( tRet == KErrNone )
-	                    {
-	                    tarmFlag &= ~KSCPFlagResyncQuery;
-	                    tRet = RProperty::Set( KSCPSIDAutolock, SCP_TARM_ADMIN_FLAG_UID, tarmFlag );
-	                    }
-	            
-	                if ( tRet != KErrNone )
+                    TInt tRet = RProperty::Get(KSCPSIDAutolock, SCP_TARM_ADMIN_FLAG_UID, tarmFlag);
+
+                    if (tRet == KErrNone)
+                        {
+                        tarmFlag &= ~KSCPFlagResyncQuery;
+                        tRet = RProperty::Set(KSCPSIDAutolock, SCP_TARM_ADMIN_FLAG_UID, tarmFlag);
+                        }
+
+                    if (tRet != KErrNone)
                         {
-                        #if defined(_DEBUG)
-                        RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL():\
-                            FAILED to unset TARM Admin Flag"));
-                        #endif
-                        }                    
-                    }                    	            
-				        if(!FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements)) 
-				        {           
-    			RSCPClient scpClient;
-                User::LeaveIfError( scpClient.Connect() );
-                CleanupClosePushL( scpClient );
-                TSCPSecCode newCode;
-                newCode.Copy( password );
-                scpClient.StoreCode( newCode );
-                CleanupStack::PopAndDestroy(); //scpClient
+                        RDEBUG(
+                                "FAILED to unset TARM Admin Flag tRet=",
+                                tRet);
+                        }
+                    }
+                if (!FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements))
+                    {
+                    RDEBUG("KFeatureIdSapDeviceLockEnhancements", KFeatureIdSapDeviceLockEnhancements);
+                    RSCPClient scpClient;
+                    RDEBUG("scpClient.Connect", 0);
+                    TInt tRet = scpClient.Connect();
+                    RDEBUG("tRet", tRet);
+                    User::LeaveIfError(tRet);
+                    RDEBUG("scpClient.Connect", 1);
+                    CleanupClosePushL(scpClient);
+                    TSCPSecCode newCode;
+                    newCode.Copy(iSecUi_password);
+                    RDEBUG(
+                            "!!!!!!! ***** TODO deprecated **** !!!!! scpClient.StoreCode",
+                            0);
+                    scpClient.StoreCode(newCode);
+                    RDEBUG("scpClient.StoreCode", 1);
+                    // TODO check whether code is expired.
+                    // This should be done by TARM, and they should ask to change the code
+                    CleanupStack::PopAndDestroy(); //scpClient
+                    }
+
                 }
-
-          }
-        		
+            RDEBUG("StartUp", StartUp);
             if (StartUp)
                 {
-                #if defined(_DEBUG)
-                RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL()KErrNone: Startup; get autolock period."));
-                #endif
-
                 // get autolock period from Central Repository.
                 CRepository* repository = CRepository::NewL(KCRUidSecuritySettings);
                 TInt period = 0;
                 TInt res = repository->Get(KSettingsAutoLockTime, period);
                 delete repository;
-  
-     						_LIT_SECURITY_POLICY_PASS(KReadPolicy); 
-								_LIT_SECURITY_POLICY_C1(KWritePolicy, ECapabilityWriteDeviceData);
-    						RProperty::Define(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, RProperty::EInt, KReadPolicy, KWritePolicy);
+                RDEBUG("res", res);
+                RDEBUG("period", period);
+                _LIT_SECURITY_POLICY_PASS( KReadPolicy);
+                _LIT_SECURITY_POLICY_C1(KWritePolicy,
+                        ECapabilityWriteDeviceData);
+                RProperty::Define(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, RProperty::EInt, KReadPolicy, KWritePolicy);
                 RProperty::Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, EAutolockOff);
-                #if defined(_DEBUG)
-								RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL() EAutolockOff")); 
-								#endif																
+                RDEBUG("KCoreAppUIsAutolockStatus",
+                        KCoreAppUIsAutolockStatus);
 
                 if (res == KErrNone)
                     {
                     // disable autolock in Domestic OS side too if autolock period is 0.
-                    if (period == 0 )
+                    if (period == 0)
                         {
-#ifdef RD_REMOTELOCK
-                        // If remote lock is enabled, don't disable the domestic OS device lock
+                        // Don't disable the domestic OS device lock
                         // since that would render the RemoteLock useless.
 
-                        TBool remoteLockStatus( EFalse );
+                        TBool remoteLockStatus(EFalse);
                         CRemoteLockSettings* remoteLockSettings = CRemoteLockSettings::NewL();
 
-                        if ( remoteLockSettings->GetEnabled( remoteLockStatus ) )
+                        if (remoteLockSettings->GetEnabled(remoteLockStatus))
                             {
-                            if ( !remoteLockStatus )
+                            if (!remoteLockStatus)
                                 {
                                 // Remote lock is disabled
-                                #ifdef _DEBUG
-                                RDebug::Print( _L( "(SecUi)CSecurityHandler::PassPhraseRequiredL() - Autolock and RemoteLock are disabled -> disable DOS device lock" ) );
-                                #endif // _DEBUG
-
+                                RDEBUG(
+                                        "Autolock and RemoteLock are disabled -> disable DOS device lock",
+                                        0);
                                 // Disable DOS device lock setting
+                                RDEBUG(
+                                        "iCustomPhone.DisablePhoneLock",
+                                        0);
                                 wait = CWait::NewL();
-                                iCustomPhone.DisablePhoneLock(wait->iStatus,password);
-                                wait->WaitForRequestL();
+                                iCustomPhone.DisablePhoneLock(wait->iStatus, iSecUi_password);
+                                RDEBUG("WaitForRequestL", 0);
+                                status = wait->WaitForRequestL();
+                                RDEBUG("WaitForRequestL", status);
                                 delete wait;
                                 }
                             }
                         else
                             {
                             // Failed to get remote lock status
-                            #ifdef _DEBUG
-                            RDebug::Print( _L( "(SecUi)CSecurityHandler::PassPhraseRequiredL() - Autolock is disabled, but failed to get RemoteLock status, so do nothing." ) );
-                            #endif // _DEBUG
+                            RDEBUG(
+                                    "Autolock is disabled, but failed to get RemoteLock status, so do nothing",
+                                    0);
                             }
 
                         delete remoteLockSettings;
                         remoteLockSettings = NULL;
 
-#else // not defined RD_REMOTELOCK
-
-                        #if defined(_DEBUG)
-                        RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL()KErrNone: Startup; DisablePhoneLock."));
-                        #endif
-                        wait = CWait::NewL();
-                        iCustomPhone.DisablePhoneLock(wait->iStatus,password);
-                        wait->WaitForRequestL();
-                        #if defined(_DEBUG)
-                        RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL()KErrNone: Startup; DisablePhoneLock completed."));
-                        #endif
-                        delete wait;
-#endif // RD_REMOTELOCK
                         }
                     }
-                else
+                else // error getting repository
                     {
-#ifdef RD_REMOTELOCK
-                    // If remote lock is enabled, don't disable the domestic OS device lock
+                    RDEBUG("error getting repository", 0);
+                    // Don't disable the domestic OS device lock
                     // since that would render the RemoteLock useless.
 
-                    TBool remoteLockStatus( EFalse );
+                    TBool remoteLockStatus(EFalse);
                     CRemoteLockSettings* remoteLockSettings = CRemoteLockSettings::NewL();
 
-                    if ( remoteLockSettings->GetEnabled( remoteLockStatus ) )
+                    if (remoteLockSettings->GetEnabled(remoteLockStatus))
                         {
-                        if ( !remoteLockStatus )
+                        if (!remoteLockStatus)
                             {
                             // Remote lock is disabled
-                            #ifdef _DEBUG
-                            RDebug::Print( _L( "(SecUi)CSecurityHandler::PassPhraseRequiredL() - Failed to get Autolock period and RemoteLock is disabled -> disable DOS device lock" ) );
-                            #endif // _DEBUG
-
+                            RDEBUG("iCustomPhone.DisablePhoneLock", 0);
                             wait = CWait::NewL();
-                            iCustomPhone.DisablePhoneLock(wait->iStatus,password);
-                            wait->WaitForRequestL();
+                            iCustomPhone.DisablePhoneLock(wait->iStatus, iSecUi_password);
+                            RDEBUG("WaitForRequestL", 0);
+                            status = wait->WaitForRequestL();
+                            RDEBUG("WaitForRequestL status", status);
                             delete wait;
                             }
                         }
                     else
                         {
                         // Failed to get remote lock status
-                        #ifdef _DEBUG
-                        RDebug::Print( _L( "(SecUi)CSecurityHandler::PassPhraseRequiredL() - Failed to get Autolock period and RemoteLock status, so do nothing." ) );
-                        #endif // _DEBUG
+                        RDEBUG(
+                                "Failed to get Autolock period and RemoteLock status, so do nothing",
+                                0);
                         }
 
                     delete remoteLockSettings;
                     remoteLockSettings = NULL;
 
-#else // not defined RD_REMOTELOCK
+                    }
 
-                    #if defined(_DEBUG)
-                    RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL()KErrNone: Startup; Could not get autolock period."));
-                    #endif
-                    // could not get the current autolock time... disable autolock in Domestic OS side. 
-                    wait = CWait::NewL();
-                    iCustomPhone.DisablePhoneLock(wait->iStatus,password);
-                    wait->WaitForRequestL();
-                    #if defined(_DEBUG)
-                    RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL()KErrNone: Startup; NO AUTOLOCK PERIOD; DisablePhoneLock completed."));
-                    #endif
-                    delete wait;
-
-#endif // RD_REMOTELOCK
-                    }
-                
-                }
-
-            break;    
+                } // no Startup
+            }
+            break;
         case KErrGsmSSPasswordAttemptsViolation:
         case KErrLocked:
+        		{
             // security code blocked!
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL() ErrGsmSSPasswordAttemptsViolation"));
-            #endif
+            RDEBUG("KErrLocked", KErrLocked)
+            ;
             CSecuritySettings::ShowResultNoteL(R_SEC_BLOCKED, CAknNoteDialog::EErrorTone);
+          	}
             break;
         case KErrGsm0707IncorrectPassword:
         case KErrAccessDenied:
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL() KErrGsm0707IncorrectPassword"));
-            #endif
+        		{
+            RDEBUG("KErrAccessDenied", KErrAccessDenied);
+            // The Settings caller might retry
             CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone);
+          	}
+            break;
+        case R_CODES_DONT_MATCH:	// if password was supposed to be changed, but it failed (the initial verification)
+        		{
+            RDEBUG("R_CODES_DONT_MATCH", R_CODES_DONT_MATCH);
+            // Error was already displayed
+            returnValue = KErrAccessDenied;
+          	}
             break;
         default:
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL() DEFAULT"));
-            #endif
+        		{
+            RDEBUG("default", status);
             CSecuritySettings::ShowErrorNoteL(status);
+            // The Settings caller might retry
+          	}
             break;
         }
-        
+    RDEBUG("returnValue", returnValue);
     return returnValue;
     }
 //
@@ -1186,208 +1032,166 @@
 // CSecurityHandler::Pin1Required()    
 // Handles Pin1Required event
 // ----------------------------------------------------------
-//
+// qtdone
 TInt CSecurityHandler::Pin1RequiredL()
     {
     /*****************************************************
-    *    Series 60 Customer / ETel
-    *    Series 60  ETel API
-    *****************************************************/
-    
-    RMobilePhone::TMobilePassword password;
+     *    Series 60 Customer / ETel
+     *    Series 60  ETel API
+     *****************************************************/
+    RDEBUG("0", 0);
+
+    RMobilePhone::TMobilePassword iSecUi_password;
+    TInt lCancelSupported = ESecUiCancelNotSupported;
+    TInt lEmergencySupported = ESecUiEmergencyNotSupported;
+    TInt queryAccepted = KErrCancel;
+    TInt lAlphaSupported = 0;
     RMobilePhone::TMobilePassword required_fourth;
     RMobilePhone::TMobilePhoneSecurityCode secCodeType = RMobilePhone::ESecurityCodePin1;
     RMobilePhone::TMobilePhoneSecurityCodeInfoV5 codeInfo;
     RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg codeInfoPkg(codeInfo);
-    TBool StartUp = ETrue;   
+    TBool StartUp = ETrue;
     TInt secUiOriginatedQuery(ESecurityUIsSecUIOriginatedUninitialized);
     TInt err = KErrNone;
     TInt res = KErrGeneral;
     CWait* wait = CWait::NewL();
     CleanupStack::PushL(wait);
-    
+    RDEBUG("0", 0);
 
     StartUp = iStartup;
 
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecurityHandler::Pin1RequiredL()"));
-    #endif
-
-    if(!StartUp)
-    {
-        // read a flag to see whether the query is SecUi originated.
+    RDEBUG("StartUp", StartUp);
+    if (!StartUp)
+        {
+        // read a flag to see whether the query is SecUi originated. For example, from CSecuritySettings::ChangePinRequestParamsL
         err = RProperty::Get(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, secUiOriginatedQuery);
-        
-    if ( err != KErrNone )
+        if (err != KErrNone)
+            {
+            RDEBUG("FAILED to get the SECUI query Flag err", err);
+            }
+        }
+    RDEBUG("err", err);
+    RDEBUG("secUiOriginatedQuery", secUiOriginatedQuery);
+    RDEBUG("ESecurityUIsSecUIOriginated", ESecurityUIsSecUIOriginated);
+    if (StartUp || (secUiOriginatedQuery != ESecurityUIsSecUIOriginated) || (err != KErrNone))
         {
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecurityHandler::Pin1RequiredL():\
-            FAILED to get the SECUI query Flag: %d"), err);
-        #endif
+        RDEBUG("0", 0);
+        lCancelSupported = ESecUiCancelNotSupported;
+        lEmergencySupported = ESecUiEmergencySupported;
         }
     else
-            {
-               #if defined(_DEBUG)
-                RDebug::Print(_L("(SECUI)CSecurityHandler::Pin1RequiredL():\
-                    SECUI query Flag: %d"), secUiOriginatedQuery);
-                #endif 
-            }
-    }  
-    #if defined(_DEBUG)
-    RDebug::Print(_L("CSecurityHandler::Pin1RequiredL() Execute dlg"));
-    #endif
+        {
+        lCancelSupported = ESecUiCancelSupported;
+        lEmergencySupported = ESecUiEmergencyNotSupported;
+        // it will be RMobilePhone::ESecurityCodePin1 , equivalent to ESecUiNone
+        }
+    wait->SetRequestType(EMobilePhoneGetSecurityCodeInfo);
+    RDEBUG("GetSecurityCodeInfo", 0);
+    iPhone.GetSecurityCodeInfo(wait->iStatus, secCodeType, codeInfoPkg);
+    res = wait->WaitForRequestL();
 
-    if(StartUp || (secUiOriginatedQuery != ESecurityUIsSecUIOriginated) || (err != KErrNone))
-    {	
-        iSecurityDlg = new (ELeave) CCodeQueryDialog (password,SEC_C_PIN_CODE_MIN_LENGTH,SEC_C_PIN_CODE_MAX_LENGTH,ESecUiCodeEtelReqest);
-        if(AknLayoutUtils::PenEnabled())
-            iSecurityDlg->SetEmergencyCallSupportForCBA( ETrue );
-        else
-            iSecurityDlg->SetEmergencyCallSupport(ETrue);
-        #ifdef __COVER_DISPLAY
-        iSecurityDlg->PublishDialogL(SecondaryDisplay::ECmdShowSecurityQuery, SecondaryDisplay::KCatStartup);
-        CAknMediatorFacade* covercl = AknMediatorFacade(iSecurityDlg); // uses MOP, so control provided 
-		if (covercl) // returns null if __COVER_DISPLAY is not defined
-    	{
-    	// … -  add data that cover ui is interested in
-    	covercl->BufStream().WriteInt32L(SecondaryDisplay::EShowPIN1); // adds int to additional data to be posted to cover ui
-    	covercl->BufStream().CommitL(); // no more data to send so commit buf
-     	}  
-        #endif //__COVER_DISPLAY
+    RDEBUG("res", res);
+#ifdef __WINS__
+    RDEBUG("emulator can't read PIN attempts", res);
+    res = KErrNone;
+    codeInfo.iRemainingEntryAttempts = 3;
+#endif
+    User::LeaveIfError(res);
+
+    RDEBUG("codeInfo.iRemainingEntryAttempts",
+            codeInfo.iRemainingEntryAttempts);
+    if (codeInfo.iRemainingEntryAttempts == KMaxNumberOfPINAttempts)
+        codeInfo.iRemainingEntryAttempts = -1;
 
-        wait->SetRequestType(EMobilePhoneGetSecurityCodeInfo);
-        iPhone.GetSecurityCodeInfo(wait->iStatus, secCodeType, codeInfoPkg);
-        res = wait->WaitForRequestL();
-        #if defined(_DEBUG)
-        TInt attempts(codeInfo.iRemainingEntryAttempts);
-        RDebug::Print(_L("CSecurityHandler::Pin1RequiredL() Remaining Attempts query status: %d"), res);
-        RDebug::Print(_L("CSecurityHandler::Pin1RequiredL() Remaining Attempts: %d"), attempts);
-        #endif
-        User::LeaveIfError(res);
-        
-        if( codeInfo.iRemainingEntryAttempts >= KMaxNumberOfPINAttempts )
-            res = iSecurityDlg->ExecuteLD(R_PIN_REQUEST_QUERY);
-        else if(codeInfo.iRemainingEntryAttempts > KLastRemainingInputAttempt)
-            {
-                HBufC* queryPrompt = StringLoader::LoadLC(R_SECUI_REMAINING_PIN_ATTEMPTS, codeInfo.iRemainingEntryAttempts);
-                res = iSecurityDlg->ExecuteLD(R_PIN_REQUEST_QUERY, *queryPrompt);
-                CleanupStack::PopAndDestroy(queryPrompt);
-            }
-        else
-            {
-                HBufC* queryPrompt = StringLoader::LoadLC(R_SECUI_FINAL_PIN_ATTEMPT);
-                res = iSecurityDlg->ExecuteLD(R_PIN_REQUEST_QUERY, *queryPrompt);
-                CleanupStack::PopAndDestroy(queryPrompt);   
-            }
-        
-        iSecurityDlg = NULL;
-        #if defined(_DEBUG)
-    	RDebug::Print(_L("CSecurityHandler::Pin1RequiredL() Execute dlg RESULT: %d"), res);
-    	#endif
-        if ((!res) || (res == ESecUiEmergencyCall) || (res == EAknSoftkeyEmergencyCall))
-            { 
-            #if defined(_DEBUG)
-            RDebug::Print(_L("CSecurityHandler::Pin1RequiredL() R_PIN_REQUEST_QUERY CANCEL!"));
-            #endif
-            CleanupStack::PopAndDestroy(wait);   
-            return KErrCancel;
-            }
-    }
-    else
-    {	
-        iSecurityDlg = new (ELeave) CCodeQueryDialog (password,SEC_C_PIN_CODE_MIN_LENGTH,SEC_C_PIN_CODE_MAX_LENGTH,ESecUiNone);
-        #ifdef __COVER_DISPLAY
-        iSecurityDlg->PublishDialogL(SecondaryDisplay::ECmdShowSecurityQuery, SecondaryDisplay::KCatStartup);
-        CAknMediatorFacade* covercl = AknMediatorFacade(iSecurityDlg); // uses MOP, so control provided
-		if (covercl) // returns null if __COVER_DISPLAY is not defined
-    		{
-    		// … -  add data that cover ui is interested in
-    		covercl->BufStream().WriteInt32L(SecondaryDisplay::EShowPIN1); // adds int to additional data to be posted to cover ui
-    		covercl->BufStream().CommitL(); // no more data to send so commit buf
-     		}  
-        #endif //__COVER_DISPLAY
-        
-        wait->SetRequestType(EMobilePhoneGetSecurityCodeInfo);
-        iPhone.GetSecurityCodeInfo(wait->iStatus, secCodeType, codeInfoPkg);
-        res = wait->WaitForRequestL();
-        User::LeaveIfError(res);
-        
-        CSecUiLockObserver* deviceLockStatusObserver = CSecUiLockObserver::NewL(iSecurityDlg);
-        CleanupStack::PushL(deviceLockStatusObserver);
-        CSecUiLockObserver* queryStatusObserver = CSecUiLockObserver::NewL(iSecurityDlg, ESecUiRequestStateObserver);
-        CleanupStack::PushL(queryStatusObserver);
-        
-        if( codeInfo.iRemainingEntryAttempts >= KMaxNumberOfPINAttempts )
-            res = iSecurityDlg->ExecuteLD(R_PIN_QUERY);
-        else if(codeInfo.iRemainingEntryAttempts > KLastRemainingInputAttempt)
-            {
-                HBufC* queryPrompt = StringLoader::LoadLC(R_SECUI_REMAINING_PIN_ATTEMPTS, codeInfo.iRemainingEntryAttempts );
-                res = iSecurityDlg->ExecuteLD(R_PIN_QUERY, *queryPrompt);
-                CleanupStack::PopAndDestroy(queryPrompt);
-            }
-        else
-            {
-                HBufC* queryPrompt = StringLoader::LoadLC(R_SECUI_FINAL_PIN_ATTEMPT);
-                res = iSecurityDlg->ExecuteLD(R_PIN_QUERY, *queryPrompt);
-                CleanupStack::PopAndDestroy(queryPrompt);   
-            }
-        
-        CleanupStack::PopAndDestroy(2); //deviceLockStatusObserver, queryStatusObserver
-        iSecurityDlg = NULL;
-        if( !res || (res == ESecUiDeviceLocked))
-            {
-            #if defined(_DEBUG)
-            RDebug::Print(_L("CSecurityHandler::Pin1RequiredL() R_PIN_QUERY cancel!"));
-            #endif 
-            // cancel code request
-            iPhone.AbortSecurityCode(RMobilePhone::ESecurityCodePin1);
-            CleanupStack::PopAndDestroy(wait);
-            return KErrCancel;
-            }      
-    }
-    #if defined(_DEBUG)
-    RDebug::Print(_L("CSecurityNotifier::Pin1RequiredL()VerifySecurityCode"));
-    #endif
-    iPhone.VerifySecurityCode(wait->iStatus,secCodeType, password, required_fourth);
+    /* request PIN using QT */
+    CSecQueryUi *iSecQueryUi;
+    RDEBUG("CSecQueryUi", 0);
+    iSecQueryUi = CSecQueryUi::NewL();
+    iQueryCanceled = EFalse;
+    RDEBUG("SecQueryDialog", 1);
+    // ESecUiCodeEtelReqest/ESecUiNone might be useful
+    lAlphaSupported = ESecUiAlphaNotSupported;
+    TBuf<0x100> title;
+    title.Zero();
+    HBufC* stringHolder = HbTextResolverSymbian::LoadLC(_L("txt_pin_code_dialog_pin_code"));
+    title.Append(stringHolder->Des());
+    CleanupStack::PopAndDestroy(stringHolder);
+    title.Append(_L("$"));
+    title.AppendNum(codeInfo.iRemainingEntryAttempts);
+    TInt amode = ESecUiSecretSupported | lAlphaSupported | lCancelSupported | lEmergencySupported | secCodeType;
+    RDEBUG("amode", amode);
+    queryAccepted = iSecQueryUi->SecQueryDialog(title, iSecUi_password, SEC_C_PIN_CODE_MIN_LENGTH, SEC_C_PIN_CODE_MAX_LENGTH, amode);
+    RDEBUG("iSecUi_password", 0);
+    RDEBUGSTR(iSecUi_password);
+    iQueryCanceled = ETrue;
+    delete iSecQueryUi;
+    RDEBUG("queryAccepted", queryAccepted);
+    /* end request PIN using QT */
+
+    if (queryAccepted == KErrAbort) // emergency call
+        {
+        RDEBUG("queryAccepted", queryAccepted);
+        CleanupStack::PopAndDestroy(wait); // this is needed
+        return KErrCancel;
+        }
+    if (lCancelSupported && (queryAccepted == KErrCancel))
+        {
+        // cancel code request
+        RDEBUG("AbortSecurityCode", 0);
+        iPhone.AbortSecurityCode(RMobilePhone::ESecurityCodePin1);
+        RDEBUG("AbortSecurityCode", 1);
+        CleanupStack::PopAndDestroy(wait); // this is needed
+        return KErrCancel;
+        }
+
+    RDEBUG("iSecUi_password", 0);
+    RDEBUGSTR(iSecUi_password);
+    RDEBUG("VerifySecurityCode", 0);
+    iPhone.VerifySecurityCode(wait->iStatus, secCodeType, iSecUi_password, required_fourth);
+    RDEBUG("WaitForRequestL", 0);
     res = wait->WaitForRequestL();
-    CleanupStack::PopAndDestroy(wait); 
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecurityHandler::Pin1RequiredL() VerifySecurityCode STATUS: %d"), res);
-    #endif
+    RDEBUG("WaitForRequestL res", res);
+    CleanupStack::PopAndDestroy(wait);
+
     TInt returnValue = res;
-    switch(res)
-        {        
+    switch (res)
+        {
         case KErrNone:
-            // code approved 
-            #if defined(_DEBUG)
-            RDebug::Print(_L("CSecurityHandler::Pin1RequiredL()code approved "));
-            #endif
-            CSecuritySettings::ShowResultNoteL(R_CONFIRMATION_NOTE, CAknNoteDialog::EConfirmationTone);
+            // code approved
+            RDEBUG("code approved", res)
+            ;
+            if (lCancelSupported == ESecUiCancelNotSupported)
+                { // OK note is not displayed in boot-up, to make things faster
+                CSecuritySettings::ShowResultNoteL(R_CONFIRMATION_NOTE, CAknNoteDialog::EConfirmationTone);
+                }
             break;
         case KErrGsm0707IncorrectPassword:
         case KErrAccessDenied:
             // code was entered erroneously
             CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone);
-            if(StartUp)
-            {
-            returnValue = Pin1RequiredL();
-            }
+            if (StartUp)
+                {
+                returnValue = Pin1RequiredL();
+                }
             break;
         case KErrGsmSSPasswordAttemptsViolation:
         case KErrLocked:
             // code blocked; show error note and terminate.
-            // code blocked
-            if(StartUp)
-                CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone); 
+            // what if not during Startup? Probably it's Ok since the SIM would had also failed at StartUp
+            if (StartUp)
+                CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone);
             break;
         case KErrGsm0707SimWrong:
             // sim lock active
+            // no error? This is strange
             break;
         default:
-            CSecuritySettings::ShowErrorNoteL(res);        
-            if(StartUp)
-            {        
-            returnValue = Pin1RequiredL();
+        		{
+            CSecuritySettings::ShowErrorNoteL(res);
+            if (StartUp)
+                {
+                returnValue = Pin1RequiredL();
+                }
             }
             break;
         }
@@ -1397,178 +1201,180 @@
 // ----------------------------------------------------------
 // CSecurityHandler::Puk1Required()
 // Handles Puk1Required event
+// First asks the PUK1, then verifies, then the newPIN + re-type , and then writes . This is odd, but the API needs the PUK and newPIN in same step.
+// Afterwards, the PIN1 might be asked (because the initial program still needs it)
 // ----------------------------------------------------------
-//
+// qtdone
 TInt CSecurityHandler::Puk1RequiredL()
     {
     /*****************************************************
-    *    Series 60 Customer / ETel
-    *    Series 60  ETel API
-    *****************************************************/
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecurityHandler::Puk1RequiredL()"));
-    #endif            
-    RMobilePhone::TMobilePassword aPassword;
-    RMobilePhone::TMobilePassword aNewPassword;
+     *    Series 60 Customer / ETel
+     *    Series 60  ETel API
+     *****************************************************/
+    RDEBUG("0", 0);
+    TInt queryAccepted = KErrCancel;
+    RMobilePhone::TMobilePassword puk1_password;
+    RMobilePhone::TMobilePassword aNewPinPassword;
     RMobilePhone::TMobilePhoneSecurityCodeInfoV5 codeInfo;
     RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg codeInfoPkg(codeInfo);
     RMobilePhone::TMobilePhoneSecurityCode blockCodeType;
     blockCodeType = RMobilePhone::ESecurityCodePuk1;
     CWait* wait = CWait::NewL();
     CleanupStack::PushL(wait);
-    
+
     TBool StartUp(ETrue);
     StartUp = iStartup;
 
-    TInt res(KErrNone);
+    TInt res(KErrCancel); // for the first try
     wait->SetRequestType(EMobilePhoneGetSecurityCodeInfo);
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecurityHandler::Puk1RequiredL(): Get Code info"));
-    #endif
-    iPhone.GetSecurityCodeInfo(wait->iStatus, blockCodeType, codeInfoPkg);
-    res = wait->WaitForRequestL();
-    
+
     TInt thisTry = 0;
 
-	// If there was a problem (as there might be in case we're dropping off SIM Access Profile); try again a couple of times.
-	while ( res != KErrNone && ( thisTry++ ) <= KTriesToConnectServer )
+    // If there was a problem (as there might be in case we're dropping off SIM Access Profile); try again a couple of times.
+    while (res != KErrNone && (thisTry++) <= KTriesToConnectServer)
         {
-        User::After( KTimeBeforeRetryingRequest );
+        if (thisTry > 0)
+            User::After(KTimeBeforeRetryingRequest);
+        RDEBUG("GetSecurityCodeInfo", 0);
         iPhone.GetSecurityCodeInfo(wait->iStatus, blockCodeType, codeInfoPkg);
+        RDEBUG("WaitForRequestL", 0);
         res = wait->WaitForRequestL();
+        RDEBUG("WaitForRequestL res", res);
         }
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecurityHandler::Puk1RequiredL(): Get Code info result: %d"), res);
-    #endif
-    //If there's still an error we're doomed. Bail out.
+    RDEBUG("res", res);
+    // If there's still an error we're doomed. Bail out.
     User::LeaveIfError(res);
-    
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecurityHandler::Puk1RequiredL(): Show last note"));
-    #endif
-    //show the last "Code Error" note of PIN verify result here so it won't be left under the PUK1 dialog
-    if(!StartUp && (codeInfo.iRemainingEntryAttempts == KMaxNumberOfPUKAttempts))
+
+    RDEBUG("StartUp", StartUp);
+    RDEBUG("codeInfo.iRemainingEntryAttempts",
+            codeInfo.iRemainingEntryAttempts);
+    TInt attempts(codeInfo.iRemainingEntryAttempts);
+    RDEBUG("attempts", attempts);
+    // show the last "Code Error" note of PIN verify result here so it won't be left under the PUK1 dialog
+    if (!StartUp && (attempts == KMaxNumberOfPUKAttempts))
         CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone);
-    
-    // ask PUK code
-    iSecurityDlg = new (ELeave) CCodeQueryDialog (aPassword,SEC_C_PUK_CODE_MIN_LENGTH,SEC_C_PUK_CODE_MAX_LENGTH,ESecUiPukRequired);
-    if(AknLayoutUtils::PenEnabled())
-        iSecurityDlg->SetEmergencyCallSupportForCBA( ETrue );
-    else
-        iSecurityDlg->SetEmergencyCallSupport(ETrue);
-    #ifdef __COVER_DISPLAY
-    iSecurityDlg->PublishDialogL(SecondaryDisplay::ECmdShowSecurityQuery, SecondaryDisplay::KCatStartup);
-    CAknMediatorFacade* covercl = AknMediatorFacade(iSecurityDlg); // uses MOP, so control provided
-	if (covercl) // returns null if __COVER_DISPLAY is not defined
-    	{
-    	// … -  add data that cover ui is interested in
-    	covercl->BufStream().WriteInt32L(SecondaryDisplay::EShowPUK1); // adds int to additional data to be posted to cover ui
-    	covercl->BufStream().CommitL(); // no more data to send so commit buf
-     	}  
-    #endif //__COVER_DISPLAY   
-    
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecurityHandler::Puk1RequiredL(): Show dialog"));
-    #endif    
-    if(codeInfo.iRemainingEntryAttempts == KMaxNumberOfPUKAttempts)
-            res = iSecurityDlg->ExecuteLD(R_PUK_REQUEST_QUERY);
-    else if(codeInfo.iRemainingEntryAttempts > KLastRemainingInputAttempt)
-       {
-         HBufC* queryPrompt = StringLoader::LoadLC(R_SECUI_REMAINING_PUK_ATTEMPTS, codeInfo.iRemainingEntryAttempts);
-         res = iSecurityDlg->ExecuteLD(R_PUK_REQUEST_QUERY, *queryPrompt);
-         CleanupStack::PopAndDestroy(queryPrompt);
-       }
-    else
-       {
-         HBufC* queryPrompt = StringLoader::LoadLC(R_SECUI_FINAL_PUK_ATTEMPT);
-         res = iSecurityDlg->ExecuteLD(R_PUK_REQUEST_QUERY, *queryPrompt);
-         CleanupStack::PopAndDestroy(queryPrompt);   
-       }
-    
-    if((!res) || (res == ESecUiEmergencyCall) || (res == EAknSoftkeyEmergencyCall))
+
+    if (attempts == KMaxNumberOfPINAttempts)
+        attempts = -1;
+
+    CSecQueryUi *iSecQueryUi;
+    RDEBUG("CSecQueryUi", 0);
+    iSecQueryUi = CSecQueryUi::NewL();
+    iQueryCanceled = EFalse;
+    RDEBUG("SecQueryDialog", 1);
+    // ESecUiCodeEtelReqest/ESecUiNone might be useful
+    TBuf<0x100> title;
+    title.Zero();
+    HBufC* stringHolder = HbTextResolverSymbian::LoadLC(_L("txt_pin_code_dialog_puk_code"));
+    title.Append(stringHolder->Des());
+    CleanupStack::PopAndDestroy(stringHolder);
+    title.Append(_L("$"));
+    title.AppendNum(attempts);
+    TInt lSecUiCancelSupported = ESecUiCancelSupported | ESecUiEmergencyNotSupported;
+    if (StartUp) // how to know whether PUK comes from failing at Starter, or failing at any other PIN (i.e. changing PIN, or changing PIN-request) ???
+        lSecUiCancelSupported = ESecUiCancelNotSupported | ESecUiEmergencySupported;
+    queryAccepted = iSecQueryUi->SecQueryDialog(title, puk1_password, SEC_C_PUK_CODE_MIN_LENGTH, SEC_C_PUK_CODE_MAX_LENGTH, ESecUiSecretNotSupported | ESecUiAlphaNotSupported
+            | lSecUiCancelSupported | ESecUiPukRequired);
+    RDEBUG("puk1_password", 0);
+    RDEBUGSTR(puk1_password);
+    iQueryCanceled = ETrue;
+    delete iSecQueryUi;
+    RDEBUG("queryAccepted", queryAccepted);
+
+    if ((queryAccepted == KErrAbort) || (queryAccepted == KErrCancel))
+        {
+        CleanupStack::PopAndDestroy(wait); // this is needed
+        return KErrCancel;
+        }
+
+    // send code
+    // first we verify the puk. For this, we reset the PIN to the same as the PUK
+    // Hopefully this will never fail in the case "new PIN too long"
+    RDEBUG("VerifySecurityCode", 0);
+    iPhone.VerifySecurityCode(wait->iStatus, blockCodeType, puk1_password, puk1_password);
+    RDEBUG("WaitForRequestL", 0);
+    res = wait->WaitForRequestL();
+    RDEBUG("WaitForRequestL res", res);
+    CleanupStack::PopAndDestroy(wait);
+
+    TInt returnValue = res;
+    switch (res)
+        {
+        case KErrNone:
+            // code approved -> note . The process continue and new-pin is requested
+            CSecuritySettings::ShowResultNoteL(res, CAknNoteDialog::EConfirmationTone);
+            break;
+        case KErrGsm0707IncorrectPassword:
+        case KErrAccessDenied:
+            // wrong PUK code -> note -> ask PUK code again        
+            CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone);
+            returnValue = Puk1RequiredL();
+            break;
+        case KErrGsm0707SimWrong:
+            // sim lock active
+            // no message ?
+            break;
+        case KErrGsmSSPasswordAttemptsViolation:
+        case KErrLocked:
+            // sim card rejected.
+            break;
+        default:
+            CSecuritySettings::ShowErrorNoteL(res);
+            returnValue = Puk1RequiredL();
+            break;
+        }
+
+    // Now the PUK1 is validated. It's time for asking the new PIN1
+    RDEBUG("new wait", 0);
+    wait = CWait::NewL();
+    CleanupStack::PushL(wait);
+        {
+        // new-pin query
+        CSecQueryUi * iSecQueryUi;
+        RDEBUG("CSecQueryUi", 0);
+        iSecQueryUi = CSecQueryUi::NewL();
+        iQueryCanceled = EFalse;
+        RDEBUG("SecQueryDialog", 1);
+        TBuf<0x100> title;
+        title.Zero();
+        HBufC* stringHolder = HbTextResolverSymbian::LoadLC(_L("txt_pin_code_dialog_new_pin_code"));
+        title.Append(stringHolder->Des());
+        CleanupStack::PopAndDestroy(stringHolder);
+        title.Append(_L("|"));
+        HBufC* stringHolder2 = HbTextResolverSymbian::LoadLC(_L("txt_pin_code_dialog_verify_new_pin_code"));
+        title.Append(stringHolder2->Des());
+        CleanupStack::PopAndDestroy(stringHolder2);
+        queryAccepted = iSecQueryUi->SecQueryDialog(title, aNewPinPassword, SEC_C_PIN_CODE_MIN_LENGTH, SEC_C_PIN_CODE_MAX_LENGTH, ESecUiAlphaNotSupported | ESecUiCancelSupported
+                | ESecUiPukRequired);
+        RDEBUG("aNewPinPassword", 0);
+        RDEBUGSTR(aNewPinPassword);
+        iQueryCanceled = ETrue;
+        delete iSecQueryUi;
+        RDEBUG("queryAccepted", queryAccepted);
+        }
+
+    if ((queryAccepted == KErrAbort) || (queryAccepted == KErrCancel))
         {
         CleanupStack::PopAndDestroy(wait);
         return KErrCancel;
         }
-        
-    RMobilePhone::TMobilePassword verifcationPassword;
-    // new pin code query
-    iSecurityDlg = new (ELeave) CCodeQueryDialog (aNewPassword,SEC_C_PIN_CODE_MIN_LENGTH,SEC_C_PIN_CODE_MAX_LENGTH,ESecUiPukRequired);
-    if(AknLayoutUtils::PenEnabled())
-        iSecurityDlg->SetEmergencyCallSupportForCBA( ETrue );
-    else
-        iSecurityDlg->SetEmergencyCallSupport(ETrue);
-    res = iSecurityDlg->ExecuteLD(R_NEW_PIN_CODE_REQUEST_QUERY);
-    if((!res) || (res == ESecUiEmergencyCall) || (res == EAknSoftkeyEmergencyCall))
-        {
-        CleanupStack::PopAndDestroy(wait);    
-        return KErrCancel;
-        }
-  
-    // verification code query
-    iSecurityDlg = new (ELeave) CCodeQueryDialog (verifcationPassword,SEC_C_PIN_CODE_MIN_LENGTH,SEC_C_PIN_CODE_MAX_LENGTH,ESecUiPukRequired);
-    if(AknLayoutUtils::PenEnabled())
-        iSecurityDlg->SetEmergencyCallSupportForCBA( ETrue );
-    else
-        iSecurityDlg->SetEmergencyCallSupport(ETrue);
-    res = iSecurityDlg->ExecuteLD(R_VERIFY_NEW_PIN_CODE_REQUEST_QUERY);
-    if((!res) || (res == ESecUiEmergencyCall) || (res == EAknSoftkeyEmergencyCall))
-        {
-        CleanupStack::PopAndDestroy(wait);
-        return KErrCancel;
-        }
-                            
-    while (aNewPassword.CompareF(verifcationPassword) != 0) 
-        {
-        // codes do not match -> note -> ask new pin and verification codes again  
-        CSecuritySettings::ShowResultNoteL(R_CODES_DONT_MATCH, CAknNoteDialog::EErrorTone);
-        
-        verifcationPassword = _L("");
-        aNewPassword = _L("");
 
-        // new pin code query
-        iSecurityDlg = new (ELeave) CCodeQueryDialog (aNewPassword,SEC_C_PIN_CODE_MIN_LENGTH,SEC_C_PIN_CODE_MAX_LENGTH,ESecUiPukRequired);
-        if(AknLayoutUtils::PenEnabled())
-            iSecurityDlg->SetEmergencyCallSupportForCBA( ETrue );
-        else
-            iSecurityDlg->SetEmergencyCallSupport(ETrue);
-        res = iSecurityDlg->ExecuteLD(R_NEW_PIN_CODE_REQUEST_QUERY);
-        if ((!res) || (res == ESecUiEmergencyCall) || (res == EAknSoftkeyEmergencyCall))
-            {
-            CleanupStack::PopAndDestroy(wait);
-            return KErrCancel;
-            }
-                
-        // verification code query
-        iSecurityDlg = new (ELeave) CCodeQueryDialog (verifcationPassword,SEC_C_PIN_CODE_MIN_LENGTH,SEC_C_PIN_CODE_MAX_LENGTH,ESecUiPukRequired);
-        if(AknLayoutUtils::PenEnabled())
-            iSecurityDlg->SetEmergencyCallSupportForCBA( ETrue );
-        else
-            iSecurityDlg->SetEmergencyCallSupport(ETrue);
-        res = iSecurityDlg->ExecuteLD(R_VERIFY_NEW_PIN_CODE_REQUEST_QUERY);
-    	if((!res) || (res == ESecUiEmergencyCall) || (res == EAknSoftkeyEmergencyCall))
-            {
-            CleanupStack::PopAndDestroy(wait);
-            return KErrCancel;
-            }
-        }            
-        
-    // send code
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecurityHandler::Puk1RequiredL(): Verify Code"));
-    #endif
-    iPhone.VerifySecurityCode(wait->iStatus,blockCodeType,aNewPassword,aPassword);
+    // send code again, now with the user pin
+    RDEBUG("VerifySecurityCode", 0);
+    iPhone.VerifySecurityCode(wait->iStatus, blockCodeType, aNewPinPassword, puk1_password);
+    RDEBUG("WaitForRequestL", 0);
     res = wait->WaitForRequestL();
+    RDEBUG("WaitForRequestL res", res);
     CleanupStack::PopAndDestroy(wait);
-    
-    TInt returnValue = res;
-    switch(res)
+
+    returnValue = res;
+    switch (res)
         {
         case KErrNone:
             // code approved -> note
             CSecuritySettings::ShowResultNoteL(R_PIN_CODE_CHANGED_NOTE, CAknNoteDialog::EConfirmationTone);
             break;
-           case KErrGsm0707IncorrectPassword:
+        case KErrGsm0707IncorrectPassword:
         case KErrAccessDenied:
             // wrong PUK code -> note -> ask PUK code again        
             CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone);
@@ -1576,121 +1382,104 @@
             break;
         case KErrGsm0707SimWrong:
             // sim lock active
+            // no message ?
             break;
         case KErrGsmSSPasswordAttemptsViolation:
         case KErrLocked:
             // sim card rejected.
             break;
         default:
-            CSecuritySettings::ShowErrorNoteL(res);        
+            CSecuritySettings::ShowErrorNoteL(res);
             returnValue = Puk1RequiredL();
             break;
-        }    
-
-        return returnValue;
+        }
+    RDEBUG("returnValue", returnValue);
+    return returnValue;
     }
 //
 // ----------------------------------------------------------
 // CSecurityHandler::Pin2Required()
 // Handles Pin2Required event
 // ----------------------------------------------------------
-//    
+// qtdone
 void CSecurityHandler::Pin2RequiredL()
     {
     /*****************************************************
-    *    Series 60 Customer / ETel
-    *    Series 60  ETel API
-    *****************************************************/
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecurityHandler::Pin2RequiredL() BEGIN"));
-    #endif
-    RMobilePhone::TMobilePassword password;
+     *    Series 60 Customer / ETel
+     *    Series 60  ETel API
+     *****************************************************/
+
+    RDEBUG("0", 0);
+    TInt queryAccepted = KErrCancel;
+    RMobilePhone::TMobilePassword iSecUi_password;
     RMobilePhone::TMobilePassword required_fourth;
     RMobilePhone::TMobilePhoneSecurityCode secCodeType(RMobilePhone::ESecurityCodePin2);
     RMobilePhone::TMobilePhoneSecurityCodeInfoV5 codeInfo;
     RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg codeInfoPkg(codeInfo);
     CWait* wait = CWait::NewL();
     CleanupStack::PushL(wait);
-    
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecurityHandler::Pin2RequiredL(): create dialog"));
-    #endif
-    iSecurityDlg = new (ELeave) CCodeQueryDialog (password,SEC_C_PIN2_CODE_MIN_LENGTH,SEC_C_PIN2_CODE_MAX_LENGTH,ESecUiNone);
-    #ifdef __COVER_DISPLAY
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecurityHandler::Pin2RequiredL(): publish dialog"));
-    #endif
-    iSecurityDlg->PublishDialogL(SecondaryDisplay::ECmdShowSecurityQuery, SecondaryDisplay::KCatStartup);
-    CAknMediatorFacade* covercl = AknMediatorFacade(iSecurityDlg); // uses MOP, so control provided 
-	if (covercl) // returns null if __COVER_DISPLAY is not defined
-    	{
-    	// … -  add data that cover ui is interested in
-    	covercl->BufStream().WriteInt32L(SecondaryDisplay::EShowPIN2); // adds int to additional data to be posted to cover ui
-    	covercl->BufStream().CommitL(); // no more data to send so commit buf
-     	}  
-    #endif //__COVER_DISPLAY
-    
-	#if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecurityHandler::Pin2RequiredL(): get PIN2 info"));
-    #endif
-    
-	wait->SetRequestType(EMobilePhoneGetSecurityCodeInfo);
+
+    wait->SetRequestType(EMobilePhoneGetSecurityCodeInfo);
+    RDEBUG("GetSecurityCodeInfo", 0);
     iPhone.GetSecurityCodeInfo(wait->iStatus, secCodeType, codeInfoPkg);
+    RDEBUG("WaitForRequestL", 0);
     TInt ret = wait->WaitForRequestL();
-        
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecurityHandler::Pin2RequiredL(): get PIN2 info result: %d"), ret);
-    TInt attempts(codeInfo.iRemainingEntryAttempts);
-    RDebug::Print(_L("(SECUI)CSecurityHandler::Pin2RequiredL(): attempts remaining: %d"), attempts);
-    #endif
+    RDEBUG("WaitForRequestL ret", ret);
     User::LeaveIfError(ret);
-    
-        CSecUiLockObserver* deviceLockStatusObserver = CSecUiLockObserver::NewL(iSecurityDlg);
-	    CleanupStack::PushL(deviceLockStatusObserver);
-        CSecUiLockObserver* queryStatusObserver = CSecUiLockObserver::NewL(iSecurityDlg, ESecUiRequestStateObserver);
-        CleanupStack::PushL(queryStatusObserver);
-        
-        if(codeInfo.iRemainingEntryAttempts == KMaxNumberOfPINAttempts)
-            ret = iSecurityDlg->ExecuteLD(R_PIN2_QUERY);
-        else if(codeInfo.iRemainingEntryAttempts > KLastRemainingInputAttempt)
-            {
-                HBufC* queryPrompt = StringLoader::LoadLC(R_SECUI_REMAINING_PIN2_ATTEMPTS, codeInfo.iRemainingEntryAttempts );
-                ret = iSecurityDlg->ExecuteLD(R_PIN2_QUERY, *queryPrompt);
-                CleanupStack::PopAndDestroy(queryPrompt);
-            }
-        else
-            {
-                HBufC* queryPrompt = StringLoader::LoadLC(R_SECUI_FINAL_PIN2_ATTEMPT);
-                ret = iSecurityDlg->ExecuteLD(R_PIN2_QUERY, *queryPrompt);
-                CleanupStack::PopAndDestroy(queryPrompt);   
-            }
-    CleanupStack::PopAndDestroy(2); //deviceLockStatusObserver, queryStatusObserver
-    iSecurityDlg = NULL;
-    if (!ret  || (ret == ESecUiDeviceLocked))
+
+    RDEBUG("codeInfo.iRemainingEntryAttempts",
+            codeInfo.iRemainingEntryAttempts);
+    if (codeInfo.iRemainingEntryAttempts == KMaxNumberOfPINAttempts)
+        codeInfo.iRemainingEntryAttempts = -1;
+
+    /* request PIN using QT */
+    CSecQueryUi *iSecQueryUi;
+    RDEBUG("CSecQueryUi", 0);
+    iSecQueryUi = CSecQueryUi::NewL();
+    iQueryCanceled = EFalse;
+    RDEBUG("SecQueryDialog", 1);
+    // ESecUiCodeEtelReqest/ESecUiNone might be useful against KLastRemainingInputAttempt
+
+    TBuf<0x100> title;
+    title.Zero();
+    HBufC* stringHolder = HbTextResolverSymbian::LoadLC(_L("txt_pin_code_dialog_pin2_code"));
+    title.Append(stringHolder->Des());
+    CleanupStack::PopAndDestroy(stringHolder);
+    title.Append(_L("$"));
+    title.AppendNum(codeInfo.iRemainingEntryAttempts);
+    queryAccepted = iSecQueryUi->SecQueryDialog(title, iSecUi_password, SEC_C_PIN2_CODE_MIN_LENGTH, SEC_C_PIN2_CODE_MAX_LENGTH, ESecUiSecretNotSupported | ESecUiAlphaNotSupported
+            | ESecUiCancelSupported | secCodeType);
+    RDEBUG("iSecUi_password", 0);
+    RDEBUGSTR(iSecUi_password);
+    RDEBUG("queryAccepted", queryAccepted);
+    iQueryCanceled = ETrue;
+    delete iSecQueryUi;
+
+    // If failed or device became locked, any pending request should be cancelled.
+    if (queryAccepted != KErrNone)
         {
-        iPhone.AbortSecurityCode(RMobilePhone::ESecurityCodePin2);
+        RDEBUG("AbortSecurityCode", 0);
+        iPhone.AbortSecurityCode(secCodeType);
+        RDEBUG("AbortSecurityCode", 1);
         CleanupStack::PopAndDestroy(wait);
         return;
         }
 
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecurityHandler::Pin2RequiredL(): Verify Code"));
-    #endif
-    iPhone.VerifySecurityCode(wait->iStatus,secCodeType,password,required_fourth);
+    RDEBUG("VerifySecurityCode", 0);
+    iPhone.VerifySecurityCode(wait->iStatus, secCodeType, iSecUi_password, required_fourth);
+    RDEBUG("WaitForRequestL", 0);
     TInt status = wait->WaitForRequestL();
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecurityHandler::Pin2RequiredL(): destroy wait"));
-    #endif
+    RDEBUG("WaitForRequestL status", status);
     CleanupStack::PopAndDestroy(wait);
 
-    switch(status)
-        {        
+    switch (status)
+        {
         case KErrNone:
             break;
         case KErrGsm0707IncorrectPassword:
         case KErrAccessDenied:
             // code was entered erroneously
-            CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone);       
+            CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone);
             break;
         case KErrGsmSSPasswordAttemptsViolation:
         case KErrLocked:
@@ -1698,164 +1487,159 @@
             CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone);
             break;
         default:
-            CSecuritySettings::ShowErrorNoteL(status);        
+            CSecuritySettings::ShowErrorNoteL(status);
             break;
         }
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecurityHandler::Pin2RequiredL(): END"));
-    #endif
     }
 //
 // ----------------------------------------------------------
 // CSecurityHandler::Puk2Required()
 // Handles Puk2Required event
 // ----------------------------------------------------------
-//    
+// qtdone
 void CSecurityHandler::Puk2RequiredL()
-    {    
+    {
     /*****************************************************
-    *    Series 60 Customer / ETel
-    *    Series 60  ETel API
-    *****************************************************/
-    RMobilePhone::TMobilePassword aPassword;
+     *    Series 60 Customer / ETel
+     *    Series 60  ETel API
+     *****************************************************/
+    RDEBUG("0", 0);
+    TInt queryAccepted = KErrCancel;
+    RMobilePhone::TMobilePassword iSecUi_password;
     RMobilePhone::TMobilePassword aNewPassword;
     RMobilePhone::TMobilePassword verifcationPassword;
     RMobilePhone::TMobilePhoneSecurityCodeInfoV5 codeInfo;
     RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg codeInfoPkg(codeInfo);
-    
-    RMobilePhone::TMobilePhoneSecurityCode blockCodeType;
-    blockCodeType = RMobilePhone::ESecurityCodePuk2;
+
+    RMobilePhone::TMobilePhoneSecurityCode secCodeType = RMobilePhone::ESecurityCodePuk2;
     CWait* wait = CWait::NewL();
     CleanupStack::PushL(wait);
-    
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecurityHandler::Puk2RequiredL()"));
-    #endif
+
     // ask PUK2
-    iSecurityDlg = new (ELeave) CCodeQueryDialog (aPassword,SEC_C_PUK2_CODE_MIN_LENGTH,SEC_C_PUK2_CODE_MAX_LENGTH,ESecUiNone);
-    #ifdef __COVER_DISPLAY
-    iSecurityDlg->PublishDialogL(SecondaryDisplay::ECmdShowSecurityQuery, SecondaryDisplay::KCatStartup);
-    CAknMediatorFacade* covercl = AknMediatorFacade(iSecurityDlg); // uses MOP, so control provided 
-	if (covercl) // returns null if __COVER_DISPLAY is not defined
-    	{
-    	// … -  add data that cover ui is interested in
-    	covercl->BufStream().WriteInt32L(SecondaryDisplay::EShowPUK2); // adds int to additional data to be posted to cover ui
-    	covercl->BufStream().CommitL(); // no more data to send so commit buf
-     	}  
-    #endif //__COVER_DISPLAY
-    CSecUiLockObserver* deviceLockStatusObserver = CSecUiLockObserver::NewL(iSecurityDlg);
-	CleanupStack::PushL(deviceLockStatusObserver);
-	
-	TInt ret(KErrNone);
+
+    TInt ret(KErrNone);
     wait->SetRequestType(EMobilePhoneGetSecurityCodeInfo);
-    iPhone.GetSecurityCodeInfo(wait->iStatus, blockCodeType, codeInfoPkg);
+    RDEBUG("GetSecurityCodeInfo", 0);
+    iPhone.GetSecurityCodeInfo(wait->iStatus, secCodeType, codeInfoPkg);
+    RDEBUG("WaitForRequestL", 0);
     ret = wait->WaitForRequestL();
+    RDEBUG("WaitForRequestL ret", ret);
     User::LeaveIfError(ret);
-        
-    if(codeInfo.iRemainingEntryAttempts == KMaxNumberOfPUKAttempts)
-            ret = iSecurityDlg->ExecuteLD(R_PUK2_REQUEST_QUERY);
-    else if(codeInfo.iRemainingEntryAttempts > KLastRemainingInputAttempt)
-       {
-         HBufC* queryPrompt = StringLoader::LoadLC(R_SECUI_REMAINING_PUK2_ATTEMPTS, codeInfo.iRemainingEntryAttempts);
-         ret = iSecurityDlg->ExecuteLD(R_PUK2_REQUEST_QUERY, *queryPrompt);
-         CleanupStack::PopAndDestroy(queryPrompt);
-       }
-    else
-       {
-         HBufC* queryPrompt = StringLoader::LoadLC(R_SECUI_FINAL_PUK2_ATTEMPT);
-         ret = iSecurityDlg->ExecuteLD(R_PUK2_REQUEST_QUERY, *queryPrompt);
-         CleanupStack::PopAndDestroy(queryPrompt);   
-       }
-	
-	iSecurityDlg = NULL;
-    if(!ret  || (ret == ESecUiDeviceLocked))
+
+    /* request PIN using QT */
+    CSecQueryUi *iSecQueryUi;
+    RDEBUG("CSecQueryUi", 0);
+    iSecQueryUi = CSecQueryUi::NewL();
+    iQueryCanceled = EFalse;
+    RDEBUG("SecQueryDialog", 1);
+    // ESecUiCodeEtelReqest/ESecUiNone might be useful
+
+    RDEBUG("codeInfo.iRemainingEntryAttempts",
+            codeInfo.iRemainingEntryAttempts);
+    if (codeInfo.iRemainingEntryAttempts == KMaxNumberOfPINAttempts) // TODO this might be 10 ?
+        codeInfo.iRemainingEntryAttempts = -1;
+
+    TBuf<0x100> title;
+    title.Zero();
+    HBufC* stringHolder = HbTextResolverSymbian::LoadLC(_L("txt_pin_code_dialog_puk2_code"));
+    title.Append(stringHolder->Des());
+    CleanupStack::PopAndDestroy(stringHolder);
+    title.Append(_L("$"));
+    title.AppendNum(codeInfo.iRemainingEntryAttempts);
+    queryAccepted = iSecQueryUi->SecQueryDialog(title, iSecUi_password, SEC_C_PUK2_CODE_MIN_LENGTH, SEC_C_PUK2_CODE_MAX_LENGTH, ESecUiSecretNotSupported | ESecUiAlphaNotSupported
+            | ESecUiCancelSupported | secCodeType);
+    RDEBUG("iSecUi_password", 0);
+    RDEBUGSTR(iSecUi_password);
+    iQueryCanceled = ETrue;
+    delete iSecQueryUi;
+    RDEBUG("queryAccepted", queryAccepted);
+
+    if (queryAccepted != KErrNone)
         {
-        #if defined(_DEBUG)
-    	RDebug::Print(_L("(SECUI)CSecurityHandler::Puk2RequiredL() PUK QUERY CANCEL"));
-    	#endif    
         // cancel "get security unblock code" request
-        iPhone.AbortSecurityCode(blockCodeType);
-		CleanupStack::PopAndDestroy(2); //wait, deviceLockStatusObserver
-        return;
-        }
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecurityHandler::Puk2RequiredL() NEW QUERY"));
-    #endif
-    // new pin2 code query
-    iSecurityDlg = new (ELeave) CCodeQueryDialog (aNewPassword,SEC_C_PIN2_CODE_MIN_LENGTH,SEC_C_PIN2_CODE_MAX_LENGTH,ESecUiNone);
-    deviceLockStatusObserver->SetAddress(iSecurityDlg);
-    ret = iSecurityDlg->ExecuteLD(R_NEW_PIN2_CODE_QUERY);
-    if(!ret  || (ret == ESecUiDeviceLocked))
-        {
-        #if defined(_DEBUG)
-    	RDebug::Print(_L("(SECUI)CSecurityHandler::Puk2RequiredL() NEW QUERY CANCEL"));
-    	#endif 
-        // cancel "get security unblock code" request
-        iPhone.AbortSecurityCode(blockCodeType);
-        CleanupStack::PopAndDestroy(2); //wait, deviceLockStatusObserver
+        RDEBUG("AbortSecurityCode", 0);
+        iPhone.AbortSecurityCode(secCodeType);
+        RDEBUG("AbortSecurityCode", 1);
+        CleanupStack::PopAndDestroy(1); //wait
         return;
         }
 
-     // verification code query
-    iSecurityDlg = new (ELeave) CCodeQueryDialog (verifcationPassword,SEC_C_PIN_CODE_MIN_LENGTH,SEC_C_PIN_CODE_MAX_LENGTH,ESecUiNone);
-    deviceLockStatusObserver->SetAddress(iSecurityDlg);
-    ret = iSecurityDlg->ExecuteLD(R_VERIFY_NEW_PIN2_CODE_QUERY);
-    if (!ret || (ret == ESecUiDeviceLocked))    
+    RDEBUG("VerifySecurityCode", 0);
+    iPhone.VerifySecurityCode(wait->iStatus, secCodeType, iSecUi_password, iSecUi_password);
+    // this writes the newPIN2 with the value of PUK2. It's ok, since the user forgot it
+    RDEBUG("WaitForRequestL", 0);
+    TInt res = wait->WaitForRequestL();
+    RDEBUG("WaitForRequestL res", res);
+    CleanupStack::PopAndDestroy(wait);
+
+    switch (res)
         {
-        #if defined(_DEBUG)
-    	RDebug::Print(_L("(SECUI)CSecurityHandler::Puk2RequiredL() VERIFY QUERY CANCEL"));
-    	#endif 
-        // cancel "get security unblock code" request
-        iPhone.AbortSecurityCode(blockCodeType);
-        CleanupStack::PopAndDestroy(2); //wait, deviceLockStatusObserver
-        return;
+        case KErrNone:
+            // code approved -> note
+            CSecuritySettings::ShowResultNoteL(res, CAknNoteDialog::EConfirmationTone);
+            break;
+        case KErrGsm0707IncorrectPassword:
+        case KErrAccessDenied:
+            // wrong PUK2 code -> note -> ask PUK2 code again        
+            CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone);
+            Puk2RequiredL();
+            break;
+        case KErrGsmSSPasswordAttemptsViolation:
+        case KErrLocked:
+            // Pin2 features blocked permanently!
+            CSecuritySettings::ShowResultNoteL(R_PIN2_REJECTED, CAknNoteDialog::EConfirmationTone);
+            break;
+        default:
+            CSecuritySettings::ShowErrorNoteL(res);
+            Puk2RequiredL();
+            break;
         }
-        
-    while (aNewPassword.CompareF(verifcationPassword) != 0) 
+
+    // now the PUK2 is valid. Time to get the new PIN2
+    wait = CWait::NewL();
+    CleanupStack::PushL(wait);
         {
-        // codes do not match -> note -> ask new pin and verification codes again  
-        CSecuritySettings::ShowResultNoteL(R_CODES_DONT_MATCH, CAknNoteDialog::EErrorTone);
-        
-        verifcationPassword = _L("");
-        aNewPassword = _L("");
-
         // new pin2 code query
-        iSecurityDlg = new (ELeave) CCodeQueryDialog (aNewPassword,SEC_C_PIN2_CODE_MIN_LENGTH,SEC_C_PIN2_CODE_MAX_LENGTH,ESecUiNone);
-        deviceLockStatusObserver->SetAddress(iSecurityDlg);
-        deviceLockStatusObserver->StartObserver();
-        
-        ret = iSecurityDlg->ExecuteLD(R_NEW_PIN2_CODE_QUERY);
-    
-        if(!ret || (ret == ESecUiDeviceLocked))
+        CSecQueryUi * iSecQueryUi;
+        RDEBUG("CSecQueryUi", 0);
+        iSecQueryUi = CSecQueryUi::NewL();
+        iQueryCanceled = EFalse;
+        TBuf<0x100> title;
+        title.Zero();
+        HBufC* stringHolder = HbTextResolverSymbian::LoadLC(_L("txt_pin_code_dialog_new_pin2_code"));
+        title.Append(stringHolder->Des());
+        CleanupStack::PopAndDestroy(stringHolder);
+        title.Append(_L("|"));
+        HBufC* stringHolder2 = HbTextResolverSymbian::LoadLC(_L("Verify"));
+        title.Append(stringHolder2->Des());
+        CleanupStack::PopAndDestroy(stringHolder2);
+        // ESecUiCodeEtelReqest/ESecUiNone might be useful
+        queryAccepted = iSecQueryUi->SecQueryDialog(title, aNewPassword, SEC_C_PIN2_CODE_MIN_LENGTH, SEC_C_PIN2_CODE_MAX_LENGTH, ESecUiAlphaNotSupported | ESecUiCancelSupported
+                | secCodeType);
+        RDEBUG("aNewPassword", 0);
+        RDEBUGSTR(aNewPassword);
+        iQueryCanceled = ETrue;
+        delete iSecQueryUi;
+        RDEBUG("queryAccepted", queryAccepted);
+        if (queryAccepted != KErrNone)
             {
             // cancel "get security unblock code" request
-            iPhone.AbortSecurityCode(blockCodeType);
-            CleanupStack::PopAndDestroy(2); //wait, deviceLockStatusObserver
+            RDEBUG("AbortSecurityCode", 0);
+            iPhone.AbortSecurityCode(secCodeType);
+            RDEBUG("AbortSecurityCode", 1);
+            CleanupStack::PopAndDestroy(1); //wait
             return;
             }
-                    
-        // verification code query
-        iSecurityDlg = new (ELeave) CCodeQueryDialog (verifcationPassword,SEC_C_PIN_CODE_MIN_LENGTH,SEC_C_PIN_CODE_MAX_LENGTH,ESecUiNone);
-        deviceLockStatusObserver->SetAddress(iSecurityDlg);
-        deviceLockStatusObserver->StartObserver();
-        ret = iSecurityDlg->ExecuteLD(R_VERIFY_NEW_PIN2_CODE_QUERY);
-        
-        if (!ret || (ret == ESecUiDeviceLocked))    
-            {
-            // cancel "get security unblock code" request
-            iPhone.AbortSecurityCode(blockCodeType);
-            CleanupStack::PopAndDestroy(2); //wait, deviceLockStatusObserver
-            return;
-            }
-        }            
-    CleanupStack::PopAndDestroy(deviceLockStatusObserver);            
-    // send code
-    
-    iPhone.VerifySecurityCode(wait->iStatus,blockCodeType,aNewPassword,aPassword);
-    TInt res = wait->WaitForRequestL();
+        }
+    // send code. The code was temporarilly changed before. Thus, this really done to set the new-new one
+    RDEBUG("VerifySecurityCode", 0);
+    iPhone.VerifySecurityCode(wait->iStatus, secCodeType, aNewPassword, iSecUi_password);
+    RDEBUG("WaitForRequestL", 0);
+    res = wait->WaitForRequestL();
+    RDEBUG("WaitForRequestL res", res);
     CleanupStack::PopAndDestroy(wait);
-    
-    switch(res)
+
+    switch (res)
         {
         case KErrNone:
             // code approved -> note
@@ -1870,13 +1654,13 @@
         case KErrGsmSSPasswordAttemptsViolation:
         case KErrLocked:
             // Pin2 features blocked permanently!
-            CSecuritySettings::ShowResultNoteL(R_PIN2_REJECTED, CAknNoteDialog::EConfirmationTone);    
-            break;    
+            CSecuritySettings::ShowResultNoteL(R_PIN2_REJECTED, CAknNoteDialog::EConfirmationTone);
+            break;
         default:
-            CSecuritySettings::ShowErrorNoteL(res);            
+            CSecuritySettings::ShowErrorNoteL(res);
             Puk2RequiredL();
             break;
-        }            
+        }
     }
 
 //
@@ -1884,187 +1668,130 @@
 // CSecurityHandler::UPinRequiredL()
 // Hendles UniversalPinRequired event
 // ----------------------------------------------------------
-//  
+// qtdone
 TInt CSecurityHandler::UPinRequiredL()
     {
     /*****************************************************
-    *    Series 60 Customer / ETel
-    *    Series 60  ETel API
-    *****************************************************/
-    TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ));
-    TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin ));
-    if(wcdmaSupported || upinSupported)
-       {
-        RMobilePhone::TMobilePassword password;
+     *    Series 60 Customer / ETel
+     *    Series 60  ETel API
+     *****************************************************/
+    TBool wcdmaSupported(FeatureManager::FeatureSupported(KFeatureIdProtocolWcdma));
+    TBool upinSupported(FeatureManager::FeatureSupported(KFeatureIdUpin));
+    RDEBUG("wcdmaSupported", wcdmaSupported);
+    RDEBUG("upinSupported", upinSupported);
+    if (wcdmaSupported || upinSupported)
+        {
+        TInt queryAccepted = KErrCancel;
+        TInt lCancelSupported = ESecUiCancelNotSupported;
+        RMobilePhone::TMobilePassword iSecUi_password;
         RMobilePhone::TMobilePassword required_fourth;
         RMobilePhone::TMobilePhoneSecurityCodeInfoV5 codeInfo;
         RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg codeInfoPkg(codeInfo);
         RMobilePhone::TMobilePhoneSecurityCode secCodeType = RMobilePhone::ESecurityUniversalPin;
         CWait* wait = CWait::NewL();
         CleanupStack::PushL(wait);
-        TBool StartUp = ETrue; 
+        TBool StartUp = ETrue;
         TInt secUiOriginatedQuery(ESecurityUIsSecUIOriginatedUninitialized);
         TInt err = KErrNone;
         TInt res = KErrGeneral;
-    
+
         StartUp = iStartup;
-    
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecurityHandler::UPinRequiredL()"));
-        #endif
-    
-        if(!StartUp)
-        {
+        RDEBUG("StartUp", StartUp);
+
+        wait->SetRequestType(EMobilePhoneGetSecurityCodeInfo);
+        RDEBUG("GetSecurityCodeInfo", 0);
+        iPhone.GetSecurityCodeInfo(wait->iStatus, secCodeType, codeInfoPkg);
+        RDEBUG("WaitForRequestL", 0);
+        res = wait->WaitForRequestL();
+        RDEBUG("WaitForRequestL res", res);
+        User::LeaveIfError(res);
+
+        if (!StartUp)
+            {
             // read a flag to see whether the query is SecUi originated. 
             err = RProperty::Get(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, secUiOriginatedQuery);
-        }
-        
-        #if defined(_DEBUG)
-        RDebug::Print(_L("CSecurityHandler::UPinRequiredL() Execute dlg"));
-        #endif 
-        if(StartUp || (secUiOriginatedQuery != ESecurityUIsSecUIOriginated) || (err != KErrNone))
-        {
-            iSecurityDlg = new (ELeave) CCodeQueryDialog (password,SEC_C_PIN_CODE_MIN_LENGTH,SEC_C_PIN_CODE_MAX_LENGTH,ESecUiCodeEtelReqest);
-            if(AknLayoutUtils::PenEnabled())
-                iSecurityDlg->SetEmergencyCallSupportForCBA( ETrue );
-            else
-                iSecurityDlg->SetEmergencyCallSupport(ETrue);
-            #ifdef __COVER_DISPLAY
-            iSecurityDlg->PublishDialogL(SecondaryDisplay::ECmdShowSecurityQuery, SecondaryDisplay::KCatStartup);
-            CAknMediatorFacade* covercl = AknMediatorFacade(iSecurityDlg); // uses MOP, so control provided 
-    		if (covercl) // returns null if __COVER_DISPLAY is not defined
-        		{
-        		// … -  add data that cover ui is interested in
-        		covercl->BufStream().WriteInt32L(SecondaryDisplay::EShowUPIN); // adds int to additional data to be posted to cover ui
-        		covercl->BufStream().CommitL(); // no more data to send so commit buf
-         		}  
-            #endif //__COVER_DISPLAY
-            
-            wait->SetRequestType(EMobilePhoneGetSecurityCodeInfo);
-            iPhone.GetSecurityCodeInfo(wait->iStatus, secCodeType, codeInfoPkg);
-            res = wait->WaitForRequestL();
-            User::LeaveIfError(res);
-            
-            if( codeInfo.iRemainingEntryAttempts >= KMaxNumberOfPINAttempts )
-                res = iSecurityDlg->ExecuteLD(R_UPIN_REQUEST_QUERY);
-            else if(codeInfo.iRemainingEntryAttempts > KLastRemainingInputAttempt)
-                {
-                    HBufC* queryPrompt = StringLoader::LoadLC(R_SECUI_REMAINING_UPIN_ATTEMPTS, codeInfo.iRemainingEntryAttempts);
-                    res = iSecurityDlg->ExecuteLD(R_UPIN_REQUEST_QUERY, *queryPrompt);
-                    CleanupStack::PopAndDestroy(queryPrompt);
-                }
-            else
-                {
-                    HBufC* queryPrompt = StringLoader::LoadLC(R_SECUI_FINAL_UPIN_ATTEMPT);
-                    res = iSecurityDlg->ExecuteLD(R_UPIN_REQUEST_QUERY, *queryPrompt);
-                    CleanupStack::PopAndDestroy(queryPrompt);   
-                }
-            
-            
-            if ((!res) || (res == ESecUiEmergencyCall) || (res == EAknSoftkeyEmergencyCall))
-                { 
-                CleanupStack::PopAndDestroy(wait);   
-                return KErrCancel;
-                }
-        }
+            }
+
+        /* request PIN using QT */
+        CSecQueryUi *iSecQueryUi;
+        RDEBUG("CSecQueryUi", 0);
+        iSecQueryUi = CSecQueryUi::NewL();
+        iQueryCanceled = EFalse;
+        // ESecUiCodeEtelReqest/ESecUiNone might be useful
+        // TODO also support Emergency
+        if (StartUp || (secUiOriginatedQuery != ESecurityUIsSecUIOriginated) || (err != KErrNone))
+            lCancelSupported = ESecUiCancelNotSupported;
         else
-        {
-            iSecurityDlg = new (ELeave) CCodeQueryDialog (password,SEC_C_PIN_CODE_MIN_LENGTH,SEC_C_PIN_CODE_MAX_LENGTH,ESecUiNone);
-            #ifdef __COVER_DISPLAY
-            iSecurityDlg->PublishDialogL(SecondaryDisplay::ECmdShowSecurityQuery, SecondaryDisplay::KCatStartup);
-            CAknMediatorFacade* covercl = AknMediatorFacade(iSecurityDlg); // uses MOP, so control provided 
-    		if (covercl) // returns null if __COVER_DISPLAY is not defined
-        		{
-        		// … -  add data that cover ui is interested in
-        		covercl->BufStream().WriteInt32L(SecondaryDisplay::EShowUPIN); // adds int to additional data to be posted to cover ui
-        		covercl->BufStream().CommitL(); // no more data to send so commit buf
-         		}  
-            #endif //__COVER_DISPLAY
-            
-    		wait->SetRequestType(EMobilePhoneGetSecurityCodeInfo);
-            iPhone.GetSecurityCodeInfo(wait->iStatus, secCodeType, codeInfoPkg);
-            res = wait->WaitForRequestL();
-            User::LeaveIfError(res);
-            
-            CSecUiLockObserver* deviceLockStatusObserver = CSecUiLockObserver::NewL(iSecurityDlg);
-    		CleanupStack::PushL(deviceLockStatusObserver);
-    		CSecUiLockObserver* queryStatusObserver = CSecUiLockObserver::NewL(iSecurityDlg, ESecUiRequestStateObserver);
-            CleanupStack::PushL(queryStatusObserver);
-            
-            if( codeInfo.iRemainingEntryAttempts >= KMaxNumberOfPINAttempts )
-                res = iSecurityDlg->ExecuteLD(R_UPIN_QUERY);
-            else if(codeInfo.iRemainingEntryAttempts > KLastRemainingInputAttempt)
-                {
-                    HBufC* queryPrompt = StringLoader::LoadLC(R_SECUI_REMAINING_UPIN_ATTEMPTS, codeInfo.iRemainingEntryAttempts);
-                    res = iSecurityDlg->ExecuteLD(R_UPIN_QUERY, *queryPrompt);
-                    CleanupStack::PopAndDestroy(queryPrompt);
-                }
-            else
-                {
-                    HBufC* queryPrompt = StringLoader::LoadLC(R_SECUI_FINAL_UPIN_ATTEMPT);
-                    res = iSecurityDlg->ExecuteLD(R_UPIN_QUERY, *queryPrompt);
-                    CleanupStack::PopAndDestroy(queryPrompt);   
-                }
-    		
-    		CleanupStack::PopAndDestroy(2); //deviceLockStatusObserver, queryStatusObserver
-    		iSecurityDlg = NULL;
-            if( !res || (res == ESecUiDeviceLocked))
-                {
-                // cancel code request
-                CleanupStack::PopAndDestroy(wait);
-                iPhone.AbortSecurityCode(RMobilePhone::ESecurityUniversalPin);
-                return KErrCancel;
-                }      
-        }
-        
-        #if defined(_DEBUG)
-        RDebug::Print(_L("CSecurityNotifier::UPinRequiredL()VerifySecurityCode"));
-        #endif
-        iPhone.VerifySecurityCode(wait->iStatus,secCodeType, password, required_fourth);
+            lCancelSupported = ESecUiCancelSupported;
+
+        TBuf<0x100> title;
+        title.Zero();
+        HBufC* stringHolder = HbTextResolverSymbian::LoadLC(_L("txt_pin_code_dialog_upin_code"));
+        title.Append(stringHolder->Des());
+        CleanupStack::PopAndDestroy(stringHolder);
+        title.Append(_L("$"));
+        title.AppendNum(codeInfo.iRemainingEntryAttempts);
+        queryAccepted = iSecQueryUi->SecQueryDialog(title, iSecUi_password, SEC_C_PIN_CODE_MIN_LENGTH, SEC_C_PIN_CODE_MAX_LENGTH, ESecUiSecretSupported | ESecUiAlphaNotSupported
+                | lCancelSupported | ESecUiCodeEtelReqest);
+        RDEBUG("iSecUi_password", 0);
+        RDEBUGSTR(iSecUi_password);
+        iQueryCanceled = ETrue;
+        delete iSecQueryUi;
+        RDEBUG("queryAccepted", queryAccepted);
+        if (queryAccepted != KErrNone)
+            {
+            CleanupStack::PopAndDestroy(wait);
+            RDEBUG("AbortSecurityCode", 0);
+            iPhone.AbortSecurityCode(RMobilePhone::ESecurityUniversalPin);
+            RDEBUG("AbortSecurityCode", 1);
+
+            return KErrCancel;
+            }
+        RDEBUG("VerifySecurityCode", 0);
+        iPhone.VerifySecurityCode(wait->iStatus, secCodeType, iSecUi_password, required_fourth);
+        RDEBUG("WaitForRequestL", 0);
         res = wait->WaitForRequestL();
+        RDEBUG("WaitForRequestL res", res);
         CleanupStack::PopAndDestroy(wait);
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecurityHandler::UPinRequiredL() VerifySecurityCode STATUS: %d"), res);
-        #endif
+
         TInt returnValue = res;
-        switch(res)
-            {        
+        switch (res)
+            {
             case KErrNone:
                 // code approved 
-                #if defined(_DEBUG)
-                RDebug::Print(_L("CSecurityHandler::UPinRequiredL()code approved "));
-                #endif
+                RDEBUG("code approved ", 0)
+                ;
                 CSecuritySettings::ShowResultNoteL(R_CONFIRMATION_NOTE, CAknNoteDialog::EConfirmationTone);
                 break;
             case KErrGsm0707IncorrectPassword:
             case KErrAccessDenied:
                 // code was entered erroneously
                 CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone);
-                if(StartUp)
-                {
-                returnValue = UPinRequiredL();
-                }
+                if (StartUp)
+                    {
+                    returnValue = UPinRequiredL();
+                    }
                 break;
             case KErrGsmSSPasswordAttemptsViolation:
             case KErrLocked:
                 // code blocked; show error note and terminate.
-                if(StartUp)
-                    CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone); 
+                if (StartUp)
+                    CSecuritySettings::ShowResultNoteL(res, CAknNoteDialog::EErrorTone);
                 break;
             case KErrGsm0707SimWrong:
                 // sim lock active
                 break;
-            default:
+            default: // for example, KErrArgument
                 CSecuritySettings::ShowErrorNoteL(res);
-                if(StartUp)
-                {
-                returnValue = UPinRequiredL();
-                }
+                if (StartUp)
+                    {
+                    returnValue = UPinRequiredL();
+                    }
                 break;
             }
-    
+
         return returnValue;
-       }
+        }
     else
         return KErrNone;
     }
@@ -2073,146 +1800,113 @@
 // CSecurityHandler::UPukRequiredL()
 // Handles UPukRequired event
 // ----------------------------------------------------------
-//
+// qtdone
 TInt CSecurityHandler::UPukRequiredL()
     {
-    TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ));
-    TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin ));
-    if(wcdmaSupported || upinSupported)
-       {
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecurityHandler::UPukRequiredL()"));
-        #endif            
-        RMobilePhone::TMobilePassword aPassword;
+    TBool wcdmaSupported(FeatureManager::FeatureSupported(KFeatureIdProtocolWcdma));
+    TBool upinSupported(FeatureManager::FeatureSupported(KFeatureIdUpin));
+    if (wcdmaSupported || upinSupported)
+        {
+        RDEBUG("0", 0);
+        TInt queryAccepted = KErrCancel;
+        RMobilePhone::TMobilePassword iSecUi_password;
         RMobilePhone::TMobilePassword aNewPassword;
         RMobilePhone::TMobilePhoneSecurityCodeInfoV5 codeInfo;
         RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg codeInfoPkg(codeInfo);
-    
+
         RMobilePhone::TMobilePhoneSecurityCode blockCodeType;
         blockCodeType = RMobilePhone::ESecurityUniversalPuk;
         CWait* wait = CWait::NewL();
         CleanupStack::PushL(wait);
-        
+
         TBool StartUp(ETrue);
         StartUp = iStartup;
-    
+
         TInt res(KErrNone);
         wait->SetRequestType(EMobilePhoneGetSecurityCodeInfo);
+        RDEBUG("GetSecurityCodeInfo", 0);
         iPhone.GetSecurityCodeInfo(wait->iStatus, blockCodeType, codeInfoPkg);
+        RDEBUG("WaitForRequestL", 0);
         res = wait->WaitForRequestL();
+        RDEBUG("WaitForRequestL res", res);
         User::LeaveIfError(res);
         //show last "Code Error" note for UPIN verify result so it won't be left under the PUK1 dialog
-        if(!StartUp && (codeInfo.iRemainingEntryAttempts == KMaxNumberOfPUKAttempts))
+        if (!StartUp && (codeInfo.iRemainingEntryAttempts == KMaxNumberOfPUKAttempts))
             CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone);
-        
+
         // ask UPUK code
-        iSecurityDlg = new (ELeave) CCodeQueryDialog (aPassword,SEC_C_PUK_CODE_MIN_LENGTH,SEC_C_PUK_CODE_MAX_LENGTH,ESecUiPukRequired);
-        if(AknLayoutUtils::PenEnabled())
-            iSecurityDlg->SetEmergencyCallSupportForCBA( ETrue );
-        else
-            iSecurityDlg->SetEmergencyCallSupport(ETrue);
-        #ifdef __COVER_DISPLAY
-        iSecurityDlg->PublishDialogL(SecondaryDisplay::ECmdShowSecurityQuery, SecondaryDisplay::KCatStartup);
-        CAknMediatorFacade* covercl = AknMediatorFacade(iSecurityDlg); // uses MOP, so control provided 
-    		if (covercl) // returns null if __COVER_DISPLAY is not defined
-        		{
-        		// … -  add data that cover ui is interested in
-        		covercl->BufStream().WriteInt32L(SecondaryDisplay::EShowUPUK);// adds int to additional data to be posted to cover ui
-        		covercl->BufStream().CommitL(); // no more data to send so commit buf
-         		}  
-        #endif //__COVER_DISPLAY
-       
-            
-        if(codeInfo.iRemainingEntryAttempts == KMaxNumberOfPUKAttempts)
-                res = iSecurityDlg->ExecuteLD(R_UPUK_REQUEST_QUERY);
-        else if(codeInfo.iRemainingEntryAttempts > KLastRemainingInputAttempt)
-           {
-             HBufC* queryPrompt = StringLoader::LoadLC(R_SECUI_REMAINING_UPUK_ATTEMPTS, codeInfo.iRemainingEntryAttempts);
-             res = iSecurityDlg->ExecuteLD(R_UPUK_REQUEST_QUERY, *queryPrompt);
-             CleanupStack::PopAndDestroy(queryPrompt);
-           }
-        else
-           {
-             HBufC* queryPrompt = StringLoader::LoadLC(R_SECUI_FINAL_UPUK_ATTEMPT);
-             res = iSecurityDlg->ExecuteLD(R_UPUK_REQUEST_QUERY, *queryPrompt);
-             CleanupStack::PopAndDestroy(queryPrompt);   
-           }
-        
-        if((!res) || (res == ESecUiEmergencyCall) || (res == EAknSoftkeyEmergencyCall))
+        /* request PIN using QT */
             {
-            CleanupStack::PopAndDestroy(wait);
-            return KErrCancel;
-            }
-            
-        RMobilePhone::TMobilePassword verifcationPassword;
-        // new upin code query
-        iSecurityDlg = new (ELeave) CCodeQueryDialog (aNewPassword,SEC_C_PIN_CODE_MIN_LENGTH,SEC_C_PIN_CODE_MAX_LENGTH,ESecUiPukRequired);
-        if(AknLayoutUtils::PenEnabled())
-            iSecurityDlg->SetEmergencyCallSupportForCBA( ETrue );
-        else
-            iSecurityDlg->SetEmergencyCallSupport(ETrue);
-        res = iSecurityDlg->ExecuteLD(R_NEW_UPIN_CODE_REQUEST_QUERY);
-        if((!res) || (res == ESecUiEmergencyCall) || (res == EAknSoftkeyEmergencyCall))
-            {
-            CleanupStack::PopAndDestroy(wait);    
-            return KErrCancel;
-            }
-      
-        // verification code query
-        iSecurityDlg = new (ELeave) CCodeQueryDialog (verifcationPassword,SEC_C_PIN_CODE_MIN_LENGTH,SEC_C_PIN_CODE_MAX_LENGTH,ESecUiPukRequired);
-        if(AknLayoutUtils::PenEnabled())
-            iSecurityDlg->SetEmergencyCallSupportForCBA( ETrue );
-        else
-            iSecurityDlg->SetEmergencyCallSupport(ETrue);
-        res = iSecurityDlg->ExecuteLD(R_VERIFY_NEW_UPIN_CODE_REQUEST_QUERY);
-        if((!res) || (res == ESecUiEmergencyCall) || (res == EAknSoftkeyEmergencyCall))
-            {
-            CleanupStack::PopAndDestroy(wait);
-            return KErrCancel;
-            }
-                                
-        while (aNewPassword.CompareF(verifcationPassword) != 0) 
-            {
-            // codes do not match -> note -> ask new upin and verification codes again  
-            CSecuritySettings::ShowResultNoteL(R_CODES_DONT_MATCH, CAknNoteDialog::EErrorTone);
-            
-            verifcationPassword = _L("");
-            aNewPassword = _L("");
-    
-            // new upin code query
-            iSecurityDlg = new (ELeave) CCodeQueryDialog (aNewPassword,SEC_C_PIN_CODE_MIN_LENGTH,SEC_C_PIN_CODE_MAX_LENGTH,ESecUiPukRequired);
-            if(AknLayoutUtils::PenEnabled())
-                iSecurityDlg->SetEmergencyCallSupportForCBA( ETrue );
-            else
-                iSecurityDlg->SetEmergencyCallSupport(ETrue);
-            res = iSecurityDlg->ExecuteLD(R_NEW_UPIN_CODE_REQUEST_QUERY);
-        	if((!res) || (res == ESecUiEmergencyCall) || (res == EAknSoftkeyEmergencyCall))
+            CSecQueryUi *iSecQueryUi;
+            RDEBUG("CSecQueryUi", 0);
+            iSecQueryUi = CSecQueryUi::NewL();
+            iQueryCanceled = EFalse;
+            // TODO ESecUiCodeEtelReqest/ESecUiNone might be useful
+            // TODO also support Emergency
+
+            TBuf<0x100> title;
+            title.Zero();
+            HBufC* stringHolder = HbTextResolverSymbian::LoadLC(_L("txt_pin_code_dialog_puk_code"));
+            title.Append(stringHolder->Des());
+            CleanupStack::PopAndDestroy(stringHolder);
+            title.Append(_L("$"));
+            title.AppendNum(codeInfo.iRemainingEntryAttempts);
+            queryAccepted = iSecQueryUi->SecQueryDialog(title, iSecUi_password, SEC_C_PUK_CODE_MIN_LENGTH, SEC_C_PUK_CODE_MAX_LENGTH, ESecUiAlphaNotSupported
+                    | ESecUiCancelSupported | ESecUiPukRequired);
+            RDEBUG("iSecUi_password", 0);
+            RDEBUGSTR(iSecUi_password);
+            iQueryCanceled = ETrue;
+            delete iSecQueryUi;
+            RDEBUG("queryAccepted", queryAccepted);
+
+            if (queryAccepted != KErrNone)
                 {
                 CleanupStack::PopAndDestroy(wait);
                 return KErrCancel;
                 }
-                    
-            // verification code query
-            iSecurityDlg = new (ELeave) CCodeQueryDialog (verifcationPassword,SEC_C_PIN_CODE_MIN_LENGTH,SEC_C_PIN_CODE_MAX_LENGTH,ESecUiPukRequired);
-            if(AknLayoutUtils::PenEnabled())
-                iSecurityDlg->SetEmergencyCallSupportForCBA( ETrue );
-            else
-                iSecurityDlg->SetEmergencyCallSupport(ETrue);
-            res = iSecurityDlg->ExecuteLD(R_VERIFY_NEW_UPIN_CODE_REQUEST_QUERY);
-        	if((!res) || (res == ESecUiEmergencyCall) || (res == EAknSoftkeyEmergencyCall))
+            }
+
+            {
+            /* request PIN using QT */
+            CSecQueryUi *iSecQueryUi;
+            RDEBUG("CSecQueryUi", 0);
+            iSecQueryUi = CSecQueryUi::NewL();
+            iQueryCanceled = EFalse;
+            // TODO ESecUiCodeEtelReqest/ESecUiNone might be useful
+            // TODO also support Emergency
+            TBuf<0x100> title;
+            title.Zero();
+            HBufC* stringHolder = HbTextResolverSymbian::LoadLC(_L("txt_pin_code_dialog_new_upin_code"));
+            title.Append(stringHolder->Des());
+            CleanupStack::PopAndDestroy(stringHolder);
+            title.Append(_L("|"));
+            HBufC* stringHolder2 = HbTextResolverSymbian::LoadLC(_L("Verify"));
+            title.Append(stringHolder2->Des());
+            CleanupStack::PopAndDestroy(stringHolder2);
+            queryAccepted = iSecQueryUi->SecQueryDialog(title, aNewPassword, SEC_C_PUK_CODE_MIN_LENGTH, SEC_C_PUK_CODE_MAX_LENGTH, ESecUiAlphaNotSupported | ESecUiCancelSupported
+                    | ESecUiPukRequired);
+            RDEBUG("aNewPassword", 0);
+            RDEBUGSTR(aNewPassword);
+            iQueryCanceled = ETrue;
+            delete iSecQueryUi;
+            RDEBUG("queryAccepted", queryAccepted);
+            if (queryAccepted != KErrNone)
                 {
                 CleanupStack::PopAndDestroy(wait);
                 return KErrCancel;
                 }
-            }            
-            
+            }
+
         // send code
-        iPhone.VerifySecurityCode(wait->iStatus,blockCodeType,aNewPassword,aPassword);
+        RDEBUG("VerifySecurityCode", 0);
+        iPhone.VerifySecurityCode(wait->iStatus, blockCodeType, aNewPassword, iSecUi_password);
+        RDEBUG("WaitForRequestL", 0);
         res = wait->WaitForRequestL();
+        RDEBUG("WaitForRequestL res", res);
         CleanupStack::PopAndDestroy(wait);
-        
+
         TInt returnValue = res;
-        switch(res)
+        switch (res)
             {
             case KErrNone:
                 // code approved -> note
@@ -2232,14 +1926,15 @@
                 // sim card rejected.
                 break;
             default:
-                CSecuritySettings::ShowErrorNoteL(res);        
+                CSecuritySettings::ShowErrorNoteL(res);
                 returnValue = UPukRequiredL();
                 break;
-            }   
-    
+            }
+
         return returnValue;
-       }
+        }
     else
+        // not wcdmaSupported || upinSupported
         return KErrNone;
     }
 
@@ -2248,13 +1943,11 @@
 // CSecurityHandler::SimLockEventL()
 // Shows "SIM restriction on" note
 // ----------------------------------------------------------
-//    
+// qtdone
 void CSecurityHandler::SimLockEventL()
     {
-    #if defined(_DEBUG)
-    RDebug::Print(_L("CSecurityHandler::SimLockEventL()"));
-    #endif
-    CSecuritySettings::ShowResultNoteL(R_SIM_ON, CAknNoteDialog::EConfirmationTone);    
+    RDEBUG("0", 0);
+    CSecuritySettings::ShowResultNoteL(R_SIM_ON, CAknNoteDialog::EConfirmationTone);
     }
 // ---------------------------------------------------------
 // CSecurityHandler::RemoveSplashScreenL()
@@ -2269,20 +1962,14 @@
 // CSecurityHandler::ShowGenericErrorNoteL(TInt aStatus)
 // Shows a generic error note
 // ---------------------------------------------------------
-
+// qtdone
 void CSecurityHandler::ShowGenericErrorNoteL(TInt aStatus)
     {
-       // Let's create TextResolver instance for error resolving...
-       CTextResolver* textresolver = CTextResolver::NewLC(); 
-       // Resolve the error
-       TPtrC errorstring;
-       errorstring.Set( textresolver->ResolveErrorString( aStatus ) );
-       iNoteDlg = new (ELeave) CAknNoteDialog(REINTERPRET_CAST(CEikDialog**,&iNoteDlg));
-       iNoteDlg->PrepareLC(R_CODE_ERROR);
-       iNoteDlg->SetTextL((TDesC&)errorstring);
-       iNoteDlg->RunDlgLD(CAknNoteDialog::ELongTimeout, CAknNoteDialog::EErrorTone);
-       CleanupStack::PopAndDestroy(textresolver); 
+    // Let's create TextResolver instance for error resolving...
+    RDEBUG("aStatus", aStatus);
+    RDEBUG("!!!!! this should never be called !!!!", 0);
+
+    CSecuritySettings::ShowResultNoteL(aStatus, CAknNoteDialog::EErrorTone);
     }
-                    
 
 // End of file
--- a/securitydialogs/SecUi/Src/SecUiSecuritySettings.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/securitydialogs/SecUi/Src/SecUiSecuritySettings.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -1,26 +1,24 @@
 /*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Provides api for changing security settings.
-*
-*
-*/
-
+ * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  Provides api for changing security settings.
+ *
+ *
+ */
 
 #include <etelmm.h>
 #include <exterror.h>
 #include <textresolver.h>
-#include <SecUi.rsg>
 #include <aknnotedialog.h>
 #include <mmtsy_names.h>
 #include <centralrepository.h> 
@@ -31,39 +29,42 @@
 #include <PSVariables.h>   // Property values
 #include <securityuisprivatepskeys.h>
 #include <startupdomainpskeys.h>
+#include "SecUi.h"
 #include "secuisecuritysettings.h"
-#include "SecUiAutoLockSettingPage.h"
 #include "secui.hrh"
 #include "secuisecurityhandler.h"
 #include "secuicodequerydialog.h"
 #include "SecUiWait.h"
-
-#ifdef RD_REMOTELOCK
+#include <hb/hbcore/hbtextresolversymbian.h>
 #include <aknnotewrappers.h>
 #include <StringLoader.h>
 #include <RemoteLockSettings.h>
-#include "SecUiRemoteLockSettingPage.h"
-#endif // RD_REMOTELOCK
 #include <featmgr.h>
-    /*****************************************************
-    *    Series 60 Customer / TSY
-    *    Needs customer TSY implementation
-    *****************************************************/
+
+#include "SecQueryUi.h"
+#include <hb/hbwidgets/hbdevicemessageboxsymbian.h>
+
+/*****************************************************
+ *    Series 60 Customer / TSY
+ *    Needs customer TSY implementation
+ *****************************************************/
 //  LOCAL CONSTANTS AND MACROS  
 
-const TInt KTriesToConnectServer( 2 );
-const TInt KTimeBeforeRetryingServerConnection( 50000 );
-const TInt PhoneIndex( 0 );
+const TInt KTriesToConnectServer(2);
+const TInt KTimeBeforeRetryingServerConnection(50000);
+const TInt PhoneIndex(0);
 
-const TInt KMaxNumberOfPINAttempts(3);
-const TInt KLastRemainingInputAttempt(1);
+const TInt KMaxNumberOfPINAttempts(3); // is this valid also for PIN2 ?
+
+#define ESecUiTypeLock                  0x00100000
+#define KErrTDevicelockPolicies					0x10207837
 
 // ================= MEMBER FUNCTIONS =======================
 //
 // ----------------------------------------------------------
 // CSecuritySettings::NewL()
 // ----------------------------------------------------------
-//
+// qtdone
 EXPORT_C CSecuritySettings* CSecuritySettings::NewL()
     {
     CSecuritySettings* self = new (ELeave) CSecuritySettings();
@@ -77,7 +78,7 @@
 // CSecuritySettings::CSecuritySettings()
 // constructor
 // ----------------------------------------------------------
-//
+// qtdone
 EXPORT_C CSecuritySettings::CSecuritySettings()
     {
     }
@@ -86,91 +87,93 @@
 // CSecuritySettings::ConstructL()
 // Symbian OS constructor.
 // ----------------------------------------------------------
-//
+// qtdone
 EXPORT_C void CSecuritySettings::ConstructL()
     {
     /*****************************************************
-    *    Series 60 Customer / ETel
-    *    Series 60  ETel API
-    *****************************************************/
+     *    Series 60 Customer / ETel
+     *    Series 60  ETel API
+     *****************************************************/
     /*****************************************************
-    *    Series 60 Customer / TSY
-    *    Needs customer TSY implementation
-    *****************************************************/
+     *    Series 60 Customer / TSY
+     *    Needs customer TSY implementation
+     *****************************************************/
 
-    TInt err( KErrGeneral );
-    TInt thisTry( 0 );
+    RDEBUG("0", 0);
+    TInt err(KErrGeneral);
+    TInt thisTry(0);
     iWait = CWait::NewL();
     RTelServer::TPhoneInfo PhoneInfo;
     /* All server connections are tried to be made KTriesToConnectServer times because occasional
-    fails on connections are possible, at least on some servers */
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecuritySettings::ConstructL()"));
-    #endif
-    
+     fails on connections are possible, at least on some servers */
+
     FeatureManager::InitializeLibL();
     // connect to ETel server
-    while ( ( err = iServer.Connect() ) != KErrNone && ( thisTry++ ) <= KTriesToConnectServer )
+    while ((err = iServer.Connect()) != KErrNone && (thisTry++) <= KTriesToConnectServer)
         {
-        User::After( KTimeBeforeRetryingServerConnection );
+        User::After( KTimeBeforeRetryingServerConnection);
         }
-    User::LeaveIfError( err );
+    User::LeaveIfError(err);
 
     // load TSY
-    err = iServer.LoadPhoneModule( KMmTsyModuleName );
-    if ( err != KErrAlreadyExists )
+    err = iServer.LoadPhoneModule(KMmTsyModuleName);
+    if (err != KErrAlreadyExists)
         {
         // May return also KErrAlreadyExists if something else
         // has already loaded the TSY module. And that is
         // not an error.
-        User::LeaveIfError( err );
+        User::LeaveIfError(err);
         }
 
     // open phones
     User::LeaveIfError(iServer.SetExtendedErrorGranularity(RTelServer::EErrorExtended));
     User::LeaveIfError(iServer.GetPhoneInfo(PhoneIndex, PhoneInfo));
-    User::LeaveIfError(iPhone.Open(iServer,PhoneInfo.iName));
+    User::LeaveIfError(iPhone.Open(iServer, PhoneInfo.iName));
     User::LeaveIfError(iCustomPhone.Open(iPhone));
 
-    iSecurityHandler = new( ELeave ) CSecurityHandler( iPhone );
+    iSecurityHandler = new (ELeave) CSecurityHandler(iPhone);
+    _LIT(KFileName, "secui_");
+    _LIT(KPath, "z:/resource/qt/translations/");
+    RDEBUG("HbTextResolverSymbian", 0);
+    TBool result = HbTextResolverSymbian::Init(KFileName, KPath);
+    RDEBUG("result", result);
+
     }
 //
 // ----------------------------------------------------------
 // CSecuritySettings::~CSecuritySettings()
 // Destructor
 // ----------------------------------------------------------
-//
+// qtdone
 EXPORT_C CSecuritySettings::~CSecuritySettings()
     {
     /*****************************************************
-    *    Series 60 Customer / ETel
-    *    Series 60  ETel API
-    *****************************************************/
+     *    Series 60 Customer / ETel
+     *    Series 60  ETel API
+     *****************************************************/
     /*****************************************************
-    *    Series 60 Customer / TSY
-    *    Needs customer TSY implementation
-    *****************************************************/
+     *    Series 60 Customer / TSY
+     *    Needs customer TSY implementation
+     *****************************************************/
     delete iSecurityHandler;
 
     // Cancel active requests
-    if(iWait->IsActive())
-    {
-        #if defined(_DEBUG)
-	    RDebug::Print(_L("(SECUI)CManualSecuritySettings::~CSecuritySettings() CANCEL REQ"));
-	    #endif
+    if (iWait->IsActive())
+        {
+        RDEBUG("CancelAsyncRequest", 0);
         iPhone.CancelAsyncRequest(iWait->GetRequestType());
-        
-        switch(iWait->GetRequestType())
-            {   //inform query that it has beeen canceled
-                case EMobilePhoneSetLockSetting:
-                case EMobilePhoneSetFdnSetting:
-                    RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, ESecurityUIsQueryRequestCanceled);
-                    break;
-                default:
-                    break;
-            }                            
-        
-    }
+
+        switch (iWait->GetRequestType())
+            { //inform query that it has beeen canceled
+            case EMobilePhoneSetLockSetting:
+            case EMobilePhoneSetFdnSetting:
+                RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, ESecurityUIsQueryRequestCanceled);
+                break;
+            default:
+                break;
+            }
+
+        }
     // close phone
     if (iPhone.SubSessionHandle())
         iPhone.Close();
@@ -191,173 +194,21 @@
 // CSecuritySettings::ChangePinL()
 // Changes PIN1
 // ----------------------------------------------------------
-//
+// qtdone
 EXPORT_C void CSecuritySettings::ChangePinL()
     {
-    /*****************************************************
-    *    Series 60 Customer / ETel
-    *    Series 60  ETel API
-    *****************************************************/
-    
-    TInt simState;
-    TInt err( KErrGeneral );
-    err = RProperty::Get(KPSUidStartup, KPSSimStatus, simState);
-    User::LeaveIfError( err );
-    TBool simRemoved(simState == ESimNotPresent);
-
-    if ( simRemoved )
-        {
-        ShowResultNoteL(R_INSERT_SIM, CAknNoteDialog::EErrorTone);
-        return;
-        }
-
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecuritySettings::ChangePinL()"));
-    #endif    
-    RMobilePhone::TMobilePhoneSecurityCode secCodeType;
-    secCodeType = RMobilePhone::ESecurityCodePin1;
-
-    RMobilePhone::TMobilePassword oldPassword;
-    RMobilePhone::TMobilePassword newPassword;
-    RMobilePhone::TMobilePassword verifcationPassword;
-    RMobilePhone::TMobilePhonePasswordChangeV1 passwords;
-    RMobilePhone::TMobilePhoneSecurityCodeInfoV5 codeInfo;
-    RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg codeInfoPkg(codeInfo);
-
-    CCodeQueryDialog* verdlg = new (ELeave) CCodeQueryDialog (verifcationPassword,SEC_C_PIN_CODE_MIN_LENGTH,SEC_C_PIN_CODE_MAX_LENGTH,ESecUiNone);
-    CleanupStack::PushL(verdlg);
-
-    CCodeQueryDialog* newdlg = new (ELeave) CCodeQueryDialog(newPassword,SEC_C_PIN_CODE_MIN_LENGTH,SEC_C_PIN_CODE_MAX_LENGTH,ESecUiNone);
-    CleanupStack::PushL(newdlg);
-
-    CCodeQueryDialog* dlg = new (ELeave) CCodeQueryDialog (oldPassword,SEC_C_PIN_CODE_MIN_LENGTH,SEC_C_PIN_CODE_MAX_LENGTH,ESecUiNone);       
-    CleanupStack::PushL(dlg);
-
-    RMobilePhone::TMobilePhoneLock lockType;
-    RMobilePhone::TMobilePhoneLockInfoV1 lockInfo;
-    
-    lockType = RMobilePhone::ELockICC;
-
-    RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo);
-    iWait->SetRequestType(EMobilePhoneGetLockInfo);
-    iPhone.GetLockInfo(iWait->iStatus, lockType, lockInfoPkg);
-    TInt res = iWait->WaitForRequestL();
-    User::LeaveIfError(res);
+    RDEBUG("0", 0);
+    RMobilePhone::TMobilePassword iOldPassword;
+    RMobilePhone::TMobilePassword iNewPassword;
+    TInt iFlags = ESecUiTypeLock;
+    iOldPassword.Copy(_L(""));
+    iNewPassword.Copy(_L(""));
 
-    if (lockInfo.iSetting == RMobilePhone::ELockSetDisabled)
-        {    
-        CleanupStack::PopAndDestroy(3,verdlg);
-        ShowResultNoteL(R_PIN_NOT_ALLOWED, CAknNoteDialog::EErrorTone);
-        return;
-        }
-    
-    CleanupStack::Pop(); // dlg
-    iWait->SetRequestType(EMobilePhoneGetSecurityCodeInfo);
-    iPhone.GetSecurityCodeInfo(iWait->iStatus, secCodeType, codeInfoPkg);
-    res = iWait->WaitForRequestL();
-    User::LeaveIfError(res);
-    // ask pin
-    if( codeInfo.iRemainingEntryAttempts >= KMaxNumberOfPINAttempts )
-            res = dlg->ExecuteLD(R_PIN_QUERY);
-    else if(codeInfo.iRemainingEntryAttempts > KLastRemainingInputAttempt)
-       {
-         HBufC* queryPrompt = StringLoader::LoadLC(R_SECUI_REMAINING_PIN_ATTEMPTS, codeInfo.iRemainingEntryAttempts);
-         res = dlg->ExecuteLD(R_PIN_QUERY, *queryPrompt);
-         CleanupStack::PopAndDestroy(queryPrompt);
-       }
-    else
-       {
-         HBufC* queryPrompt = StringLoader::LoadLC(R_SECUI_FINAL_PIN_ATTEMPT);
-         res = dlg->ExecuteLD(R_PIN_QUERY, *queryPrompt);
-         CleanupStack::PopAndDestroy(queryPrompt);   
-       }  
-    
-      if( !res )
-        {
-        CleanupStack::PopAndDestroy(2,verdlg);
-        return;
-        }      
-    CleanupStack::Pop(); // newdlg
-    // new pin code query
-     if (!(newdlg->ExecuteLD(R_NEW_PIN_CODE_QUERY)))
-        {
-        CleanupStack::PopAndDestroy(verdlg);
-        return;
-        }
-
-    CleanupStack::Pop(); // verdlg
-    // verification code query
-    if (!(verdlg->ExecuteLD(R_VERIFY_NEW_PIN_CODE_QUERY)))
-            return;
-        
-    while (newPassword.CompareF(verifcationPassword) != 0) 
-        {
-        // codes do not match -> note -> ask new pin and verification codes again  
-        ShowResultNoteL(R_CODES_DONT_MATCH, CAknNoteDialog::EErrorTone);
-    
-        newPassword = _L("");
-        verifcationPassword = _L("");
-
-        // new pin code query
-        CCodeQueryDialog* newdlg = new (ELeave) CCodeQueryDialog (newPassword,SEC_C_PIN_CODE_MIN_LENGTH,SEC_C_PIN_CODE_MAX_LENGTH,ESecUiNone);
-        if (!(newdlg->ExecuteLD(R_NEW_PIN_CODE_QUERY)))
-              return;
-        
-        // verification code query
-        CCodeQueryDialog* verdlg = new (ELeave) CCodeQueryDialog (verifcationPassword,SEC_C_PIN_CODE_MIN_LENGTH,SEC_C_PIN_CODE_MAX_LENGTH,ESecUiNone);
-        if (!(verdlg->ExecuteLD(R_VERIFY_NEW_PIN_CODE_QUERY)))
-            return;
-        }            
-        
-    // send code
-    passwords.iOldPassword = oldPassword;
-    passwords.iNewPassword = newPassword;
-    iWait->SetRequestType(EMobilePhoneChangeSecurityCode);
-    iPhone.ChangeSecurityCode(iWait->iStatus, secCodeType, passwords);
-    res = iWait->WaitForRequestL();
-    #if defined(_DEBUG)
-    RDebug::Print( _L("(SECUI)CSecuritySettings::ChangePinL(): RETURN CODE: %d"), res);
-    #endif
-    switch(res)
-        {
-        case KErrNone:
-            {
-            // code changed 
-            ShowResultNoteL(R_PIN_CODE_CHANGED_NOTE, CAknNoteDialog::EConfirmationTone);
-            break;
-            }        
-        case KErrGsm0707IncorrectPassword:
-        case KErrAccessDenied:
-            {    
-            // code was entered erroneously
-            ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone);
-            ChangePinL();
-            break;
-            }    
-        case KErrGsmSSPasswordAttemptsViolation:
-        case KErrLocked:
-            {
-            // Pin1 blocked! 
-            return;
-            }
-        case KErrGsm0707OperationNotAllowed:
-            {
-            // not allowed with this sim
-            ShowResultNoteL(R_OPERATION_NOT_ALLOWED, CAknNoteDialog::EErrorTone);
-            return;
-            }
-        case KErrAbort:
-            {
-            break;
-            }
-        default:
-            {
-            ShowErrorNoteL(res);
-            ChangePinL();
-            break;
-            }
-        }
-
+    TBuf<0x80> iCaption;
+    iCaption.Copy(_L("ChangePinL")); // no need to translate. Not used
+    TInt iShowError = 1;
+    TInt err = ChangePinParamsL(iOldPassword, iNewPassword, iFlags, iCaption, iShowError);
+    RDEBUG("err", err);
     }
 
 //
@@ -365,174 +216,21 @@
 // CSecuritySettings::ChangeUPinL()
 // Changes Universal PIN
 // ----------------------------------------------------------
-//
+// qtdone
 EXPORT_C void CSecuritySettings::ChangeUPinL()
     {
-    TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ));
-    TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin ));
-    if(wcdmaSupported || upinSupported)
-      {
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeUPinL()"));
-        #endif
-        TInt simState;
-        TInt err( KErrGeneral );
-        err = RProperty::Get(KPSUidStartup, KPSSimStatus, simState);
-        User::LeaveIfError( err );
-        TBool simRemoved(simState == ESimNotPresent);
-    
-        if ( simRemoved )
-            {
-            ShowResultNoteL(R_INSERT_SIM, CAknNoteDialog::EErrorTone);
-            return;
-            }
-    
-        RMobilePhone::TMobilePhoneSecurityCode secCodeType;
-        secCodeType = RMobilePhone::ESecurityUniversalPin;
-    
-        RMobilePhone::TMobilePassword oldPassword;
-        RMobilePhone::TMobilePassword newPassword;
-        RMobilePhone::TMobilePassword verifcationPassword;
-        RMobilePhone::TMobilePhonePasswordChangeV1 passwords;
-        RMobilePhone::TMobilePhoneSecurityCodeInfoV5 codeInfo;
-        RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg codeInfoPkg(codeInfo);
-    
-        CCodeQueryDialog* verdlg = new (ELeave) CCodeQueryDialog (verifcationPassword,SEC_C_PIN_CODE_MIN_LENGTH,SEC_C_PIN_CODE_MAX_LENGTH,ESecUiNone);
-        CleanupStack::PushL(verdlg);
-    
-        CCodeQueryDialog* newdlg = new (ELeave) CCodeQueryDialog(newPassword,SEC_C_PIN_CODE_MIN_LENGTH,SEC_C_PIN_CODE_MAX_LENGTH,ESecUiNone);
-        CleanupStack::PushL(newdlg);
-    
-        CCodeQueryDialog* dlg = new (ELeave) CCodeQueryDialog (oldPassword,SEC_C_PIN_CODE_MIN_LENGTH,SEC_C_PIN_CODE_MAX_LENGTH,ESecUiNone);       
-        CleanupStack::PushL(dlg);
-    
-        RMobilePhone::TMobilePhoneLock lockType;
-        RMobilePhone::TMobilePhoneLockInfoV1 lockInfo;
-        
-        lockType = RMobilePhone::ELockUniversalPin;
-        
-        RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo);
-        iWait->SetRequestType(EMobilePhoneGetLockInfo);
-        iPhone.GetLockInfo(iWait->iStatus, lockType, lockInfoPkg);
-        TInt res = iWait->WaitForRequestL();
-        User::LeaveIfError(res);
-    
-        if (lockInfo.iSetting == RMobilePhone::ELockSetDisabled)
-            {    
-            CleanupStack::PopAndDestroy(3,verdlg);
-            ShowResultNoteL(R_UPIN_NOT_ALLOWED, CAknNoteDialog::EErrorTone);
-            return;
-            }
-        
-        CleanupStack::Pop(); // dlg
-        // ask pin
-        iWait->SetRequestType(EMobilePhoneGetSecurityCodeInfo);
-        iPhone.GetSecurityCodeInfo(iWait->iStatus, secCodeType, codeInfoPkg);
-        res = iWait->WaitForRequestL();
-        User::LeaveIfError(res);
-            
-        if( codeInfo.iRemainingEntryAttempts >= KMaxNumberOfPINAttempts )
-            res = dlg->ExecuteLD(R_UPIN_QUERY);
-        else if(codeInfo.iRemainingEntryAttempts > KLastRemainingInputAttempt)
-            {
-              HBufC* queryPrompt = StringLoader::LoadLC(R_SECUI_REMAINING_UPIN_ATTEMPTS, codeInfo.iRemainingEntryAttempts);
-              res = dlg->ExecuteLD(R_UPIN_QUERY, *queryPrompt);
-              CleanupStack::PopAndDestroy(queryPrompt);
-            }
-        else
-            {
-              HBufC* queryPrompt = StringLoader::LoadLC(R_SECUI_FINAL_UPIN_ATTEMPT);
-              res = dlg->ExecuteLD(R_UPIN_QUERY, *queryPrompt);
-              CleanupStack::PopAndDestroy(queryPrompt);   
-            }        
-        
-        
-        
-         if( !res )
-            {
-            CleanupStack::PopAndDestroy(2,verdlg);
-            return;
-            }      
-        CleanupStack::Pop(); // newdlg
-        // new pin code query
-         if (!(newdlg->ExecuteLD(R_NEW_UPIN_CODE_QUERY)))
-            {
-            CleanupStack::PopAndDestroy(verdlg);
-            return;
-            }
-    
-        CleanupStack::Pop(); // verdlg
-        // verification code query
-        if (!(verdlg->ExecuteLD(R_VERIFY_NEW_UPIN_CODE_QUERY)))
-                return;
-            
-        while (newPassword.CompareF(verifcationPassword) != 0) 
-            {
-            // codes do not match -> note -> ask new pin and verification codes again  
-            ShowResultNoteL(R_CODES_DONT_MATCH, CAknNoteDialog::EErrorTone);
-        
-            newPassword = _L("");
-            verifcationPassword = _L("");
-    
-            // new pin code query
-            CCodeQueryDialog* newdlg = new (ELeave) CCodeQueryDialog (newPassword,SEC_C_PIN_CODE_MIN_LENGTH,SEC_C_PIN_CODE_MAX_LENGTH,ESecUiNone);
-            if (!(newdlg->ExecuteLD(R_NEW_UPIN_CODE_QUERY)))
-                  return;
-            
-            // verification code query
-            CCodeQueryDialog* verdlg = new (ELeave) CCodeQueryDialog (verifcationPassword,SEC_C_PIN_CODE_MIN_LENGTH,SEC_C_PIN_CODE_MAX_LENGTH,ESecUiNone);
-            if (!(verdlg->ExecuteLD(R_VERIFY_NEW_UPIN_CODE_QUERY)))
-                return;
-            }            
-            
-        // send code
-        passwords.iOldPassword = oldPassword;
-        passwords.iNewPassword = newPassword;
-        iWait->SetRequestType(EMobilePhoneChangeSecurityCode);
-        iPhone.ChangeSecurityCode(iWait->iStatus, secCodeType, passwords);
-        res = iWait->WaitForRequestL();
-        #if defined(_DEBUG)
-        RDebug::Print( _L("(SECUI)CSecuritySettings::ChangePinL(): RETURN CODE: %d"), res);
-        #endif
-        switch(res)
-            {
-            case KErrNone:
-                {
-                // code changed 
-                ShowResultNoteL(R_UPIN_CODE_CHANGED_NOTE, CAknNoteDialog::EConfirmationTone);
-                break;
-                }        
-            case KErrGsm0707IncorrectPassword:
-            case KErrAccessDenied:
-                {    
-                // code was entered erroneously
-                ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone);
-                ChangeUPinL();
-                break;
-                }    
-            case KErrGsmSSPasswordAttemptsViolation:
-            case KErrLocked:
-                {
-                return;
-                }
-            case KErrGsm0707OperationNotAllowed:
-                {
-                // not allowed with this sim
-                ShowResultNoteL(R_OPERATION_NOT_ALLOWED, CAknNoteDialog::EErrorTone);
-                return;
-                }
-            case KErrAbort:
-                {
-                break;
-                }
-            default:
-                {
-                ShowErrorNoteL(res);
-                ChangeUPinL();
-                break;
-                }
-            }
-      }
+    RDEBUG("0", 0);
+    RMobilePhone::TMobilePassword iOldPassword;
+    RMobilePhone::TMobilePassword iNewPassword;
+    TInt iFlags = ESecUiTypeLock;
+    iOldPassword.Copy(_L(""));
+    iNewPassword.Copy(_L(""));
+
+    TBuf<0x80> iCaption;
+    iCaption.Copy(_L("ChangeUPinL")); // no need to translate. Not used
+    TInt iShowError = 1;
+    TInt err = ChangeUPinParamsL(iOldPassword, iNewPassword, iFlags, iCaption, iShowError);
+    RDEBUG("err", err);
 
     }
 
@@ -541,48 +239,873 @@
 // CSecuritySettings::ChangePin2L()
 // Changes PIN2
 // ----------------------------------------------------------
+// qtdone
+EXPORT_C void CSecuritySettings::ChangePin2L()
+    {
+    RDEBUG("0", 0);
+    RMobilePhone::TMobilePassword iOldPassword;
+    RMobilePhone::TMobilePassword iNewPassword;
+    TInt iFlags = ESecUiTypeLock;
+    iOldPassword.Copy(_L(""));
+    iNewPassword.Copy(_L(""));
+
+    TBuf<0x80> iCaption;
+    iCaption.Copy(_L("ChangePin2L")); // no need to translate. Not used
+    TInt iShowError = 1;
+    TInt err = ChangePin2ParamsL(iOldPassword, iNewPassword, iFlags, iCaption, iShowError);
+    RDEBUG("err", err);
+    }
 //
-EXPORT_C void CSecuritySettings::ChangePin2L()
+// ----------------------------------------------------------
+// CSecuritySettings::ChangeSecCodeL()
+// Changes security code 
+// ----------------------------------------------------------
+// qtdone
+EXPORT_C void CSecuritySettings::ChangeSecCodeL()
+    {
+    RDEBUG("0", 0);
+    RMobilePhone::TMobilePassword iOldPassword;
+    RMobilePhone::TMobilePassword iNewPassword;
+    TInt iFlags = 0;
+    iOldPassword.Copy(_L(""));
+    iNewPassword.Copy(_L(""));
+
+    TBuf<0x80> iCaption;
+    iCaption.Copy(_L("ChangeSecCodeL")); // no need to translate. Not used
+    TInt iShowError = 1;
+    TInt err = ChangeSecCodeParamsL(iOldPassword, iNewPassword, iFlags, iCaption, iShowError);
+    RDEBUG("err", err);
+    }
+//
+// ----------------------------------------------------------
+// CSecuritySettings::ChangeAutoLockPeriodL()
+// Changes autolock period
+// ----------------------------------------------------------
+// qtdone
+EXPORT_C TInt CSecuritySettings::ChangeAutoLockPeriodL(TInt aPeriod)
+    {
+    TInt ret = 0;
+    RDEBUG("aPeriod", aPeriod);
+    RMobilePhone::TMobilePassword iOldPassword;
+    TInt iFlags = 0;
+    TInt iShowError = 1;
+    TBuf<0x80> iCaption;
+    iCaption.Copy(_L("ChangeAutoLockPeriodL")); // no need to translate. Not used
+    iOldPassword.Copy(_L(""));
+    ret = ChangeAutoLockPeriodParamsL(aPeriod, iOldPassword, iFlags, iCaption, iShowError);
+    RDEBUG("ret", ret);
+    return ret;
+    }
+
+//
+// ----------------------------------------------------------
+// CSecuritySettings::ChangeRemoteLockStatusL()
+// Changes remote lock status (on/off)
+// ----------------------------------------------------------
+// no qtdone
+EXPORT_C TInt CSecuritySettings::ChangeRemoteLockStatusL(TBool& aRemoteLockStatus, TDes& aRemoteLockCode, TInt aAutoLockPeriod)
+    {
+    TInt retValue(KErrNone);
+    RDEBUG("aRemoteLockStatus", aRemoteLockStatus);
+    RDEBUG("aAutoLockPeriod", aAutoLockPeriod);
+
+    if (aRemoteLockStatus)
+        {
+        aRemoteLockStatus = ETrue;
+
+        // If user wishes to enable remote lock
+        // a new remote lock code is required.
+        // RemoteLockCodeQueryL also 
+        retValue = RemoteLockCodeQueryL(aRemoteLockCode);
+        }
+    else
+        {
+        aRemoteLockStatus = EFalse;
+        retValue = KErrNone;
+        // TODO this should calculate aAutoLockPeriod itself, and not trust the input
+
+        // Check whether AutoLock is enabled (timeout value greater 
+        // than zero) or not. If AutoLock is enabled the domestic OS 
+        // device lock should be left enabled.
+        if (aAutoLockPeriod == 0)
+            {
+            // Disable lock setting from domestic OS
+            retValue = RemoteLockSetLockSettingL(EFalse);
+            }
+        else
+            {
+            // If AutoLock is enabled, don't disable the DOS device lock
+            // Re-set (enable) the domestic OS device lock because as a 
+            // side effect it requires the security code from the user
+            retValue = RemoteLockSetLockSettingL(ETrue);
+            }
+        }
+    RDEBUG( "retValue", retValue );
+    return retValue;
+    }
+//
+// ----------------------------------------------------------
+// CSecuritySettings::RemoteLockCodeQueryL()
+// Pops up remote lock code query. Requires user to enter a new remote lock 
+// code (RemoteMsg) twice and if they match enables the domestic OS device lock (which as 
+// a side effect pops up security code query).
+// Note: if the RemoteMsg is cancelled, nevertheless the lock is activated. This is done because the code is askedirst, and the only way to do so is by enabling the lock.
+// This is not a problem, because:
+// a) first the RemoteMsg is enable, and this function is used to change it
+// b) if lock was disabled, the "change RemoteMsg" menu is not available.
+// ----------------------------------------------------------
+// qtdone
+TInt CSecuritySettings::RemoteLockCodeQueryL(TDes& aRemoteLockCode)
+    {
+
+    TInt retValue(KErrNone);
+
+    // This is done because lock-code needs to be asked first.
+    // Enable lock setting in domestic OS. It is safe to enable the 
+    // lock setting since RemoteLock API requires remote locking to
+    // be enabled when changing or setting the remote lock message.
+    retValue = RemoteLockSetLockSettingL(ETrue);
+    RDEBUG( "retValue", retValue );
+    if (retValue != KErrNone)
+        return retValue;
+    aRemoteLockCode.Zero();
+
+    TInt queryAccepted = KErrCancel;
+    queryAccepted = KErrCancel;
+    CSecQueryUi * iSecQueryUi;
+    iSecQueryUi = CSecQueryUi::NewL();
+    // this queries both, and verifies itself
+    TBuf<0x100> title;
+    title.Zero();
+    HBufC* stringHolder = HbTextResolverSymbian::LoadLC(_L("txt_pin_code_dialog_new_rem_code"));
+    title.Append(stringHolder->Des());
+    CleanupStack::PopAndDestroy(stringHolder);
+    title.Append(_L("|"));
+    HBufC* stringHolder2 = HbTextResolverSymbian::LoadLC(_L("Verify"));
+    title.Append(stringHolder2->Des());
+    CleanupStack::PopAndDestroy(stringHolder2);
+    queryAccepted = iSecQueryUi->SecQueryDialog(title, aRemoteLockCode, SEC_REMOTELOCK_CODE_MIN_LENGTH, SEC_REMOTELOCK_CODE_MAX_LENGTH, ESecUiAlphaSupported
+            | ESecUiCancelSupported | ESecUiEmergencyNotSupported | ESecUiNone);
+    RDEBUG("aRemoteLockCode", 0);
+    RDEBUGSTR(aRemoteLockCode);
+    RDEBUG("queryAccepted", queryAccepted);
+    delete iSecQueryUi;
+    if (queryAccepted != KErrNone)
+        return KErrAbort;
+
+    // Check that the new remote lock code doesn't match the security code of the device.
+    RMobilePhone::TMobilePhoneSecurityCode secCodeType = RMobilePhone::ESecurityCodePhonePassword;
+    RMobilePhone::TMobilePassword securityCode;
+    RMobilePhone::TMobilePassword unblockCode; // Required here only as a dummy parameter 
+
+
+    securityCode = aRemoteLockCode;
+    RDEBUG( "EMobilePhoneVerifySecurityCode", EMobilePhoneVerifySecurityCode );
+    iWait->SetRequestType(EMobilePhoneVerifySecurityCode);
+    RDEBUG( "VerifySecurityCode", 0 );
+    iPhone.VerifySecurityCode(iWait->iStatus, secCodeType, securityCode, unblockCode);
+    RDEBUG( "WaitForRequestL", 0 );
+    TInt res = iWait->WaitForRequestL();
+    RDEBUG( "WaitForRequestL res", res );
+#ifdef __WINS__
+    if (res == KErrNotSupported || res == KErrTimedOut)
+        res = KErrGsm0707IncorrectPassword; // KErrGsm0707IncorrectPassword = incorrect code
+#endif
+    RDEBUG( "KErrGsm0707IncorrectPassword", KErrGsm0707IncorrectPassword );
+    if (res == KErrNone)
+        {
+        // The message is also valid as a lock-code, this means that
+        // remote lock code matches the security code 
+        // and that is not allowed
+        RDEBUG( "return KErrCancel because msg matches code", KErrCancel );
+        ShowResultNoteL(R_REMOTELOCK_INVALID_CODE, CAknNoteDialog::EErrorTone);
+        return KErrCancel;
+        }
+
+    RDEBUG( "retValue", retValue );
+    return retValue;
+    }
+//
+// ----------------------------------------------------------
+// CSecuritySettings::RemoteLockSetLockSettingL()
+// Changes lock setting in domestic OS. Changing the domestic OS lock setting
+// requires user to enter the security code.
+// ----------------------------------------------------------
+// qtdone
+TInt CSecuritySettings::RemoteLockSetLockSettingL(TBool aLockSetting)
+    {
+    TInt retValue(KErrNone);
+    RDEBUG( "aLockSetting", aLockSetting );
+
+    RMobilePhone::TMobilePhoneLockSetting lockSetting = RMobilePhone::ELockSetEnabled;
+    RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockPhoneDevice;
+
+    RMobilePhone::TMobilePhoneLockInfoV1 lockInfo;
+    RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo);
+
+    //get lock info
+    iWait->SetRequestType(EMobilePhoneGetLockInfo);
+    RDEBUG("GetLockInfo", 0);
+    iPhone.GetLockInfo(iWait->iStatus, lockType, lockInfoPkg);
+    RDEBUG("WaitForRequestL", 0);
+    TInt status = iWait->WaitForRequestL();
+    RDEBUG("WaitForRequestL status", status);
+
+#ifdef __WINS__
+    if (status == KErrNotSupported || status == KErrTimedOut)
+        {
+        lockInfo.iSetting = RMobilePhone::ELockSetDisabled;
+        status = KErrNone;
+        }
+#endif
+    User::LeaveIfError(status);
+    RDEBUG("current lockInfo.iSetting", lockInfo.iSetting);
+
+    // disabled->disabled   should not happen
+    // enabled->enabled     happens because a change of message also forces a code re-validation
+    if (aLockSetting)
+        {
+        lockSetting = RMobilePhone::ELockSetEnabled;
+        }
+    else
+        {
+        lockSetting = RMobilePhone::ELockSetDisabled;
+        }
+    RDEBUG("future lockSetting", lockSetting);
+
+    iWait->SetRequestType(EMobilePhoneSetLockSetting);
+    RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, ESecurityUIsQueryRequestOk);
+    RDEBUG( "SetLockSetting", 0 );
+    iPhone.SetLockSetting(iWait->iStatus, lockType, lockSetting); // this will PassPhraseRequiredL
+    RDEBUG( "WaitForRequestL", 0 );
+    retValue = iWait->WaitForRequestL();
+    RDEBUG( "WaitForRequestL retValue", retValue );
+#ifdef __WINS__
+    if (retValue == KErrNotSupported || retValue == KErrTimedOut)
+        retValue = KErrNone;
+#endif
+
+    switch (retValue)
+        {
+        case KErrNone:
+            break;
+
+        case KErrGsmSSPasswordAttemptsViolation:
+        case KErrLocked:
+        case KErrGsm0707IncorrectPassword:
+        case KErrAccessDenied:
+            // Security code was entered erroneously
+            //Error note is shown in CSecurityHandler::PassPhraseRequired()
+            break;
+
+        case KErrAbort:
+            break;
+
+        default:
+            break;
+        }
+
+    RDEBUG( "retValue", retValue );
+    return retValue;
+    }
+
+//
+// ----------------------------------------------------------
+// CSecuritySettings::ChangeSimSecurityL()
+// Changes SIM security
+// ----------------------------------------------------------
+// qtdone
+EXPORT_C TBool CSecuritySettings::ChangeSimSecurityL()
     {
     /*****************************************************
-    *    Series 60 Customer / ETel
-    *    Series 60  ETel API
-    *****************************************************/
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecuritySettings::ChangePin2L()"));
-    #endif
-    TInt simState;
-    TInt err( KErrGeneral );
-    err = RProperty::Get(KPSUidStartup, KPSSimStatus, simState);
-    User::LeaveIfError( err );
-    TBool simRemoved(simState == ESimNotPresent);
+     *    Series 60 Customer / ETel
+     *    Series 60  ETel API
+     *****************************************************/
+    RDEBUG("0", 0);
+    RMobilePhone::TMobilePhoneLockInfoV1 lockInfo;
+    RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo);
+    RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockPhoneToICC;
+    RMobilePhone::TMobilePhoneLockSetting lockChangeSetting;
+
+    //get lock info
+    iWait->SetRequestType(EMobilePhoneGetLockInfo);
+    RDEBUG("GetLockInfo", 0);
+    iPhone.GetLockInfo(iWait->iStatus, lockType, lockInfoPkg);
+    RDEBUG("WaitForRequestL", 0);
+    TInt status = iWait->WaitForRequestL();
+    RDEBUG("WaitForRequestL status", status);
+
+#ifdef __WINS__
+    if (status == KErrNotSupported || status == KErrTimedOut)
+        {
+        lockInfo.iSetting = RMobilePhone::ELockSetDisabled;
+        status = KErrNone;
+        }
+#endif
+    User::LeaveIfError(status);
+    TInt currentItem = 0;
+    RDEBUG("lockInfo.iSetting", lockInfo.iSetting);
+    if (lockInfo.iSetting == RMobilePhone::ELockSetDisabled)
+        {
+        currentItem = 1; // off
+        }
 
-    if ( simRemoved )
+    if (currentItem == 0) // switch the flag
+        {
+        lockChangeSetting = RMobilePhone::ELockSetDisabled;
+        }
+    else
         {
-        ShowResultNoteL(R_INSERT_SIM, CAknNoteDialog::EErrorTone);
-        return;
+        lockChangeSetting = RMobilePhone::ELockSetEnabled;
+        }
+    RDEBUG("lockChangeSetting", lockChangeSetting);
+
+    iWait->SetRequestType(EMobilePhoneSetLockSetting);
+    RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, ESecurityUIsQueryRequestOk);
+    RDEBUG("SetLockSetting", 0);
+    iPhone.SetLockSetting(iWait->iStatus, lockType, lockChangeSetting); // this invokes the handler
+    RDEBUG("WaitForRequestL", 0);
+    status = iWait->WaitForRequestL();
+    RDEBUG("WaitForRequestL status", status);
+#ifdef __WINS__
+    if (status == KErrNotSupported || status == KErrTimedOut)
+        status = KErrNone;
+#endif
+
+    // the error was displayed in the handler
+    RDEBUG("status", status);
+    switch (status)
+        {
+        case KErrNone:
+            {
+            break;
+            }
+        case KErrGsm0707IncorrectPassword:
+        case KErrAccessDenied:
+            {
+            // code was entered erroneously
+            return ChangeSimSecurityL();
+            }
+        case KErrGsmSSPasswordAttemptsViolation:
+        case KErrLocked:
+            {
+            return ChangeSimSecurityL();
+            }
+        case KErrAbort:
+            {
+            return EFalse;
+            }
+        default:
+            {
+            ShowErrorNoteL(status);
+            return ChangeSimSecurityL();
+            }
         }
 
-    RMmCustomAPI::TSecurityCodeType secCodeType;
-    RMobilePhone::TMobilePhoneSecurityCode EtelsecCodeType;
-    secCodeType = RMmCustomAPI::ESecurityCodePin2;
-    RMobilePhone::TMobilePassword oldPassword;
-    RMobilePhone::TMobilePassword newPassword;
-    RMobilePhone::TMobilePassword verifcationPassword;
-    RMobilePhone::TMobilePhonePasswordChangeV1 passwords;
+    return ETrue;
+    }
+//
+// ----------------------------------------------------------
+// CSecuritySettings::ChangePinRequestL()
+// Changes PIN1 request
+// ----------------------------------------------------------
+// qtdone
+EXPORT_C TBool CSecuritySettings::ChangePinRequestL()
+    {
+    RDEBUG("0", 0);
+
+    RMobilePhone::TMobilePassword iOldPassword;
+    TInt iFlags = 0;
+    iOldPassword.Copy(_L(""));
+
+    TBuf<0x80> iCaption;
+    iCaption.Copy(_L("ChangePinRequestL")); // no need to translate. Not used
+    TInt iShowError = 1;
+    TInt err = ChangePinRequestParamsL(1/* it's imposible to know if we want to set or clear*/, iOldPassword, iFlags, iCaption, iShowError);
+    RDEBUG("err", err);
+    if (err == KErrNone)
+        return ETrue;
+    else
+        return EFalse;
+    }
+
+//
+// ----------------------------------------------------------
+// CSecuritySettings::ChangeUPinRequestL()
+// Changes UPIN request on/off
+// ----------------------------------------------------------
+// qtdone
+EXPORT_C TBool CSecuritySettings::ChangeUPinRequestL()
+    {
+    TBool wcdmaSupported(FeatureManager::FeatureSupported(KFeatureIdProtocolWcdma));
+    TBool upinSupported(FeatureManager::FeatureSupported(KFeatureIdUpin));
+    RDEBUG("wcdmaSupported", wcdmaSupported);
+    RDEBUG("upinSupported", upinSupported);
+    if (wcdmaSupported || upinSupported)
+        {
+        TInt simState;
+        TInt err(KErrGeneral);
+        err = RProperty::Get(KPSUidStartup, KPSSimStatus, simState);
+        User::LeaveIfError(err);
+        TBool simRemoved(simState == ESimNotPresent);
+
+        if (simRemoved)
+            {
+            ShowResultNoteL(R_INSERT_SIM, CAknNoteDialog::EErrorTone);
+            return EFalse;
+            }
+
+        RMobilePhone::TMobilePhoneLockInfoV1 lockInfo;
+        RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo);
+        RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockUniversalPin;
+
+        RMobilePhone::TMobilePhoneLockSetting lockChangeSetting = RMobilePhone::ELockSetDisabled;
+
+        //get lock info
+        iWait->SetRequestType(EMobilePhoneGetLockInfo);
+        RDEBUG("GetLockInfo", 0);
+        iPhone.GetLockInfo(iWait->iStatus, lockType, lockInfoPkg);
+        RDEBUG("WaitForRequestL", 0);
+        TInt status = iWait->WaitForRequestL();
+        RDEBUG("WaitForRequestL status", status);
+#ifdef __WINS__
+        if (status == KErrNotSupported || status == KErrTimedOut)
+            status = KErrNone;
+#endif
+        User::LeaveIfError(status);
+        TInt currentItem = 0;
+
+        RDEBUG("lockInfo.iSetting", lockInfo.iSetting);
+        if (lockInfo.iSetting == RMobilePhone::ELockSetDisabled)
+            {
+            currentItem = 1; // off
+            }
+
+        if (currentItem == 0) // switch the flag
+            {
+            lockChangeSetting = RMobilePhone::ELockSetDisabled;
+            }
+        else
+            {
+            lockChangeSetting = RMobilePhone::ELockSetEnabled;
+            }
+        RDEBUG("lockChangeSetting", lockChangeSetting);
+        // Raise a flag to indicate that the UPIN
+        // request coming from ETEL has originated from SecUi and not from Engine.
+        RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsSecUIOriginated);
+        // Change the lock setting
+        iWait->SetRequestType(EMobilePhoneSetLockSetting);
+        RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, ESecurityUIsQueryRequestOk);
+        RDEBUG("SetLockSetting", 0);
+        iPhone.SetLockSetting(iWait->iStatus, lockType, lockChangeSetting); // this calls something in the handler
+        RDEBUG("WaitForRequestL", 0);
+        status = iWait->WaitForRequestL();
+        RDEBUG("WaitForRequestL status", status);
+        // Lower the flag                           
+        RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsSecUIOriginatedUninitialized);
+#ifdef __WINS__
+        if (status == KErrNotSupported || status == KErrTimedOut)
+            status = KErrNone;
+#endif
+
+        // no need to show errors because they were displayed in the Handler
+        switch (status)
+            {
+            case KErrNone:
+                {
+                break;
+                }
+            case KErrGsm0707OperationNotAllowed:
+                {
+                // not allowed with this sim
+                ShowResultNoteL(R_OPERATION_NOT_ALLOWED, CAknNoteDialog::EErrorTone);
+                return EFalse;
+                }
+            case KErrGsm0707IncorrectPassword:
+            case KErrAccessDenied:
+                {
+                // code was entered erroneously
+                return ChangeUPinRequestL();
+                }
+            case KErrGsmSSPasswordAttemptsViolation:
+            case KErrLocked:
+                {
+                return EFalse;
+                }
+            case KErrAbort:
+                {
+                return EFalse;
+                }
+            default:
+                {
+                ShowErrorNoteL(status);
+                return ChangeUPinRequestL();
+                }
+            }
+
+        return ETrue;
+        }
+    else
+        return EFalse;
+
+    }
+
+//
+// ----------------------------------------------------------
+// CSecuritySettings::SwitchPinCodesL()
+// Changes the pin code currently in use (PIN/UPIN)
+// ----------------------------------------------------------
+// qtdone
+EXPORT_C TBool CSecuritySettings::SwitchPinCodesL()
+    {
+    TBool wcdmaSupported(FeatureManager::FeatureSupported(KFeatureIdProtocolWcdma));
+    TBool upinSupported(FeatureManager::FeatureSupported(KFeatureIdUpin));
+    RDEBUG("wcdmaSupported", wcdmaSupported);
+    RDEBUG("upinSupported", upinSupported);
+    if (wcdmaSupported || upinSupported)
+        {
+        // If we are in simless offline mode the PIN codes can't obviously be switched
+        TInt simState;
+        TInt err(KErrGeneral);
+        err = RProperty::Get(KPSUidStartup, KPSSimStatus, simState);
+        User::LeaveIfError(err);
+        TBool simRemoved(simState == ESimNotPresent);
+
+        if (simRemoved)
+            {
+            ShowResultNoteL(R_INSERT_SIM, CAknNoteDialog::EErrorTone);
+            return EFalse;
+            }
+
+        RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockUniversalPin;
+        RMobilePhone::TMobilePhoneLockSetting lockChangeSetting = RMobilePhone::ELockReplaced;
+        RMobilePhone::TMobilePhoneSecurityCode activeCode;
+
+        iCustomPhone.GetActivePin(activeCode);
+
+        RMobilePhone::TMobilePhoneLockInfoV1 lockInfo;
+        RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo);
+        RDEBUG("EMobilePhoneGetLockInfo", EMobilePhoneGetLockInfo);
+        iWait->SetRequestType(EMobilePhoneGetLockInfo);
+
+        if (activeCode == RMobilePhone::ESecurityUniversalPin)
+            {
+            lockType = RMobilePhone::ELockUniversalPin;
+            iPhone.GetLockInfo(iWait->iStatus, lockType, lockInfoPkg);
+            RDEBUG("WaitForRequestL", 0);
+            TInt res = iWait->WaitForRequestL();
+            RDEBUG("WaitForRequestL res", res);
+#ifdef __WINS__
+            if (res == KErrNotSupported || res == KErrTimedOut)
+                res = KErrNone;
+#endif
+            User::LeaveIfError(res);
+            }
+        else
+            {
+            lockType = RMobilePhone::ELockICC;
+            iPhone.GetLockInfo(iWait->iStatus, lockType, lockInfoPkg);
+            RDEBUG("WaitForRequestL", 0);
+            TInt res = iWait->WaitForRequestL();
+            RDEBUG("WaitForRequestL res", res);
+#ifdef __WINS__
+            if (res == KErrNotSupported || res == KErrTimedOut)
+                res = KErrNone;
+#endif
+            User::LeaveIfError(res);
+            }
+
+        // code request must be ON to change active code.
+        RDEBUG("lockInfo.iSetting", lockInfo.iSetting);
+        if (lockInfo.iSetting == RMobilePhone::ELockSetDisabled)
+            {
+
+            if (activeCode != RMobilePhone::ESecurityUniversalPin)
+                {
+                ShowResultNoteL(R_UPIN_NOT_ALLOWED, CAknNoteDialog::EErrorTone);
+                }
+            else
+                {
+                ShowResultNoteL(R_PIN_NOT_ALLOWED, CAknNoteDialog::EErrorTone);
+                }
+            return EFalse;
+            }
+
+        iCustomPhone.GetActivePin(activeCode);
+        TInt currentItem = 0;
+
+        RDEBUG("activeCode", activeCode);
+        if (activeCode == RMobilePhone::ESecurityUniversalPin)
+            {
+            currentItem = 1; // UPIN
+            }
+        if (currentItem == 0) // switch the flag
+            {
+            lockType = RMobilePhone::ELockUniversalPin;
+            }
+        else
+            {
+            lockType = RMobilePhone::ELockICC;
+            }
+        RDEBUG("lockType", lockType);
+
+        // Raise a flag to indicate that the code
+        // request coming from ETEL has originated from SecUi and not from Engine.
+        RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsSecUIOriginated);
+        // Change the lock setting
+        iWait->SetRequestType(EMobilePhoneSetLockSetting);
+        RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, ESecurityUIsQueryRequestOk);
+        RDEBUG("SetLockSetting", 0);
+        iPhone.SetLockSetting(iWait->iStatus, lockType, lockChangeSetting); // request from handler
+        RDEBUG("WaitForRequestL", 0);
+        TInt status = iWait->WaitForRequestL();
+        RDEBUG("WaitForRequestL status", status);
+        // Lower the flag                            
+        RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsSecUIOriginatedUninitialized);
+#ifdef __WINS__
+        if (status == KErrNotSupported || status == KErrTimedOut)
+            status = KErrNone;
+#endif
+
+        // errors are shown in the handler
+        switch (status)
+            {
+            case KErrNone:
+                {
+                break;
+                }
+            case KErrGsm0707OperationNotAllowed:
+                {
+                // not allowed with this sim
+                ShowResultNoteL(R_OPERATION_NOT_ALLOWED, CAknNoteDialog::EErrorTone);
+                return EFalse;
+                }
+            case KErrGsm0707IncorrectPassword:
+            case KErrAccessDenied:
+                {
+                // code was entered erroneously
+                return SwitchPinCodesL();
+                }
+            case KErrGsmSSPasswordAttemptsViolation:
+            case KErrLocked:
+                {
+                return EFalse;
+                }
+            case KErrAbort:
+                {
+                return EFalse;
+                }
+            default:
+                {
+                ShowErrorNoteL(status);
+                return SwitchPinCodesL();
+                }
+            }
+
+        return ETrue;
+        }
+    else
+        return EFalse;
+    }
+
+//
+// ----------------------------------------------------------
+// CSecuritySettings::IsLockEnabledL()
+// Return is lock enabled/disabled
+// ----------------------------------------------------------
+// qtdone
+EXPORT_C TBool CSecuritySettings::IsLockEnabledL(RMobilePhone::TMobilePhoneLock aLockType)
+    {
+    TBool ret = EFalse;
+    RMobilePhone::TMobilePhoneLockInfoV1 lockInfo;
+    //get lock info
+    RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo);
+    iWait->SetRequestType(EMobilePhoneGetLockInfo);
+    RDEBUG("GetLockInfo", 0);
+    iPhone.GetLockInfo(iWait->iStatus, aLockType, lockInfoPkg);
+    RDEBUG("WaitForRequestL", 0);
+    TInt res = iWait->WaitForRequestL();
+    RDEBUG("WaitForRequestL res", res);
+
+    if (res != KErrNone)
+        ret = ETrue;
+    //lock is enabled return true
+    else if (lockInfo.iSetting == RMobilePhone::ELockSetEnabled)
+        {
+        ret = ETrue;
+        }
+    RDEBUG("ret", ret);
+    return ret;
+    }
+//
+// ----------------------------------------------------------
+// CSecuritySettings::AskSecCodeL()
+// For asking security code e.g in settings
+// ----------------------------------------------------------
+// qtdone
+EXPORT_C TBool CSecuritySettings::AskSecCodeL()
+    {
+    return iSecurityHandler->AskSecCodeL();
+    }
+//
+// ----------------------------------------------------------
+// CSecuritySettings::AskPin2L()
+// Asks PIN2
+// ----------------------------------------------------------
+// qtdone
+EXPORT_C TBool CSecuritySettings::AskPin2L()
+    {
+    /*****************************************************
+     *    Series 60 Customer / ETel
+     *    Series 60  ETel API
+     *****************************************************/
+    RDEBUG("0", 0);
+    TInt retPhone = 0;
+    // check if pin2 is blocked...
+    RMmCustomAPI::TSecurityCodeType secCodeType = RMmCustomAPI::ESecurityCodePin2;
+    RMobilePhone::TMobilePhoneSecurityCode etelsecCodeType(RMobilePhone::ESecurityCodePin2);
     RMobilePhone::TMobilePhoneSecurityCodeInfoV5 codeInfo;
     RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg codeInfoPkg(codeInfo);
-    
-    // check if pin2 is blocked...
+    RMobilePhone::TMobilePassword password;
     TBool isBlocked = EFalse;
+    TInt queryAccepted = KErrCancel;
+    //Check whether PIN2 is blocked
+    retPhone = iCustomPhone.IsBlocked(secCodeType, isBlocked);
+
+    RDEBUG("retPhone", retPhone);
+    RDEBUG("isBlocked", isBlocked);
+#ifdef __WINS__
+    if (retPhone == KErrNotSupported || retPhone == KErrTimedOut)
+        retPhone = KErrNone;
+#endif
+    if (isBlocked)
+        return EFalse;
+
+    if (retPhone != KErrNone)
+        {
+        switch (retPhone)
+            {
+            // PIN2 Blocked.
+            case KErrGsm0707SIMPuk2Required:
+                break;
+            case KErrGsmSSPasswordAttemptsViolation:
+            case KErrLocked:
+                // Pin2 features blocked permanently!
+                ShowResultNoteL(R_PIN2_REJECTED, CAknNoteDialog::EConfirmationTone);
+                break;
+            case KErrGsm0707SimNotInserted:
+                // not allowed with this sim
+                ShowResultNoteL(R_OPERATION_NOT_ALLOWED, CAknNoteDialog::EErrorTone);
+                break;
+            default:
+                ShowErrorNoteL(retPhone);
+                break;
+            }
+        return EFalse;
+        }
+    iWait->SetRequestType(EMobilePhoneGetSecurityCodeInfo);
+    RDEBUG("GetSecurityCodeInfo", 0);
+    iPhone.GetSecurityCodeInfo(iWait->iStatus, etelsecCodeType, codeInfoPkg);
+    RDEBUG("WaitForRequestL", 0);
+    retPhone = iWait->WaitForRequestL();
+    RDEBUG("WaitForRequestL retPhone", retPhone);
+#ifdef __WINS__
+    if (retPhone == KErrNotSupported || retPhone == KErrTimedOut)
+        {
+        retPhone = KErrNone;
+        codeInfo.iRemainingEntryAttempts = 3;
+        }
+#endif
+    User::LeaveIfError(retPhone);
+
+    RDEBUG("codeInfo.iRemainingEntryAttempts",
+            codeInfo.iRemainingEntryAttempts);
+    if (codeInfo.iRemainingEntryAttempts == KMaxNumberOfPINAttempts)
+        codeInfo.iRemainingEntryAttempts = -1;
 
-    TInt ret = iCustomPhone.IsBlocked(secCodeType,isBlocked);
-    
-    if(isBlocked)
+    // ask pin2 code  
+    /* request PIN using QT */
+    queryAccepted = KErrCancel;
+    CSecQueryUi *iSecQueryUi;
+    iSecQueryUi = CSecQueryUi::NewL();
+    TBuf<0x100> title;
+    title.Zero();
+    HBufC* stringHolder = HbTextResolverSymbian::LoadLC(_L("txt_pin_code_dialog_pin2_code"));
+    title.Append(stringHolder->Des());
+    CleanupStack::PopAndDestroy(stringHolder);
+    title.Append(_L("$"));
+    title.AppendNum(codeInfo.iRemainingEntryAttempts);
+    queryAccepted = iSecQueryUi->SecQueryDialog(title, password, SEC_C_PIN_CODE_MIN_LENGTH, SEC_C_PIN_CODE_MAX_LENGTH, ESecUiAlphaNotSupported | ESecUiCancelSupported
+            | ESecUiEmergencyNotSupported | secCodeType);
+    RDEBUG("password", 0);
+    RDEBUGSTR(password);
+    RDEBUG("queryAccepted", queryAccepted);
+    delete iSecQueryUi;
+    if (queryAccepted != KErrNone)
+        return EFalse;
+
+    // verify code
+    RMobilePhone::TMobilePassword required_fourth;
+    iWait->SetRequestType(EMobilePhoneVerifySecurityCode);
+    RDEBUG("VerifySecurityCode", 0);
+    iPhone.VerifySecurityCode(iWait->iStatus, etelsecCodeType, password, required_fourth);
+    RDEBUG("WaitForRequestL", 0);
+    retPhone = iWait->WaitForRequestL();
+    RDEBUG("WaitForRequestL retPhone", retPhone);
+#ifdef __WINS__
+    if (retPhone == KErrNotSupported)
+        retPhone = KErrNone;
+#endif
+
+    switch (retPhone)
+        {
+        case KErrNone:
+            break;
+        case KErrGsm0707IncorrectPassword:
+        case KErrAccessDenied:
+            // code was entered erroneously
+            ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone);
+            return AskPin2L();
+        case KErrGsm0707OperationNotAllowed:
+            // not allowed with this sim
+            ShowResultNoteL(R_OPERATION_NOT_ALLOWED, CAknNoteDialog::EErrorTone);
+            return EFalse;
+        case KErrGsmSSPasswordAttemptsViolation:
+        case KErrLocked:
+            // code was blocked
+            ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone);
+            return EFalse;
+        default:
+            ShowErrorNoteL(retPhone);
+            return AskPin2L();
+        }
+
+    return ETrue;
+    }
+//
+// ----------------------------------------------------------
+// CSecuritySettings::SetFdnModeL()
+// Activates or deactivates Fixed Dialling Numbers (FDN) mode.  
+// ----------------------------------------------------------
+// not qtdone
+EXPORT_C void CSecuritySettings::SetFdnModeL()
+    {
+    /*****************************************************
+     *    Series 60 Customer / ETel
+     *    Series 60  ETel API
+     *****************************************************/
+    RDEBUG("0", 0);
+    RMmCustomAPI::TSecurityCodeType secCodeType = RMmCustomAPI::ESecurityCodePin2;
+
+    TBool isBlocked = EFalse;
+    TInt ret = iCustomPhone.IsBlocked(secCodeType, isBlocked);
+    RDEBUG("isBlocked", isBlocked);
+    RDEBUG("ret", ret);
+    if (isBlocked)
         return;
-    
+
     if (ret != KErrNone)
-        {    
+        {
         switch (ret)
             {
             // PIN2 Blocked.
@@ -603,1785 +1126,39 @@
             }
         return;
         }
-    
-    CCodeQueryDialog* verdlg = new (ELeave) CCodeQueryDialog (verifcationPassword,SEC_C_PIN2_CODE_MIN_LENGTH,SEC_C_PIN2_CODE_MAX_LENGTH,ESecUiNone);
-    CleanupStack::PushL(verdlg);
 
-    CCodeQueryDialog* newdlg = new (ELeave) CCodeQueryDialog(newPassword,SEC_C_PIN2_CODE_MIN_LENGTH,SEC_C_PIN2_CODE_MAX_LENGTH,ESecUiNone);    
-    CleanupStack::PushL(newdlg);
-
-    CCodeQueryDialog* dlg = new (ELeave) CCodeQueryDialog (oldPassword,SEC_C_PIN2_CODE_MIN_LENGTH,SEC_C_PIN2_CODE_MAX_LENGTH,ESecUiNone);      
-    CleanupStack::PushL(dlg);
-
-
-    // Security code must be changed to Etel API format
-    // Custom API Pin1 and Pin2 have the same enum values as the Etel ones
-    EtelsecCodeType = (RMobilePhone::TMobilePhoneSecurityCode)secCodeType;
-    #ifndef __WINS__    
-        iWait->SetRequestType(EMobilePhoneGetSecurityCodeInfo);
-        iPhone.GetSecurityCodeInfo(iWait->iStatus, EtelsecCodeType, codeInfoPkg);
-        ret = iWait->WaitForRequestL();
-        User::LeaveIfError(ret);
-    #else
-        codeInfo.iRemainingEntryAttempts = 1;
-    #endif //__WINS__
-
-    if(codeInfo.iRemainingEntryAttempts == KMaxNumberOfPINAttempts)
-            ret = dlg->ExecuteLD(R_PIN2_QUERY);
-    else if(codeInfo.iRemainingEntryAttempts > KLastRemainingInputAttempt)
-       {
-         HBufC* queryPrompt = StringLoader::LoadLC(R_SECUI_REMAINING_PIN2_ATTEMPTS, codeInfo.iRemainingEntryAttempts );
-         ret = dlg->ExecuteLD(R_PIN2_QUERY, *queryPrompt);
-         CleanupStack::PopAndDestroy(queryPrompt);
-       }
-    else
-       {
-         HBufC* queryPrompt = StringLoader::LoadLC(R_SECUI_FINAL_PIN2_ATTEMPT);
-         ret = dlg->ExecuteLD(R_PIN2_QUERY, *queryPrompt);
-         CleanupStack::PopAndDestroy(queryPrompt);   
-       }
-
-    CleanupStack::Pop(); // dlg
-    if(!ret)
-        {
-        CleanupStack::PopAndDestroy(2,verdlg);
-        return;
-        }
-
-    // new pin code query
-    CleanupStack::Pop(); // newdlg
-    if(!(newdlg->ExecuteLD(R_NEW_PIN2_CODE_QUERY)))
-        {
-        CleanupStack::PopAndDestroy(verdlg);
-        return;
-        }
-
-     // verification code query
-    CleanupStack::Pop(); // verdlg
-    if(!(verdlg->ExecuteLD(R_VERIFY_NEW_PIN2_CODE_QUERY)))
-        {
-        return;
-        }
-
-    while (newPassword.CompareF(verifcationPassword) != 0)     
-        {
-        // codes do not match -> note -> ask new pin and verification codes again  
-        ShowResultNoteL(R_CODES_DONT_MATCH, CAknNoteDialog::EErrorTone);
-
-        newPassword = _L("");
-        verifcationPassword = _L("");
-        
-        // new pin code query
-        CCodeQueryDialog* dlg = new (ELeave) CCodeQueryDialog (newPassword,SEC_C_PIN2_CODE_MIN_LENGTH,SEC_C_PIN2_CODE_MAX_LENGTH,ESecUiNone);
-        if(!(dlg->ExecuteLD(R_NEW_PIN2_CODE_QUERY)))
-            return;
-              
-        // verification code query
-        CCodeQueryDialog* dlg2 = new (ELeave) CCodeQueryDialog (verifcationPassword,SEC_C_PIN2_CODE_MIN_LENGTH,SEC_C_PIN2_CODE_MAX_LENGTH,ESecUiNone);
-          if(!(dlg2->ExecuteLD(R_VERIFY_NEW_PIN2_CODE_QUERY)))
-            return;
-        }        
-    
-
-    passwords.iOldPassword = oldPassword;
-    passwords.iNewPassword = newPassword;
-    iWait->SetRequestType(EMobilePhoneChangeSecurityCode);
-    iPhone.ChangeSecurityCode(iWait->iStatus,EtelsecCodeType,passwords);
-    TInt res = iWait->WaitForRequestL();
-        #if defined(_DEBUG)
-    RDebug::Print( _L("(SECUI)CSecuritySettings::ChangePin2L(): RETURN CODE: %d"), res);
-    #endif
-    switch(res)
-        {
-        case KErrNone:
-            {
-            // code changed 
-            ShowResultNoteL(R_PIN2_CODE_CHANGED_NOTE, CAknNoteDialog::EConfirmationTone);
-            break;
-            }        
-        case KErrGsm0707IncorrectPassword:
-        case KErrAccessDenied:
-            {    
-            ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone);
-            ChangePin2L();
-            break;
-            }    
-        case KErrGsmSSPasswordAttemptsViolation:
-        case KErrLocked:
-            {
-            // Pin2 blocked!
-            ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone);
-            CSecurityHandler* handler = new(ELeave) CSecurityHandler(iPhone);
-            CleanupStack::PushL(handler); 
-            handler->HandleEventL(RMobilePhone::EPuk2Required);
-            CleanupStack::PopAndDestroy(handler); // handler    
-            return;
-            }
-        case KErrGsm0707OperationNotAllowed:
-            {
-            // not allowed with this sim
-            ShowResultNoteL(R_OPERATION_NOT_ALLOWED, CAknNoteDialog::EErrorTone);
-            return;
-            }
-        case KErrAbort:
-            {
-            break;
-            }
-        default:
-            {
-            ShowErrorNoteL(res);
-            ChangePin2L();
-            break;
-            }
-        }
-     }
-//
-// ----------------------------------------------------------
-// CSecuritySettings::ChangeSecCodeL()
-// Changes security code 
-// ----------------------------------------------------------
-//
-EXPORT_C void CSecuritySettings::ChangeSecCodeL()
-    {  
-    /*****************************************************
-    *    Series 60 Customer / ETel
-    *    Series 60  ETel API
-    *****************************************************/
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeSecCodeL()"));
-    #endif
-    TInt res;
-    RMobilePhone::TMobilePassword newPassword;
-if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw ) &&
-		(FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements  )))   
-{ 
-    
-    // Connect to the SCP server, and request the code change
-    RSCPClient scpClient;
-    User::LeaveIfError( scpClient.Connect() );
-    CleanupClosePushL( scpClient );
-    res = scpClient.ChangeCodeRequest();
-    CleanupStack::PopAndDestroy(); // scpClient
-    
-}
-else
-{
-         
-    RMobilePhone::TMobilePhoneSecurityCode secCodeType;
-    secCodeType = RMobilePhone::ESecurityCodePhonePassword;
-    RMobilePhone::TMobilePassword oldPassword;
-    RMobilePhone::TMobilePassword verifcationPassword;
-    RMobilePhone::TMobilePassword required_fourth;
-    RMobilePhone::TMobilePhonePasswordChangeV1 passwords;
-
-    CCodeQueryDialog* verdlg = new (ELeave) CCodeQueryDialog (verifcationPassword,SEC_C_SECURITY_CODE_MIN_LENGTH,SEC_C_SECURITY_CODE_CHANGE_MAX_LENGTH,ESecUiNone);
-    CleanupStack::PushL(verdlg);
-
-    CCodeQueryDialog* newdlg = new (ELeave) CCodeQueryDialog(newPassword,SEC_C_SECURITY_CODE_MIN_LENGTH,SEC_C_SECURITY_CODE_CHANGE_MAX_LENGTH,ESecUiNone);
-    CleanupStack::PushL(newdlg);
-
-    CCodeQueryDialog* dlg = new (ELeave) CCodeQueryDialog (oldPassword,SEC_C_SECURITY_CODE_MIN_LENGTH,SEC_C_SECURITY_CODE_MAX_LENGTH,ESecUiNone);
-    CleanupStack::PushL(dlg);
-
-    // ask security code
-    CleanupStack::Pop(); // dlg
-    if (!(dlg->ExecuteLD(R_SECURITY_QUERY)))
-        {
-        CleanupStack::PopAndDestroy(2,verdlg);
-        return;
-        }
-    // new security code query
-    CleanupStack::Pop(); // newdlg
-    if(!(newdlg->ExecuteLD(R_NEW_SECURITY_CODE_QUERY)))
-        {    
-        CleanupStack::PopAndDestroy(verdlg);
-        return;
-        }
-     
-    // verification code query
-    CleanupStack::Pop(); // verdlg
-      if(!(verdlg->ExecuteLD(R_VERIFY_NEW_SECURITY_CODE_QUERY)))
-        {
-        return;
-        }
-
-    while (newPassword.CompareF(verifcationPassword) != 0)         
-        {            
-        // codes do not match -> note -> ask new pin and verification codes again  
-        ShowResultNoteL(R_CODES_DONT_MATCH, CAknNoteDialog::EErrorTone);
-        
-        newPassword = _L("");
-        verifcationPassword = _L("");
-
-        // new pin code query
-        CCodeQueryDialog* dlg = new (ELeave) CCodeQueryDialog (newPassword,SEC_C_SECURITY_CODE_MIN_LENGTH,SEC_C_SECURITY_CODE_CHANGE_MAX_LENGTH,ESecUiNone);
-        if(!(dlg->ExecuteLD(R_NEW_SECURITY_CODE_QUERY)))
-            return;
-          
-        // verification code query
-        CCodeQueryDialog* dlg2 = new (ELeave) CCodeQueryDialog (verifcationPassword,SEC_C_SECURITY_CODE_MIN_LENGTH,SEC_C_SECURITY_CODE_CHANGE_MAX_LENGTH,ESecUiNone);
-          if(!(dlg2->ExecuteLD(R_VERIFY_NEW_SECURITY_CODE_QUERY)))
-            return;    
-        }            
-    iWait->SetRequestType(EMobilePhoneVerifySecurityCode);    
-    // check code
-    iPhone.VerifySecurityCode(iWait->iStatus,secCodeType, oldPassword, required_fourth);
-    res = iWait->WaitForRequestL();
-    #if defined(_DEBUG)
-    RDebug::Print( _L("(SECUI)CSecuritySettings::ChangeSecCode(): CODE VERIFY RESP: %d"), res);
-    #endif
-    // change code 
-    if (res == KErrNone)
-        {
-        passwords.iOldPassword = oldPassword;
-        passwords.iNewPassword = newPassword;
-        iWait->SetRequestType(EMobilePhoneChangeSecurityCode);
-        iPhone.ChangeSecurityCode(iWait->iStatus,secCodeType,passwords);
-        res = iWait->WaitForRequestL();
-        }
-        
-}
-        
-    #if defined(_DEBUG)
-    RDebug::Print( _L("(SECUI)CSecuritySettings::ChangeSecCode(): RETURN CODE: %d"), res);
-    #endif
-    switch(res)
-        {
-        case KErrNone:
-            {
-            // code changed 
-            ShowResultNoteL(R_SECURITY_CODE_CHANGED_NOTE, CAknNoteDialog::EConfirmationTone);
-            if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw ) &&
-								!(FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements  )))
-						{
-            // Send the changed code to the SCP server. Not used with device lock enhancements.
-            
-            RSCPClient scpClient;
-            TSCPSecCode newCode;
-            newCode.Copy( newPassword );
-            if ( scpClient.Connect() == KErrNone )
-                {
-                scpClient.StoreCode( newCode );
-                scpClient.Close();
-                }                                               
-          }
-                        
-            break;
-            }
-        case KErrGsmSSPasswordAttemptsViolation:
-        case KErrLocked:
-            {
-            ShowResultNoteL(R_SEC_BLOCKED, CAknNoteDialog::EErrorTone);
-            ChangeSecCodeL();
-            break;
-            }
-        case KErrGsm0707IncorrectPassword:
-        case KErrAccessDenied:
-            {    
-            // code was entered erroneously
-            ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone);
-            ChangeSecCodeL();
-            break;
-            }
-        case KErrAbort:
-            {
-            break;
-            }
-        default:
-            {
-            ShowErrorNoteL(res);
-            ChangeSecCodeL();
-            break;
-            }
-        }
-    }
-//
-// ----------------------------------------------------------
-// CSecuritySettings::ChangeAutoLockPeriodL()
-// Changes autolock period
-// ----------------------------------------------------------
-//
-EXPORT_C TInt CSecuritySettings::ChangeAutoLockPeriodL(TInt aPeriod)
-    {            
-    /*****************************************************
-    *    Series 60 Customer / ETel
-    *    Series 60  ETel API
-    *****************************************************/
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodLXXXX()"));
-    #endif
-    RMobilePhone::TMobilePhoneLockSetting lockChange(RMobilePhone::ELockSetDisabled);
-    RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockPhoneDevice;
-    TInt currentItem = 0;
-    TInt oldPeriod = aPeriod;
-
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL() ReadDesC16ArrayResourceL"));
-    #endif
-
-
-    CCoeEnv* coeEnv = CCoeEnv::Static();        
-    CDesCArrayFlat* items =  coeEnv->ReadDesC16ArrayResourceL(R_AUTOLOCK_LBX);
-    CleanupStack::PushL(items);
-        
-    if (aPeriod == 0)
-        {
-        currentItem = 0;  // autolock off
-        }
-    else
-        {
-        currentItem = 1;  // user defined
-        }
-    
-
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL() New autolocksettingpage"));
-    #endif
-    
-    CAutoLockSettingPage* dlg = new (ELeave)CAutoLockSettingPage(R_AUTOLOCK_SETTING_PAGE, currentItem, items, aPeriod);
-    CleanupStack::PushL(dlg);
-    dlg->ConstructL();
-    TInt maxPeriod;
-    if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw ))
-		{
-    // Retrieve the current autolock period max. value from the SCP server, 
-    // and check that the value the user
-    // selected is ok from the Corporate Policy point of view.
-	RSCPClient scpClient;
-    TInt ret = scpClient.Connect();
-    if ( ret == KErrNone )
-        {       
-        CleanupClosePushL( scpClient );
-        TBuf<KSCPMaxIntLength> maxPeriodBuf;
-        if ( scpClient.GetParamValue( ESCPMaxAutolockPeriod, maxPeriodBuf ) == KErrNone )
-            {
-            TLex lex( maxPeriodBuf );          
-            if ( ( lex.Val( maxPeriod ) == KErrNone ) && ( maxPeriod > 0 ) )
-                {               
-                 dlg->SetPeriodMaximumValue(maxPeriod);
-                }
-            else
-                {
-                   maxPeriod = 0;
-                   dlg->SetPeriodMaximumValue(maxPeriod);     
-                }
-                
-            }
-        else
-            {
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL():\
-                ERROR: Failed to retrieve max period"));
-            #endif            
-            }            
-        }
-    else
-        {
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL():\
-            ERROR: Failed to connect to SCP."));
-        #endif            
-        }
-    CleanupStack::PopAndDestroy(); // scpClient 
-}
-    CleanupStack::Pop(); //dlg
-    if (!dlg->ExecuteLD(CAknSettingPage::EUpdateWhenChanged))
-        {
-        CleanupStack::PopAndDestroy(items);           
-        return oldPeriod;
-        }
-    
-    CleanupStack::PopAndDestroy();    // items
-    
-    if ( FeatureManager::FeatureSupported( KFeatureIdSapTerminalControlFw ) )
-        {
-		// define a flag indicating whether disable autolock is allowed.
-        TBool allowDisableAL = ETrue;
-        
-        if ( ( aPeriod == 0 ) && ( maxPeriod > 0 ) )
-            {
-            #if defined( _DEBUG )
-                RDebug::Print(
-                    _L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL() \
-                    The period: %d is not allowed by TARM; max: %d" ),
-                    aPeriod, maxPeriod );
-            #endif                
-            allowDisableAL = EFalse;
-            HBufC* prompt = NULL;
-            prompt = StringLoader::LoadLC(
-                    R_SECUI_TEXT_AUTOLOCK_MUST_BE_ACTIVE );
-            CAknNoteDialog* noteDlg = new ( ELeave ) CAknNoteDialog(
-                    REINTERPRET_CAST( CEikDialog**,&noteDlg ) );
-            noteDlg->PrepareLC( R_CODE_ERROR );
-            noteDlg->SetTextL( *prompt );
-            noteDlg->SetTimeout( CAknNoteDialog::ELongTimeout );
-            noteDlg->SetTone( CAknNoteDialog::EErrorTone );
-            noteDlg->RunLD();
-            CleanupStack::PopAndDestroy( prompt );
-            }
-        
-        if ( !allowDisableAL )
-            {
-            return ChangeAutoLockPeriodL( oldPeriod );
-            }
-        }
-
-    if (aPeriod == 0)
-        {
-        
-        #ifdef RD_REMOTELOCK
-
-        // If remote lock is enabled, don't disable the domestic OS device lock
-        // since that would render the RemoteLock useless.
-        // Instead just re-set the DOS lock to enabled which as a side effect
-        // requests the security code from the user.
-
-        TBool remoteLockStatus( EFalse );
-        CRemoteLockSettings* remoteLockSettings = CRemoteLockSettings::NewL();
-
-        if ( remoteLockSettings->GetEnabled( remoteLockStatus ) )
-            {
-            if ( remoteLockStatus )
-                {
-                // Remote lock is enabled
-                #ifdef _DEBUG
-                RDebug::Print( _L( "(SecUi)CSecuritySettings::ChangeAutoLockPeriodL() - RemoteLock is enabled: lockChange = RMobilePhone::ELockSetEnabled" ) );
-                #endif // _DEBUG
-
-                lockChange = RMobilePhone::ELockSetEnabled;
-                }
-            else
-                {
-                // Remote lock is disabled
-                #ifdef _DEBUG
-                RDebug::Print( _L( "(SecUi)CSecuritySettings::ChangeAutoLockPeriodL() - RemoteLock is disabled: lockChange = RMobilePhone::ELockSetDisabled" ) );
-                #endif // _DEBUG
-
-                lockChange = RMobilePhone::ELockSetDisabled;
-                }
-            }
-        else
-            {
-            // Failed to get remote lock status
-            #ifdef _DEBUG
-            RDebug::Print( _L( "(SecUi)CSecuritySettings::ChangeAutoLockPeriodL() - Failed to get RemoteLock status" ) );
-            #endif // _DEBUG
-            }
-
-        delete remoteLockSettings;
-        remoteLockSettings = NULL;
-
-        #else // not defined RD_REMOTELOCK
-
-        lockChange = RMobilePhone::ELockSetDisabled;
-
-        #endif // RD_REMOTELOCK
-        }
-    else
-        {
-        lockChange = RMobilePhone::ELockSetEnabled;
-        }
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL() SetLockSetting"));
-    #endif
-        iWait->SetRequestType(EMobilePhoneSetLockSetting);
-        RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, ESecurityUIsQueryRequestOk);
-        iPhone.SetLockSetting(iWait->iStatus,lockType,lockChange);
-        TInt status = iWait->WaitForRequestL();
-        #if defined(_DEBUG)
-        RDebug::Print( _L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL(): RETURN CODE: %d"), status);
-        #endif
-        switch(status)
-        {
-        case KErrNone:
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL() KErrNone"));
-            #endif
-            break;
-        case KErrGsmSSPasswordAttemptsViolation:
-        case KErrLocked:
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL() PasswordAttemptsViolation"));
-            #endif
-            return ChangeAutoLockPeriodL(oldPeriod);
-        case KErrGsm0707IncorrectPassword:
-        case KErrAccessDenied:
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL() IncorrectPassword"));
-            #endif
-            // code was entered erroneously
-            return ChangeAutoLockPeriodL(oldPeriod);
-        case KErrAbort:
-            // User pressed "cancel" in the code query dialog.
-            return oldPeriod;
-        default:
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL() default"));
-            #endif            
-            return ChangeAutoLockPeriodL(oldPeriod);
-        }
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL() END"));
-    #endif
-    return aPeriod; 
-    }
-
-
-
-//
-// ----------------------------------------------------------
-// CSecuritySettings::ChangeRemoteLockStatusL()
-// Changes remote lock status (on/off)
-// ----------------------------------------------------------
-//
-EXPORT_C TInt CSecuritySettings::ChangeRemoteLockStatusL( TBool& aRemoteLockStatus, TDes& aRemoteLockCode, TInt aAutoLockPeriod )
-    {
-   #ifdef RD_REMOTELOCK
-    TInt retValue( KErrNone );
-
-    #ifdef _DEBUG
-    RDebug::Print(_L("(SecUi)CSecuritySettings::ChangeRemoteLockStatusL() - Enter, aRemoteLockStatus == %d, aAutoLockPeriod == %d" ), aRemoteLockStatus, aAutoLockPeriod );
-    #endif // _DEBUG
-
-    CCoeEnv* coeEnv       = CCoeEnv::Static();        
-    CDesCArrayFlat* items = coeEnv->ReadDesC16ArrayResourceL( R_REMOTELOCK_LBX );
-    CleanupStack::PushL( items );
-
-    // Store the current remote lock setting 
-    TInt previousItem( 0 );
-    TInt currentItem(  0 );
-
-    if ( aRemoteLockStatus )
-        {
-        previousItem = KRemoteLockSettingItemOn;
-        currentItem  = KRemoteLockSettingItemOn;
-        }
-    else
-        {
-        previousItem = KRemoteLockSettingItemOff;
-        currentItem  = KRemoteLockSettingItemOff;
-        }
-
-    // Create Remote Lock setting page for user to enable or disable remote locking 
-    CRemoteLockSettingPage* remoteLockSettingPage = new( ELeave ) CRemoteLockSettingPage( R_REMOTELOCK_SETTING_PAGE, currentItem, items );
-
-    #ifdef _DEBUG
-    RDebug::Print( _L( "(SecUi)CSecuritySettings::ChangeRemoteLockStatusL() - Executing CRemoteLockSettingPage dialog" ) );
-    #endif // _DEBUG
-
-    // Execute the remote lock enable/disable dialog
-    TBool ret = remoteLockSettingPage->ExecuteLD( CAknSettingPage::EUpdateWhenChanged );
-
-    // Setting page list box items (texts) no longer needed
-    CleanupStack::PopAndDestroy( items );
-
-    if ( ret )
-        {
-        if ( currentItem == KRemoteLockSettingItemOn )
-            {
-            #ifdef _DEBUG
-            RDebug::Print( _L( "(SecUi)CSecuritySettings::ChangeRemoteLockStatusL() - Remote lock status set to ON" ) );
-            #endif // _DEBUG
-
-            aRemoteLockStatus = ETrue;
-
-            // If user wishes to enable remote lock
-            // a new remote lock code is required.
-            // RemoteLockCodeQueryL also 
-            retValue = RemoteLockCodeQueryL( aRemoteLockCode );
-            }
-        else if ( currentItem == KRemoteLockSettingItemOff )
-            {
-            #ifdef _DEBUG
-            RDebug::Print( _L( "(SecUi)CSecuritySettings::ChangeRemoteLockStatusL() - Remote lock status set to OFF" ) );
-            #endif // _DEBUG
-
-            aRemoteLockStatus = EFalse;
-            retValue          = KErrNone;
-
-            // Check whether the status was already off
-            // If not don't make the user enter the security code
-            // (which occurs when setting the DOS lock setting) for no reason.
-            if ( currentItem != previousItem )
-                {
-                // Check whether AutoLock is enabled (timeout value greater 
-                // than zero) or not. If AutoLock is enabled the domestic OS 
-                // device lock should be left enabled.
-                if ( aAutoLockPeriod == 0 )
-                    {
-                    // Disable lock setting from domestic OS
-                    retValue = RemoteLockSetLockSettingL( EFalse );
-                    }
-                else
-                    {
-                    // If AutoLock is enabled, don't disable the DOS device lock
-                    // Re-set (enable) the domestic OS device lock because as a 
-                    // side effect it requires the security code from the user
-                    retValue = RemoteLockSetLockSettingL( ETrue );
-                    }
-                }
-            }
-        else
-            {
-            // This should never happen. But if it does don't change anything
-            retValue = KErrUnknown;
-            }
-        }
-    else
-        {
-        // Something went wrong with the RemoteLockSettingPage dialog 
-        retValue = KErrGeneral;
-
-        #ifdef _DEBUG
-        RDebug::Print( _L( "(SecUi)CSecuritySettings::ChangeRemoteLockStatusL() - CRemoteLockSettingPage::ExecuteLD() failed" ) );
-        #endif // _DEBUG
-        }
-
-    #ifdef _DEBUG
-    RDebug::Print(_L("(SecUi)CSecuritySettings::ChangeRemoteLockStatusL() - Exit" ) );
-    #endif
-
-    return retValue;
-    #else //! RD_REMOTELOCK
-    return KErrNotSupported;
-    #endif //RD_REMOTELOCK
-    }
-//
-// ----------------------------------------------------------
-// CSecuritySettings::RemoteLockCodeQueryL()
-// Pops up remote lock code query. Requires user to enter a new remote lock 
-// code twice and if they match enables the domestic OS device lock (which as 
-// a side effect pops up security code query).
-// ----------------------------------------------------------
-//
-TInt CSecuritySettings::RemoteLockCodeQueryL( TDes& aRemoteLockCode )
-    {
-    #ifdef RD_REMOTELOCK
-    TInt retValue( KErrNone );
-
-    #ifdef _DEBUG
-    RDebug::Print(_L("(SecUi)CSecuritySettings::ChangeRemoteLockCodeL() - Enter" ) );
-    #endif // _DEBUG
-
-    // Clear the remote lock code buffer
-    aRemoteLockCode.Zero();
-
-    // ----- Remote lock code query -------------------------------------------
-
-    // Execute Remote Lock code query
-    #ifdef _DEBUG
-    RDebug::Print( _L( "(SecUi)CSecuritySettings::ChangeRemoteLockCodeL() - Executing remote lock code query" ) );
-    #endif // _DEBUG
-
-    // Load the query prompt from resources
-    CCodeQueryDialog* codeQuery = new( ELeave ) CCodeQueryDialog( aRemoteLockCode, SEC_REMOTELOCK_CODE_MIN_LENGTH,SEC_REMOTELOCK_CODE_MAX_LENGTH, ESecUiNone, ETrue );
-    TInt buttonId = codeQuery->ExecuteLD( R_REMOTELOCK_CODE_QUERY );
-    if ( buttonId == EEikBidOk )
-        {
-            // Ok was pressed and the remote lock code seems fine
-            retValue = KErrNone;
-        }
-    else
-        {
-        // User pressed Cancel
-        // Set the code length to zero leaving no trash for possible retry
-        aRemoteLockCode.Zero();
-        retValue = KErrAbort;
-        }
-
-    if ( retValue != KErrNone )
-        {
-        #ifdef _DEBUG
-        RDebug::Print(_L("(SecUi)CSecuritySettings::ChangeRemoteLockCodeL() - Exit, Remote lock code error" ) );
-        #endif // _DEBUG
-
-        // Can't continue beyond this 
-        return retValue;
-        }
-
-    // ----- Remote lock code confirm query -----------------------------------
-
-    // Confirm the code by asking it again
-    #ifdef _DEBUG
-    RDebug::Print( _L( "(SecUi)CSecuritySettings::ChangeRemoteLockCodeL() - Executing remote lock code verify query" ) );
-    #endif // _DEBUG
-
-    // Buffer for the confirmation code
-    TBuf<KRLockMaxLockCodeLength> confirmCode;
-
-    // Load the confirmation query prompt from resources
-    CCodeQueryDialog* codeConfirmQuery = new( ELeave ) CCodeQueryDialog( confirmCode, SEC_REMOTELOCK_CODE_MIN_LENGTH, SEC_REMOTELOCK_CODE_MAX_LENGTH, ESecUiNone, ETrue );
-    buttonId = codeConfirmQuery->ExecuteLD( R_VERIFY_REMOTELOCK_CODE_QUERY);
-
-
-   if ( buttonId == EEikBidOk )
-        {
-        // Compare codes. Compare returns zero if descriptors have
-        // the same length and the same content
-        while ( (aRemoteLockCode.CompareF( confirmCode ) != 0) && (buttonId == EEikBidOk))
-            {
-                //Codes didn't match; zero the bufffers and show the dialog again
-                aRemoteLockCode.Zero();
-                confirmCode.Zero();
-                // Codes don't match. Notify user
-                ShowResultNoteL( R_REMOTELOCK_CODES_DONT_MATCH, CAknNoteDialog::EErrorTone );
-                codeQuery = new( ELeave ) CCodeQueryDialog( aRemoteLockCode, SEC_REMOTELOCK_CODE_MIN_LENGTH,SEC_REMOTELOCK_CODE_MAX_LENGTH, ESecUiNone, ETrue );
-                buttonId = codeQuery->ExecuteLD( R_REMOTELOCK_CODE_QUERY );
-                //Unless user pressed Cancel show the verification query
-                if(buttonId == EEikBidOk)
-                    {
-                        codeConfirmQuery = new( ELeave ) CCodeQueryDialog( confirmCode, SEC_REMOTELOCK_CODE_MIN_LENGTH, SEC_REMOTELOCK_CODE_MAX_LENGTH, ESecUiNone, ETrue );
-                        buttonId = codeConfirmQuery->ExecuteLD( R_VERIFY_REMOTELOCK_CODE_QUERY);
-                    }
-                
-            } 
-        //User pressed cancel        
-        if(buttonId != EEikBidOk)
-            {
-              // Set the code length to zero leaving no trash for possible retry
-              // Report error and let the user try again 
-              aRemoteLockCode.Zero();
-              confirmCode.Zero();
-              retValue = KErrAbort; 
-            }
-        else
-            {
-            // Codes match
-            confirmCode.Zero();
-
-            // ----- Check against security code ------------------------------
-            
-            // Check that the new remote lock code doesn't match the security 
-            // code of the device.
-
-            RMobilePhone::TMobilePhoneSecurityCode secCodeType;
-            secCodeType = RMobilePhone::ESecurityCodePhonePassword;
-            RMobilePhone::TMobilePassword securityCode;
-            RMobilePhone::TMobilePassword unblockCode;  // Required here only as a dummy parameter 
-
-            if ( aRemoteLockCode.Length() <= RMobilePhone::KMaxMobilePasswordSize )
-                {
-                securityCode = aRemoteLockCode;
-                iWait->SetRequestType( EMobilePhoneVerifySecurityCode );
-                iPhone.VerifySecurityCode( iWait->iStatus, secCodeType, securityCode, unblockCode );
-                TInt res = iWait->WaitForRequestL();
-                // The remote lock code matches the security code 
-                // and that is not allowed
-                while ( (res == KErrNone) && (buttonId == EEikBidOk))
-                    {
-                    #ifdef _DEBUG
-                    RDebug::Print(_L("(SecUi)CSecuritySettings::ChangeRemoteLockCodeL() - Unacceptable remote lock code" ) );
-                    #endif // _DEBUG
-                    aRemoteLockCode.Zero();
-                    confirmCode.Zero();
-                    
-					ShowResultNoteL( R_REMOTELOCK_INVALID_CODE, CAknNoteDialog::EErrorTone );
-					
-					codeQuery = new( ELeave ) CCodeQueryDialog( aRemoteLockCode, SEC_REMOTELOCK_CODE_MIN_LENGTH,SEC_REMOTELOCK_CODE_MAX_LENGTH, ESecUiNone, ETrue );
-                    buttonId = codeQuery->ExecuteLD( R_REMOTELOCK_CODE_QUERY );
-                    //Unless user pressed Cancel show the verification query
-                    if(buttonId == EEikBidOk)
-                        {
-                            codeConfirmQuery = new( ELeave ) CCodeQueryDialog( confirmCode, SEC_REMOTELOCK_CODE_MIN_LENGTH, SEC_REMOTELOCK_CODE_MAX_LENGTH, ESecUiNone, ETrue );
-                            buttonId = codeConfirmQuery->ExecuteLD( R_VERIFY_REMOTELOCK_CODE_QUERY);
-                            
-                            // Compare codes. Compare returns zero if descriptors have
-                            // the same length and the same content
-                            while ( (aRemoteLockCode.CompareF( confirmCode ) != 0) && (buttonId == EEikBidOk))
-                                {
-                                    //Codes didn't match; zero the bufffers and show the dialog again
-                                    aRemoteLockCode.Zero();
-                                    confirmCode.Zero();
-                                    // Codes don't match. Notify user
-                                    ShowResultNoteL( R_REMOTELOCK_CODES_DONT_MATCH, CAknNoteDialog::EErrorTone );
-                                    codeQuery = new( ELeave ) CCodeQueryDialog( aRemoteLockCode, SEC_REMOTELOCK_CODE_MIN_LENGTH,SEC_REMOTELOCK_CODE_MAX_LENGTH, ESecUiNone, ETrue );
-                                    buttonId = codeQuery->ExecuteLD( R_REMOTELOCK_CODE_QUERY );
-                                    //Unless user pressed Cancel show the verification query
-                                    if(buttonId == EEikBidOk)
-                                        {
-                                            codeConfirmQuery = new( ELeave ) CCodeQueryDialog( confirmCode, SEC_REMOTELOCK_CODE_MIN_LENGTH, SEC_REMOTELOCK_CODE_MAX_LENGTH, ESecUiNone, ETrue );
-                                            buttonId = codeConfirmQuery->ExecuteLD( R_VERIFY_REMOTELOCK_CODE_QUERY);
-                                        }
-                
-                                } 
-                            //User pressed cancel        
-                            if(buttonId != EEikBidOk)
-                                {
-                                  // Set the code length to zero leaving no trash for possible retry
-                                  // Report error and let the user try again 
-                                  aRemoteLockCode.Zero();
-                                  confirmCode.Zero();
-                                  retValue = KErrAbort; 
-                                }
-                            else //Check against security code
-                                {
-                                    securityCode = aRemoteLockCode;
-                                    iWait->SetRequestType( EMobilePhoneVerifySecurityCode );
-                                    iPhone.VerifySecurityCode( iWait->iStatus, secCodeType, securityCode, unblockCode );
-                                    res = iWait->WaitForRequestL();
-                                }
-                        }
-					
-                    }
-               //User pressed cancel        
-               if(buttonId != EEikBidOk)
-                    {
-                      // Set the code length to zero leaving no trash for possible retry
-                      // Report error and let the user try again 
-                      aRemoteLockCode.Zero();
-                      confirmCode.Zero();
-                      retValue = KErrAbort; 
-                    }
-                }
-
-            // ----- Enable DOS device lock (Security code query) -------------
-
-            if ( retValue == KErrNone )
-                {
-                // Enable lock setting in domestic OS. It is safe to enable the 
-                // lock setting since RemoteLock API requires remote locking to
-                // be enabled when changing or setting the remote lock message.
-                retValue = RemoteLockSetLockSettingL( ETrue );
-                }
-            }
-        }
-    else //User pressed Cancel
-        {
-        // Set the code length to zero leaving no trash for possible retry
-        aRemoteLockCode.Zero();
-        confirmCode.Zero();
-        retValue = KErrAbort;
-        }
-
-    #ifdef _DEBUG
-    RDebug::Print(_L("(SecUi)CSecuritySettings::ChangeRemoteLockCodeL() - Exit" ) );
-    #endif // _DEBUG
-
-    return retValue;
-    #else //! RD_REMOTELOCK
-    return KErrNotSupported;
-    #endif //RD_REMOTELOCK
-    }
-//
-// ----------------------------------------------------------
-// CSecuritySettings::RemoteLockSetLockSettingL()
-// Changes lock setting in domestic OS. Changing the domestic OS lock setting
-// requires user to enter the security code.
-// ----------------------------------------------------------
-//
-TInt CSecuritySettings::RemoteLockSetLockSettingL( TBool aLockSetting )
-    {
-    #ifdef RD_REMOTELOCK
-    TInt retValue( KErrNone );
-
-    #ifdef _DEBUG
-    RDebug::Print(_L("(SecUi)CSecuritySettings::RemoteLockSetLockSettingL( %d ) - Enter" ), aLockSetting );
-    #endif // _DEBUG
-
-    RMobilePhone::TMobilePhoneLockSetting lockSetting = RMobilePhone::ELockSetEnabled;
-    RMobilePhone::TMobilePhoneLock        lockType    = RMobilePhone::ELockPhoneDevice;
-
-    if ( aLockSetting )
-        {
-        lockSetting = RMobilePhone::ELockSetEnabled;
-        }
-    else
-        {
-        lockSetting = RMobilePhone::ELockSetDisabled;
-        }
-
-    iWait->SetRequestType( EMobilePhoneSetLockSetting );
-    RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, ESecurityUIsQueryRequestOk);
-    iPhone.SetLockSetting( iWait->iStatus, lockType, lockSetting );
-
-    // Wait for code verify to complete
-    retValue = iWait->WaitForRequestL();
-
-    switch( retValue )
-        {
-        case KErrNone:
-            #ifdef _DEBUG
-            RDebug::Print( _L( "(SecUi)CSecuritySettings::RemoteLockSetLockSettingL() - EMobilePhoneSetLockSetting request returned KErrNone" ) );
-            #endif // _DEBUG
-            break;
-
-        case KErrGsmSSPasswordAttemptsViolation:
-        case KErrLocked:
-            #ifdef _DEBUG
-            RDebug::Print( _L( "(SecUi)CSecuritySettings::RemoteLockSetLockSettingL() - EMobilePhoneSetLockSetting request returned KErrLocked" ) );
-            #endif // _DEBUG
-            //Error note is shown in CSecurityHandler::PassPhraseRequired()
-            break;
-
-        case KErrGsm0707IncorrectPassword:
-        case KErrAccessDenied:
-            #ifdef _DEBUG
-            RDebug::Print( _L( "(SecUi)CSecuritySettings::RemoteLockSetLockSettingL() - EMobilePhoneSetLockSetting request returned KErrAccessDenied" ) );
-            #endif // _DEBUG
-            // Security code was entered erroneously
-            //Error note is shown in CSecurityHandler::PassPhraseRequired()
-            break;
-
-        case KErrAbort:
-            #ifdef _DEBUG
-            RDebug::Print( _L( "(SecUi)CSecuritySettings::RemoteLockSetLockSettingL() - EMobilePhoneSetLockSetting request returned KErrAbort" ) );
-            #endif // _DEBUG
-            break;
-
-        default:
-            #ifdef _DEBUG
-            RDebug::Print( _L( "(SecUi)CSecuritySettings::RemoteLockSetLockSettingL() - EMobilePhoneSetLockSetting request returned: %d"), retValue );
-            #endif // _DEBUG
-            break;
-        }
-
-    #ifdef _DEBUG
-    RDebug::Print(_L("(SecUi)CSecuritySettings::RemoteLockSetLockSettingL() - Exit" ) );
-    #endif // _DEBUG
-
-    return retValue;
-    #else //! RD_REMOTELOCK
-    return KErrNotSupported;
-    #endif //RD_REMOTELOCK
-    }
-
-
-
-//
-// ----------------------------------------------------------
-// CSecuritySettings::ChangeSimSecurityL()
-// Changes SIM security
-// ----------------------------------------------------------
-//
-EXPORT_C TBool CSecuritySettings::ChangeSimSecurityL()
-    {    
-    /*****************************************************
-    *    Series 60 Customer / ETel
-    *    Series 60  ETel API
-    *****************************************************/
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeSimSecurityL()"));
-    #endif
-
-    RMobilePhone::TMobilePhoneLockInfoV1 lockInfo;
-    RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo);
-    RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockPhoneToICC;
-    RMobilePhone::TMobilePhoneLockSetting lockChangeSetting;
-    CCoeEnv* coeEnv = CCoeEnv::Static();
-    CDesCArrayFlat* items = coeEnv->ReadDesC16ArrayResourceL(R_SECURITY_LBX);
-    CleanupStack::PushL(items);
-                        
-    //get lock info
-    iWait->SetRequestType(EMobilePhoneGetLockInfo);
-    iPhone.GetLockInfo(iWait->iStatus, lockType, lockInfoPkg);
-    TInt status = iWait->WaitForRequestL();
-    User::LeaveIfError(status);
-    TInt currentItem = 0;
-
-    if (lockInfo.iSetting == RMobilePhone::ELockSetDisabled)
-        {
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeSimSecurityL()lockInfo: ELockSetDisabled"));
-        #endif
-        currentItem = 1;  // off
-        }
-                        
-    TInt oldItem = currentItem;
-
-    CAknRadioButtonSettingPage* dlg = new (ELeave)CAknRadioButtonSettingPage(R_SECURITY_SETTING_PAGE, currentItem, items);
-    CleanupStack::PushL(dlg);
-    
-
-    CleanupStack::Pop(); // dlg
-    if ( !(dlg->ExecuteLD(CAknSettingPage::EUpdateWhenChanged)) || oldItem==currentItem )
-        {
-        CleanupStack::PopAndDestroy();    // items
-        return EFalse;
-        }    
-
-
-
-    if (currentItem == 1)
-        {
-        lockChangeSetting = RMobilePhone::ELockSetDisabled;
-        }
-    else
-        {
-        lockChangeSetting = RMobilePhone::ELockSetEnabled;
-        }
-
-    CleanupStack::PopAndDestroy();    // items 
-    
-    iWait->SetRequestType(EMobilePhoneSetLockSetting);
-    RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, ESecurityUIsQueryRequestOk);
-    iPhone.SetLockSetting(iWait->iStatus,lockType,lockChangeSetting);
-    status = iWait->WaitForRequestL();
-
-    #if defined(_DEBUG)
-    RDebug::Print( _L("(SECUI)CSecuritySettings::ChangeSimSecurityL(): RETURN CODE: %d"), status);
-    #endif        
-    switch(status)
-        {
-        case KErrNone:
-            {
-            break;
-            }        
-        case KErrGsm0707IncorrectPassword:
-        case KErrAccessDenied:
-            {    
-            // code was entered erroneously
-            return ChangeSimSecurityL();
-            }    
-        case KErrGsmSSPasswordAttemptsViolation:
-        case KErrLocked:
-            {
-            return ChangeSimSecurityL();
-            }
-        case KErrAbort:
-            {
-            return EFalse;
-            }
-        default:
-            {
-            ShowErrorNoteL(status);
-            return ChangeSimSecurityL();
-            }
-        }
-    
-    return ETrue;
-    }
-//
-// ----------------------------------------------------------
-// CSecuritySettings::ChangePinRequestL()
-// Changes PIN1 request
-// ----------------------------------------------------------
-//
-EXPORT_C TBool CSecuritySettings::ChangePinRequestL()
-    {    
-    /*****************************************************
-    *    Series 60 Customer / ETel
-    *    Series 60  ETel API
-    *****************************************************/
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecuritySettings::ChangePinRequestL()"));
-    #endif      
-    TInt simState;
-    TInt err( KErrGeneral );
-    err = RProperty::Get(KPSUidStartup, KPSSimStatus, simState);
-    User::LeaveIfError( err );
-    TBool simRemoved(simState == ESimNotPresent);
-
-    if ( simRemoved )
-        {
-        ShowResultNoteL(R_INSERT_SIM, CAknNoteDialog::EErrorTone);
-        return EFalse;;
-        }
-
-    RMobilePhone::TMobilePhoneLockInfoV1 lockInfo;
-    RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo);
-    RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockICC;
-
-    RMobilePhone::TMobilePhoneLockSetting lockChangeSetting;
-    
-    CCoeEnv* coeEnv = CCoeEnv::Static();
-    CDesCArrayFlat* items = coeEnv->ReadDesC16ArrayResourceL(R_PIN_LBX);
-    CleanupStack::PushL(items);
-                        
-    //get lock info
-    iWait->SetRequestType(EMobilePhoneGetLockInfo);
-    iPhone.GetLockInfo(iWait->iStatus, lockType, lockInfoPkg);
-    TInt status = iWait->WaitForRequestL();
-    User::LeaveIfError(status);                    
-    TInt currentItem = 0;
-
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecuritySettings::ChangePinRequestL() GetLockInfo"));
-    #endif
-
-    if (lockInfo.iSetting == RMobilePhone::ELockSetDisabled)
-        {
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecuritySettings::ChangePinRequestL() lockInfo: ELockSetDisabled"));
-        #endif
-        currentItem = 1;  // off
-        }
-                        
-    TInt oldItem = currentItem;
-
-    CAknRadioButtonSettingPage* dlg = new (ELeave)CAknRadioButtonSettingPage(R_PIN_SETTING_PAGE, currentItem, items);
-    CleanupStack::PushL(dlg);
-    
-
-    CleanupStack::Pop(); // dlg
-    if ( !(dlg->ExecuteLD(CAknSettingPage::EUpdateWhenChanged)) || oldItem==currentItem )
-        {
-        CleanupStack::PopAndDestroy();    // items
-        return EFalse;
-        }    
-
-
-    if (currentItem == 1)
-        {
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecuritySettings::ChangePinRequestL() currentItem: ELockSetDisabled"));
-        #endif
-        lockChangeSetting = RMobilePhone::ELockSetDisabled;
-        }
-    else
-        {
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecuritySettings::ChangePinRequestL() currentItem: ELockSetEnabled"));
-        #endif
-        lockChangeSetting = RMobilePhone::ELockSetEnabled;
-        }
-
-    CleanupStack::PopAndDestroy();    // items 
-
-    // Raise a flag to indicate that the PIN
-    // request coming from ETEL has originated from SecUi and not from Engine.
-    TInt tRet = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsSecUIOriginated);
-    if ( tRet != KErrNone )
-        {
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecuritySettings::ChangePinRequestL():\
-            FAILED to set the SECUI query Flag: %d"), tRet);
-        #endif
-        }
-    // Change the lock setting
-    iWait->SetRequestType(EMobilePhoneSetLockSetting);
-    RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, ESecurityUIsQueryRequestOk);
-    iPhone.SetLockSetting(iWait->iStatus,lockType,lockChangeSetting);
-    status = iWait->WaitForRequestL();
-    #if defined(_DEBUG)
-    RDebug::Print( _L("(SECUI)CSecuritySettings::ChangePinRequestL(): RETURN CODE: %d"), status);
-    #endif
-
-    // Lower the flag                             
-    RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsETelAPIOriginated);
-
-    switch(status)
-        {
-        case KErrNone:
-            {
-            break;
-            }
-        case KErrGsm0707OperationNotAllowed:
-            {
-            // not allowed with this sim
-            ShowResultNoteL(R_OPERATION_NOT_ALLOWED, CAknNoteDialog::EErrorTone);
-            return EFalse;
-            }
-        case KErrGsm0707IncorrectPassword:
-        case KErrAccessDenied:
-            {    
-            // code was entered erroneously
-            return ChangePinRequestL();
-            }    
-        case KErrGsmSSPasswordAttemptsViolation:
-        case KErrLocked:
-            {
-            return ETrue;
-            }
-        case KErrAbort:
-            {
-            return EFalse;
-            }
-        default:
-            {
-            return ChangePinRequestL();
-            }
-        }
-    
-    return ETrue;
-    }
-
-//
-// ----------------------------------------------------------
-// CSecuritySettings::ChangeUPinRequestL()
-// Changes UPIN request on/off
-// ----------------------------------------------------------
-//
-EXPORT_C TBool CSecuritySettings::ChangeUPinRequestL()
-    {
-    TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ));
-    TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin ));
-    if(wcdmaSupported || upinSupported)
-      {
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeUPinRequestL()"));
-        #endif
-        
-        TInt simState;
-        TInt err( KErrGeneral );
-        err = RProperty::Get(KPSUidStartup, KPSSimStatus, simState);
-        User::LeaveIfError( err );
-        TBool simRemoved(simState == ESimNotPresent);
-    
-        if ( simRemoved )
-            {
-            ShowResultNoteL(R_INSERT_SIM, CAknNoteDialog::EErrorTone);
-            return EFalse;
-            }
-    
-        RMobilePhone::TMobilePhoneLockInfoV1 lockInfo;
-        RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo);
-        RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockUniversalPin;
-    
-        RMobilePhone::TMobilePhoneLockSetting lockChangeSetting = RMobilePhone::ELockSetDisabled;
-        
-        CCoeEnv* coeEnv = CCoeEnv::Static();
-        CDesCArrayFlat* items = coeEnv->ReadDesC16ArrayResourceL(R_UPIN_LBX);
-        CleanupStack::PushL(items);
-                            
-        //get lock info
-        iWait->SetRequestType(EMobilePhoneGetLockInfo);
-        iPhone.GetLockInfo(iWait->iStatus, lockType, lockInfoPkg);
-        TInt status = iWait->WaitForRequestL();
-        User::LeaveIfError(status);                    
-        TInt currentItem = 0;
-    
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeUPinRequestL() GetLockInfo"));
-        #endif
-    
-        if (lockInfo.iSetting == RMobilePhone::ELockSetDisabled)
-            {
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeUPinRequestL() lockInfo: ELockSetDisabled"));
-            #endif
-            currentItem = 1;  // off
-            }
-                            
-        TInt oldItem = currentItem;
-    
-        CAknRadioButtonSettingPage* dlg = new (ELeave)CAknRadioButtonSettingPage(R_UPIN_SETTING_PAGE, currentItem, items);
-        CleanupStack::PushL(dlg);
-        
-    
-        CleanupStack::Pop(); // dlg
-        if ( !(dlg->ExecuteLD(CAknSettingPage::EUpdateWhenChanged)) || oldItem==currentItem )
-            {
-            CleanupStack::PopAndDestroy();    // items
-            return EFalse;
-            }    
-    
-    
-       if (currentItem == 1)
-            {
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecuritySettings::ChangePinRequestL() currentItem: ELockSetDisabled"));
-            #endif
-            lockChangeSetting = RMobilePhone::ELockSetDisabled;
-            }
-        else
-            {
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecuritySettings::ChangePinRequestL() currentItem: ELockSetEnabled"));
-            #endif
-            lockChangeSetting = RMobilePhone::ELockSetEnabled;
-            }
-    
-        CleanupStack::PopAndDestroy();    // items 
-    
-        // Raise a flag to indicate that the UPIN
-        // request coming from ETEL has originated from SecUi and not from Engine.
-        RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsSecUIOriginated);                              
-        // Change the lock setting
-        iWait->SetRequestType(EMobilePhoneSetLockSetting);
-        RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, ESecurityUIsQueryRequestOk);
-        iPhone.SetLockSetting(iWait->iStatus,lockType,lockChangeSetting);
-        status = iWait->WaitForRequestL();
-        #if defined(_DEBUG)
-        RDebug::Print( _L("(SECUI)CSecuritySettings::ChangeUPinRequestL(): RETURN CODE: %d"), status);
-        #endif
-    
-        // Lower the flag                           
-        RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsETelAPIOriginated);
-        
-        switch(status)
-            {
-            case KErrNone:
-                {
-                break;
-                }
-            case KErrGsm0707OperationNotAllowed:
-                {
-                // not allowed with this sim
-                ShowResultNoteL(R_OPERATION_NOT_ALLOWED, CAknNoteDialog::EErrorTone);
-                return EFalse;
-                }
-            case KErrGsm0707IncorrectPassword:
-            case KErrAccessDenied:
-                {    
-                // code was entered erroneously
-                return ChangeUPinRequestL();
-                }    
-            case KErrGsmSSPasswordAttemptsViolation:
-            case KErrLocked:
-                {
-                return EFalse;
-                }
-            case KErrAbort:
-                {
-                return EFalse;
-                }
-            default:
-                {
-                ShowErrorNoteL(status);
-                return ChangeUPinRequestL();
-                }
-            }
-        
-        return ETrue;
-      }
-    else
-        return EFalse;
-
-    }
-
-//
-// ----------------------------------------------------------
-// CSecuritySettings::SwitchPinCodesL()
-// Changes the pin code currently in use (PIN/UPIN)
-// ----------------------------------------------------------
-//
-EXPORT_C TBool CSecuritySettings::SwitchPinCodesL()
-    { 
-    TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ));
-    TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin ));
-    if(wcdmaSupported || upinSupported)
-      {
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecuritySettings::SwitchPinCodesL()"));
-        #endif 
-    
-        // If we are in simless offline mode the PIN codes can't obviously be switched
-        TInt simState;
-        TInt err( KErrGeneral );
-        err = RProperty::Get(KPSUidStartup, KPSSimStatus, simState);    
-        User::LeaveIfError( err );
-        TBool simRemoved(simState == ESimNotPresent);
-    
-        if ( simRemoved )
-            {
-            ShowResultNoteL(R_INSERT_SIM, CAknNoteDialog::EErrorTone);
-            return EFalse;
-            }
-    
-       
-        RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockUniversalPin;
-        RMobilePhone::TMobilePhoneLockSetting lockChangeSetting = RMobilePhone::ELockReplaced;                       
-        RMobilePhone::TMobilePhoneSecurityCode activeCode;
-     
-        iCustomPhone.GetActivePin(activeCode);
-    
-        RMobilePhone::TMobilePhoneLockInfoV1 lockInfo;    
-        RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo);
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecuritySettings::SwitchPinCodesL() GetLockInfo"));
-        #endif    
-        iWait->SetRequestType(EMobilePhoneGetLockInfo);
-    
-        if (activeCode == RMobilePhone::ESecurityUniversalPin)
-            {
-             lockType = RMobilePhone::ELockUniversalPin;
-             iPhone.GetLockInfo(iWait->iStatus, lockType, lockInfoPkg);
-             TInt res = iWait->WaitForRequestL();
-             User::LeaveIfError(res);
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecuritySettings::SwitchPinCodesL() Lock Info got: UPIN"));
-            #endif 
-            }
-        else
-            {
-             lockType = RMobilePhone::ELockICC;
-             iPhone.GetLockInfo(iWait->iStatus, lockType, lockInfoPkg);
-             TInt res = iWait->WaitForRequestL();
-             User::LeaveIfError(res);
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecuritySettings::SwitchPinCodesL() Lock Info got: PIN"));
-            #endif 
-            }
-    
-        // code request must be ON to change active code.
-        if (lockInfo.iSetting == RMobilePhone::ELockSetDisabled)
-           {
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecuritySettings::SwitchPinCodesL() CODE REQ NOT ON."));
-            #endif
-            if (activeCode == RMobilePhone::ESecurityUniversalPin)
-                {
-                ShowResultNoteL(R_UPIN_NOT_ALLOWED, CAknNoteDialog::EErrorTone);
-                }
-            else
-                {
-                ShowResultNoteL(R_PIN_NOT_ALLOWED, CAknNoteDialog::EErrorTone);
-                }
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecuritySettings::SwitchPinCodesL() CODE REQ NOT ON NOTE END."));
-            #endif 
-            return EFalse;
-            }
-    
-        
-        
-        CCoeEnv* coeEnv = CCoeEnv::Static();
-        CDesCArrayFlat* items = coeEnv->ReadDesC16ArrayResourceL(R_CODE_LBX);
-        CleanupStack::PushL(items);
-    
-        iCustomPhone.GetActivePin(activeCode);
-        TInt currentItem = 0;
-    
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecuritySettings::SwitchPinCodesL() GetLockInfo"));
-        #endif
-    
-        if (activeCode == RMobilePhone::ESecurityUniversalPin)
-            {
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecuritySettings::SwitchPinCodesL() active code: UPIN"));
-            #endif
-            currentItem = 1;  // UPIN
-            }
-                            
-        TInt oldItem = currentItem;
-    
-        CAknRadioButtonSettingPage* dlg = new (ELeave)CAknRadioButtonSettingPage(R_CODE_IN_USE_SETTING_PAGE, currentItem, items);
-        CleanupStack::PushL(dlg);
-        
-    
-        CleanupStack::Pop(); // dlg
-        if ( !(dlg->ExecuteLD(CAknSettingPage::EUpdateWhenChanged)) || oldItem==currentItem )
-            {
-            CleanupStack::PopAndDestroy();    // items
-            return EFalse;
-            }    
-    
-    
-       if (currentItem == 1)
-            {
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecuritySettings::SwitchPinCodesL() currentItem: UPIN"));
-            #endif
-            lockType = RMobilePhone::ELockUniversalPin;
-            }
-        else
-            {
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecuritySettings::SwitchPinCodesL() currentItem: PIN1"));
-            #endif
-            lockType = RMobilePhone::ELockICC;
-            }
-    
-        CleanupStack::PopAndDestroy();    // items 
-    
-        // Raise a flag to indicate that the code
-        // request coming from ETEL has originated from SecUi and not from Engine.
-        RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsSecUIOriginated);                           
-        // Change the lock setting
-        iWait->SetRequestType(EMobilePhoneSetLockSetting);
-        RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, ESecurityUIsQueryRequestOk);
-        iPhone.SetLockSetting(iWait->iStatus,lockType,lockChangeSetting);
-        TInt status = iWait->WaitForRequestL();
-        #if defined(_DEBUG)
-        RDebug::Print( _L("(SECUI)CSecuritySettings::SwitchPinCodesL(): RETURN CODE: %d"), status);
-        #endif
-        // Lower the flag                            
-        RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsETelAPIOriginated);
-        
-        switch(status)
-            {
-            case KErrNone:
-                {
-                break;
-                }
-            case KErrGsm0707OperationNotAllowed:
-                {
-                // not allowed with this sim
-                ShowResultNoteL(R_OPERATION_NOT_ALLOWED, CAknNoteDialog::EErrorTone);
-                return EFalse;
-                }
-            case KErrGsm0707IncorrectPassword:
-            case KErrAccessDenied:
-                {    
-                // code was entered erroneously
-                return SwitchPinCodesL();
-                }    
-            case KErrGsmSSPasswordAttemptsViolation:
-            case KErrLocked:
-                {
-                return EFalse;
-                }
-            case KErrAbort:
-                {
-                return EFalse;
-                }
-            default:
-                {
-                ShowErrorNoteL(status);
-                return SwitchPinCodesL();
-                }
-            }
-        
-        return ETrue;
-      }
-    else
-        return EFalse;
-    }
-
-//
-// ----------------------------------------------------------
-// CSecuritySettings::IsLockEnabledL()
-// Return is lock enabled/disabled
-// ----------------------------------------------------------
-//
-EXPORT_C TBool CSecuritySettings::IsLockEnabledL(RMobilePhone::TMobilePhoneLock aLockType)
-    {
-    /*****************************************************
-    *    Series 60 Customer / ETel
-    *    Series 60  ETel API
-    *****************************************************/
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecuritySettings::IsLockEnabledL()"));
-    #endif
-    #ifdef __WINS__
-
-    return EFalse;
-
-    #else  //WINS
-
-    RMobilePhone::TMobilePhoneLockInfoV1 lockInfo;
-    
-    //get lock info
-    RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo);
-    iWait->SetRequestType(EMobilePhoneGetLockInfo);
-    iPhone.GetLockInfo(iWait->iStatus, aLockType, lockInfoPkg);
-    TInt res = iWait->WaitForRequestL();
-
-    if (res != KErrNone)
-        return ETrue;
-
-     //lock is enabled return true
-    if (lockInfo.iSetting == RMobilePhone::ELockSetEnabled)
-        {
-        return ETrue;                        
-        }
-
-    // lock is disabled return false
-    return EFalse;
-        
-    #endif 
-
-    }
-//
-// ----------------------------------------------------------
-// CSecuritySettings::AskSecCodeL()
-// For asking security code e.g in settings
-// ----------------------------------------------------------
-//
-EXPORT_C TBool CSecuritySettings::AskSecCodeL()
-    {
-    return iSecurityHandler->AskSecCodeL();
-    }
-//
-// ----------------------------------------------------------
-// CSecuritySettings::AskPin2L()
-// Asks PIN2
-// ----------------------------------------------------------
-//    
-EXPORT_C TBool CSecuritySettings::AskPin2L()
-    {    
-    /*****************************************************
-    *    Series 60 Customer / ETel
-    *    Series 60  ETel API
-    *****************************************************/
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecuritySettings::AskPin2L()"));
-    #endif
-    TInt ret = 0;
-    // check if pin2 is blocked...
-    RMmCustomAPI::TSecurityCodeType secCodeType = RMmCustomAPI::ESecurityCodePin2;
-    RMobilePhone::TMobilePhoneSecurityCode etelsecCodeType(RMobilePhone::ESecurityCodePin2);
-    RMobilePhone::TMobilePhoneSecurityCodeInfoV5 codeInfo;
-    RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg codeInfoPkg(codeInfo);
-    TBool isBlocked = EFalse;
-    //Check whether PIN2 is blocked
-    ret = iCustomPhone.IsBlocked(secCodeType,isBlocked);
-    
-	#if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecuritySettings::AskPin2L() IsBlocked return value: %d"), ret);
-    #endif
-    if(isBlocked)
-        return EFalse;
-    
-    if (ret != KErrNone)
-        {    
-        switch (ret)
-            {
-			// PIN2 Blocked.
-            case KErrGsm0707SIMPuk2Required:
-                break;
-            case KErrGsmSSPasswordAttemptsViolation:
-            case KErrLocked:
-                // Pin2 features blocked permanently!
-                ShowResultNoteL(R_PIN2_REJECTED, CAknNoteDialog::EConfirmationTone);
-                break;
-            case KErrGsm0707SimNotInserted:
-                // not allowed with this sim
-                ShowResultNoteL(R_OPERATION_NOT_ALLOWED, CAknNoteDialog::EErrorTone);
-                break;
-            default:
-                ShowErrorNoteL(ret);
-                break;
-            }
-        return EFalse;
-        }
-    iWait->SetRequestType(EMobilePhoneGetSecurityCodeInfo);
-    iPhone.GetSecurityCodeInfo(iWait->iStatus, etelsecCodeType, codeInfoPkg);
-    ret = iWait->WaitForRequestL();
-        
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecurityHandler::Pin2RequiredL(): get PIN2 info result: %d"), ret);
-    TInt attempts(codeInfo.iRemainingEntryAttempts);
-    RDebug::Print(_L("(SECUI)CSecurityHandler::Pin2RequiredL(): attempts remaining: %d"), attempts);
-    #endif
-    User::LeaveIfError(ret);
-    
-    // ask pin2 code  
-    RMobilePhone::TMobilePassword password;
-    CCodeQueryDialog* dlg = new (ELeave) CCodeQueryDialog (password,SEC_C_PIN_CODE_MIN_LENGTH,SEC_C_PIN_CODE_MAX_LENGTH,ESecUiNone);  
-    if(codeInfo.iRemainingEntryAttempts == KMaxNumberOfPINAttempts)
-            ret = dlg->ExecuteLD(R_PIN2_QUERY);
-    else if(codeInfo.iRemainingEntryAttempts > KLastRemainingInputAttempt)
-            {
-                HBufC* queryPrompt = StringLoader::LoadLC(R_SECUI_REMAINING_PIN2_ATTEMPTS, codeInfo.iRemainingEntryAttempts );
-                ret = dlg->ExecuteLD(R_PIN2_QUERY, *queryPrompt);
-                CleanupStack::PopAndDestroy(queryPrompt);
-            }
-    else
-            {
-                HBufC* queryPrompt = StringLoader::LoadLC(R_SECUI_FINAL_PIN2_ATTEMPT);
-                ret = dlg->ExecuteLD(R_PIN2_QUERY, *queryPrompt);
-                CleanupStack::PopAndDestroy(queryPrompt);   
-            } 
-       
-    if (!ret)
-        {
-		#if defined(_DEBUG)
-		RDebug::Print(_L("(SECUI)CSecuritySettings::AskPin2L(): Cancel pressed"));
-		#endif
-        return EFalse;
-        }
-    
-    // verify code
-    RMobilePhone::TMobilePassword required_fourth;
-    iWait->SetRequestType(EMobilePhoneVerifySecurityCode);
-    iPhone.VerifySecurityCode(iWait->iStatus,etelsecCodeType, password, required_fourth);
-    TInt res = iWait->WaitForRequestL();
-
-	#if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecuritySettings::AskPin2L() VerifySecurityCode return value: %d"), res);
-    #endif
-
-    switch(res)
-        {        
-        case KErrNone:
-            break;
-        case KErrGsm0707IncorrectPassword:
-        case KErrAccessDenied:
-            // code was entered erroneously
-            ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone);
-            return    AskPin2L();    
-        case KErrGsm0707OperationNotAllowed:
-            // not allowed with this sim
-            ShowResultNoteL(R_OPERATION_NOT_ALLOWED, CAknNoteDialog::EErrorTone);
-            return EFalse;
-        case KErrGsmSSPasswordAttemptsViolation:
-        case KErrLocked:
-            // code was blocked
-            ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone);
-            return EFalse;        
-        default:
-            ShowErrorNoteL(res);
-            return    AskPin2L();
-        }
-
-    return ETrue;
-    }
-//
-// ----------------------------------------------------------
-// CSecuritySettings::SetFdnModeL()
-// Activates or deactivates Fixed Dialling Numbers (FDN) mode.  
-// ----------------------------------------------------------
-//
-EXPORT_C void CSecuritySettings::SetFdnModeL()
-    {    
-    /*****************************************************
-    *    Series 60 Customer / ETel
-    *    Series 60  ETel API
-    *****************************************************/
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecuritySettings::SetFdnModeL()"));
-    #endif
-    RMmCustomAPI::TSecurityCodeType secCodeType = RMmCustomAPI::ESecurityCodePin2;
-    
-    TBool isBlocked = EFalse;
-    TInt ret = iCustomPhone.IsBlocked(secCodeType,isBlocked);
-    
-    if(isBlocked)
-        return;
-    
-    if (ret != KErrNone)
-        {    
-        switch (ret)
-            {
-             // PIN2 Blocked.
-            case KErrGsm0707SIMPuk2Required:
-                break;
-            case KErrGsmSSPasswordAttemptsViolation:
-            case KErrLocked:
-                // Pin2 features blocked permanently!
-                ShowResultNoteL(R_PIN2_REJECTED, CAknNoteDialog::EConfirmationTone);
-                break;
-            case KErrGsm0707SimNotInserted:
-                // not allowed with this sim
-                ShowResultNoteL(R_OPERATION_NOT_ALLOWED, CAknNoteDialog::EErrorTone);    
-                break;
-            default:
-                ShowErrorNoteL(ret);
-                break;
-            }
-        return;
-        }
-
-    
     TInt status = KErrNone;
 
     RMobilePhone::TMobilePhoneFdnStatus fdnMode;
     RMobilePhone::TMobilePhoneFdnSetting fdnSet;
-                    
+
     iPhone.GetFdnStatus(fdnMode);
-    
+
     if (fdnMode == RMobilePhone::EFdnActive)
         {
         fdnSet = RMobilePhone::EFdnSetOff;
         }
     else
         {
-        fdnSet = RMobilePhone::EFdnSetOn;   
+        fdnSet = RMobilePhone::EFdnSetOn;
         }
-        
-      // Change the FDN setting
+    RDEBUG("fdnSet", fdnSet);
+    // Change the FDN setting
     iWait->SetRequestType(EMobilePhoneSetFdnSetting);
     RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, ESecurityUIsQueryRequestOk);
+    RDEBUG("SetFdnSetting", 0);
     iPhone.SetFdnSetting(iWait->iStatus, fdnSet);
+    RDEBUG("WaitForRequestL", 0);
     status = iWait->WaitForRequestL();
+    RDEBUG("WaitForRequestL status", status);
+#ifdef __WINS__
+    if (status == KErrNotSupported)
+        status = KErrNone;
+#endif
 
-    #if defined(_DEBUG)
-    RDebug::Print( _L("(SECUI)CSecuritySettings::SetFdnModeL(): RETURN CODE: %d"), status);
-    #endif
-    switch(status)
-        {        
+    RDEBUG("status", status);
+    switch (status)
+        {
         case KErrNone:
             break;
         case KErrGsm0707IncorrectPassword:
@@ -2401,23 +1178,21 @@
         default:
             ShowErrorNoteL(status);
             break;
-        }    
-  }
+        }
+    }
 //
 // ----------------------------------------------------------
 // CSecuritySettings::GetFndMode()
 // Retrieves the current Fixed Dialling Numbers mode
 // ----------------------------------------------------------
-//
-EXPORT_C TInt CSecuritySettings::GetFdnMode (RMobilePhone::TMobilePhoneFdnStatus& aFdnMode)
+// qtdone
+EXPORT_C TInt CSecuritySettings::GetFdnMode(RMobilePhone::TMobilePhoneFdnStatus& aFdnMode)
     {
     /*****************************************************
-    *    Series 60 Customer / ETel
-    *    Series 60  ETel API
-    *****************************************************/
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecuritySettings::GetFdnMode()"));
-    #endif
+     *    Series 60 Customer / ETel
+     *    Series 60  ETel API
+     *****************************************************/
+    RDEBUG("0", 0);
     return iPhone.GetFdnStatus(aFdnMode);
     }
 
@@ -2426,24 +1201,12 @@
 // CSecuritySettings::ShowErrorNoteL()
 // Shows error note
 // ----------------------------------------------------------
-//
+// qtdone
 void CSecuritySettings::ShowErrorNoteL(TInt aError)
     {
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecuritySettings::ShowErrorNoteL()"));
-    #endif
-    // Let's create TextResolver instance for error resolving...
-    CTextResolver* textresolver = CTextResolver::NewLC(); 
-    // Resolve the error
-    TPtrC errorstring;
-    errorstring.Set( textresolver->ResolveErrorString( aError ) );
-    CAknNoteDialog* noteDlg = new (ELeave) CAknNoteDialog(REINTERPRET_CAST(CEikDialog**,&noteDlg));
-    noteDlg->PrepareLC(R_CODE_ERROR);
-    noteDlg->SetTextL((TDesC&)errorstring);
-    noteDlg->SetTimeout(CAknNoteDialog::ELongTimeout);
-    noteDlg->SetTone(CAknNoteDialog::EErrorTone);
-    noteDlg->RunLD();
-    CleanupStack::PopAndDestroy(); // resolver    
+    RDEBUG("aError", aError);
+
+    ShowResultNoteL(aError, CAknNoteDialog::EErrorTone);
     }
 
 //
@@ -2451,17 +1214,258 @@
 // CSecuritySettings::ShowResultNoteL()
 // Shows result note
 // ----------------------------------------------------------
-//
+// qtdone
 void CSecuritySettings::ShowResultNoteL(TInt aResourceID, CAknNoteDialog::TTone aTone)
-    {  
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecuritySettings::ShowResultNoteL()"));
-    RDebug::Print(_L("(SECUI)CSecuritySettings::ShowResultNoteL() Resource ID: %d"), aResourceID);
-    #endif
-    CAknNoteDialog* noteDlg = new (ELeave) CAknNoteDialog(REINTERPRET_CAST(CEikDialog**,&noteDlg));
-    noteDlg->SetTimeout(CAknNoteDialog::ELongTimeout);
-    noteDlg->SetTone(aTone);
-    noteDlg->ExecuteLD(aResourceID);
+    {
+    RDEBUG("aResourceID", aResourceID);
+
+    CHbDeviceMessageBoxSymbian* messageBox = CHbDeviceMessageBoxSymbian::NewL(CHbDeviceMessageBoxSymbian::EWarning);
+    CleanupStack::PushL(messageBox);
+    TInt satisfactoryIcon = 0;	// might change later, in some scenarios
+    _LIT(KText, "ShowResultNoteL: ");
+    TBuf<0x200> title;
+    TBuf<0x200> titleTr;
+    title.Zero();
+    titleTr.Zero();
+    title.Append(KText);
+    title.AppendNum(aResourceID);
+    _LIT(KSeparator, " ");
+    title.Append(KSeparator);
+    switch (aResourceID)
+        {
+        case 0:
+            titleTr.Append(_L("OK"));
+            title.Append(_L("OK"));
+            satisfactoryIcon = 1;
+            break;
+        case KErrGsm0707IncorrectPassword:
+            titleTr.Append(_L("txt_pin_code_dpophead_wrong_pin_code")); // TODO this also happens for lock-code
+            title.Append(_L("Incorrect Password"));
+            break;
+        case KErrAccessDenied:
+            titleTr.Append(_L("txt_pin_code_dpopinfo_access_denied"));
+            title.Append(_L("Access Denied"));
+            break;
+        case KErrGsmSSPasswordAttemptsViolation:
+            titleTr.Append(_L("KErrGsmSSPasswordAttemptsViolation"));
+            title.Append(_L("Password Attempts Violation"));
+            break;
+        case KErrLocked:
+            titleTr.Append(_L("KErrLocked"));
+            title.Append(_L("Locked"));
+            break;
+        case KErrGsm0707OperationNotAllowed:
+            titleTr.Append(_L("KErrGsm0707OperationNotAllowed"));
+            title.Append(_L("Operation Not Allowed"));
+            break;
+        case KErrAbort:
+            titleTr.Append(_L("KErrAbort"));
+            title.Append(_L("Abort"));
+            break;
+        case KErrNotSupported:
+            titleTr.Append(_L("txt_pin_code_dpopinfo_operation_not_supported"));
+            title.Append(_L("Not Supported"));
+            break;
+        case R_SEC_BLOCKED:
+            titleTr.Append(_L("txt_pin_code_dpopinfo_security_blocked"));
+            title.Append(_L("BLOCKED"));
+            break;
+        case R_CODE_ERROR:
+            titleTr.Append(_L("R_CODE_ERROR"));
+            title.Append(_L("ERROR"));
+            break;
+        case KErrGsmInvalidParameter:
+            titleTr.Append(_L("txt_pin_code_dpopinfo_gsm_invalid_parameter"));
+            title.Append(_L("Invalid Parameter"));
+            break;
+        case R_CONFIRMATION_NOTE:
+            titleTr.Append(_L("R_CONFIRMATION_NOTE"));
+            title.Append(_L("CONFIRMED"));
+            satisfactoryIcon = 1;
+            break;
+        case R_CODES_DONT_MATCH:
+            titleTr.Append(_L("R_CODES_DONT_MATCH"));
+            title.Append(_L("CODES DONT MATCH"));
+            break;
+        case R_PIN_CODE_CHANGED_NOTE:
+            titleTr.Append(_L("txt_pin_code_dpopinfo_code_chaged")); // note the spelling mistake "chaged"
+            title.Append(_L("PIN CODE CHANGED"));
+            satisfactoryIcon = 1;
+            break;
+        case R_SECURITY_CODE_CHANGED_NOTE:
+            titleTr.Append(_L("R_SECURITY_CODE_CHANGED_NOTE"));
+            title.Append(_L("SECURITY CODE CHANGED"));
+            satisfactoryIcon = 1;
+            break;
+        case R_SECUI_TEXT_AUTOLOCK_MUST_BE_ACTIVE:
+            titleTr.Append(_L("txt_pin_code_dpopinfo_autolock_must_be_active"));
+            title.Append(_L("AUTOLOCK MUST BE ACTIVE"));
+            break;
+        case KErrServerTerminated:
+            titleTr.Append(_L("KErrServerTerminated"));
+            title.Append(_L("Server Terminated"));
+            break;
+        case KErrServerBusy:
+            titleTr.Append(_L("KErrServerBusy"));
+            title.Append(_L("Server Busy"));
+            break;
+        case R_PIN2_REJECTED:
+            titleTr.Append(_L("txt_pin_code_dpopinfo_pin2_rejected"));
+            title.Append(_L("PIN2 REJECTED"));
+            break;
+        case R_OPERATION_NOT_ALLOWED:
+            titleTr.Append(_L("R_OPERATION_NOT_ALLOWED"));
+            title.Append(_L("OPERATION NOT ALLOWED"));
+            break;
+        case R_UPIN_NOT_ALLOWED:
+            titleTr.Append(_L("txt_pin_code_dpopinfo_upin_not_allowed"));
+            title.Append(_L("UPIN NOT ALLOWED"));
+            break;
+        case R_PIN_NOT_ALLOWED:
+            titleTr.Append(_L("R_PIN_NOT_ALLOWED"));
+            title.Append(_L("PIN NOT ALLOWED"));
+            break;
+        case R_INSERT_SIM:
+            titleTr.Append(_L("txt_pin_code_dpopinfo_insert_sim"));
+            title.Append(_L("INSERT SIM"));
+            break;
+        case R_SIM_ON:
+            titleTr.Append(_L("R_SIM_ON"));
+            title.Append(_L("SIM ON"));
+            break;
+        case KErrTimedOut:
+            titleTr.Append(_L("KErrTimedOut"));
+            title.Append(_L("Timed Out"));
+            break;
+        case R_PIN2_CODE_CHANGED_NOTE:
+            titleTr.Append(_L("R_PIN2_CODE_CHANGED_NOTE"));
+            title.Append(_L("PIN2 CODE CHANGED"));
+            break;
+        case KErrArgument:
+            titleTr.Append(_L("KErrArgument"));
+            title.Append(_L("Error Argument"));
+            break;
+        case R_SIM_OFF:
+            titleTr.Append(_L("R_SIM_OFF"));
+            title.Append(_L("SIM OFF"));
+            break;
+        case R_SIM_ALLREADY_OFF:
+            titleTr.Append(_L("R_SIM_ALLREADY_OFF"));
+            title.Append(_L("SIM ALLREADY OFF"));
+            break;
+        case R_SIM_NOT_ALLOWED:
+            titleTr.Append(_L("R_SIM_NOT_ALLOWED"));
+            title.Append(_L("SIM NOT ALLOWED"));
+            break;
+        case R_REMOTELOCK_INVALID_CODE:
+            titleTr.Append(_L("R_REMOTELOCK_INVALID_CODE"));
+            title.Append(_L("REMOTELOCK INVALID CODE"));
+            break;
+
+        case KErrTDevicelockPolicies+EDeviceLockAutolockperiod:
+            titleTr.Append(_L("EDeviceLockAutolockperiod"));
+            title.Append(_L("EDeviceLockAutolockperiod"));
+            break;
+        case KErrTDevicelockPolicies+EDeviceLockMaxAutolockPeriod:
+            titleTr.Append(_L("EDeviceLockMaxAutolockPeriod"));
+            title.Append(_L("EDeviceLockMaxAutolockPeriod"));
+            break;
+        case KErrTDevicelockPolicies+EDeviceLockMinlength:
+            titleTr.Append(_L("EDeviceLockMinlength"));
+            title.Append(_L("EDeviceLockMinlength"));
+            break;
+        case KErrTDevicelockPolicies+EDeviceLockMaxlength:
+            titleTr.Append(_L("EDeviceLockMaxlength"));
+            title.Append(_L("EDeviceLockMaxlength"));
+            break;
+        case KErrTDevicelockPolicies+EDeviceLockRequireUpperAndLower:
+            titleTr.Append(_L("EDeviceLockRequireUpperAndLower"));
+            title.Append(_L("EDeviceLockRequireUpperAndLower"));
+            break;
+        case KErrTDevicelockPolicies+EDeviceLockRequireCharsAndNumbers:
+            titleTr.Append(_L("EDeviceLockRequireCharsAndNumbers"));
+            title.Append(_L("EDeviceLockRequireCharsAndNumbers"));
+            break;
+        case KErrTDevicelockPolicies+EDeviceLockAllowedMaxRepeatedChars:
+            titleTr.Append(_L("EDeviceLockAllowedMaxRepeatedChars"));
+            title.Append(_L("EDeviceLockAllowedMaxRepeatedChars"));
+            break;
+        case KErrTDevicelockPolicies+EDeviceLockHistoryBuffer:
+            titleTr.Append(_L("EDeviceLockHistoryBuffer"));
+            title.Append(_L("EDeviceLockHistoryBuffer"));
+            break;
+        case KErrTDevicelockPolicies+EDeviceLockPasscodeExpiration:
+            titleTr.Append(_L("EDeviceLockPasscodeExpiration"));
+            title.Append(_L("EDeviceLockPasscodeExpiration"));
+            break;
+        case KErrTDevicelockPolicies+EDeviceLockMinChangeTolerance:
+            titleTr.Append(_L("EDeviceLockMinChangeTolerance"));
+            title.Append(_L("EDeviceLockMinChangeTolerance"));
+            break;
+        case KErrTDevicelockPolicies+EDeviceLockMinChangeInterval:
+            titleTr.Append(_L("EDeviceLockMinChangeInterval"));
+            title.Append(_L("EDeviceLockMinChangeInterval"));
+            break;
+        case KErrTDevicelockPolicies+EDeviceLockDisallowSpecificStrings:
+            titleTr.Append(_L("EDeviceLockDisallowSpecificStrings"));
+            title.Append(_L("EDeviceLockDisallowSpecificStrings"));
+            break;
+        case KErrTDevicelockPolicies+EDeviceLockAllowedMaxAtempts:
+            titleTr.Append(_L("EDeviceLockAllowedMaxAtempts"));
+            title.Append(_L("EDeviceLockAllowedMaxAtempts"));
+            break;
+        case KErrTDevicelockPolicies+EDeviceLockConsecutiveNumbers:
+            titleTr.Append(_L("EDeviceLockConsecutiveNumbers"));
+            title.Append(_L("EDeviceLockConsecutiveNumbers"));
+            break;
+        case KErrTDevicelockPolicies+EDeviceLockMinSpecialCharacters:
+            titleTr.Append(_L("EDeviceLockMinSpecialCharacters"));
+            title.Append(_L("EDeviceLockMinSpecialCharacters"));
+            break;
+        case KErrTDevicelockPolicies+EDeviceLockSingleCharRepeatNotAllowed:
+            titleTr.Append(_L("EDeviceLockSingleCharRepeatNotAllowed"));
+            title.Append(_L("EDeviceLockSingleCharRepeatNotAllowed"));
+            break;
+        case KErrTDevicelockPolicies+EDevicelockTotalPolicies:
+            titleTr.Append(_L("EDevicelockTotalPolicies"));
+            title.Append(_L("EDevicelockTotalPolicies"));
+            break;
+
+        default: // " "
+            titleTr.Append(_L("Specific Error"));
+            title.Append(_L("Specific Error"));
+            break;
+            /* These ones are still unused */
+            // txt_pin_code_dpopinfo_ln_attempts_remaining
+            // txt_pin_code_dpopinfo_emergency_calls_only
+            // txt_pin_code_dpopinfo_if_failed_be_ready_with_puk
+        }
+
+    HBufC* stringHolder;
+    RDEBUG("titleTr", 1);
+    stringHolder = HbTextResolverSymbian::LoadLC(titleTr); // titleTr  should I    TRAP( err,    ?
+    RDEBUG("got stringHolder", 1);
+    messageBox->SetTextL(stringHolder->Des()); // title
+    RDEBUG("aResourceID", aResourceID);
+    RDEBUGSTR(titleTr);
+    _LIT(KIconNameWondering, "qtg_small_smiley_wondering");
+    _LIT(KIconNameSmile, "qtg_small_smiley_smile");
+    if (satisfactoryIcon==1)
+        messageBox->SetIconNameL(KIconNameSmile);
+    else
+        messageBox->SetIconNameL(KIconNameWondering);
+
+    if (aTone == CAknNoteDialog::EErrorTone) // another case is EConfirmationTone
+        {
+        messageBox->SetTimeout(messageBox->Timeout() * 2); // errors are displayed double time
+        }
+    // messageBox->ShowL();
+    RDEBUG("calling ExecL", 0);
+    CHbDeviceMessageBoxSymbian::TButtonId selection = messageBox->ExecL();	// this guarantees that it waits for the dismiss/timeout
+    RDEBUG("called ExecL.selection", selection);
+    CleanupStack::PopAndDestroy(stringHolder);
+    CleanupStack::PopAndDestroy(); // messageBox
+
     }
 
 //
@@ -2469,139 +1473,1316 @@
 // CSecuritySettings::IsUpinSupportedL()
 // Return is UPIN supported
 // ----------------------------------------------------------
-//
+// qtdone
 EXPORT_C TBool CSecuritySettings::IsUpinSupportedL()
-{
-    TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ));
-    TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin ));
-    if(wcdmaSupported || upinSupported)
-      {
-    	#if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinSupported() BEGIN"));
-        #endif
-        #ifdef __WINS__
-    
-        return EFalse;
-    
-        #else  //WINS
-    
+    {
+    TBool wcdmaSupported(FeatureManager::FeatureSupported(KFeatureIdProtocolWcdma));
+    TBool upinSupported(FeatureManager::FeatureSupported(KFeatureIdUpin));
+    TBool isSupported = EFalse;
+    RDEBUG("wcdmaSupported", wcdmaSupported);
+    RDEBUG("upinSupported", upinSupported);
+    if (wcdmaSupported || upinSupported)
+        {
         RMobilePhone::TMobilePhoneLockInfoV1 lockInfo;
-        
+
         //get lock info
         RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo);
         iWait->SetRequestType(EMobilePhoneGetLockInfo);
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinSupported() GetLockInfo"));
-        #endif
+        RDEBUG("GetLockInfo", 0);
         iPhone.GetLockInfo(iWait->iStatus, RMobilePhone::ELockUniversalPin, lockInfoPkg);
+        RDEBUG("WaitForRequestL", 0);
         TInt res = iWait->WaitForRequestL();
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinSupported() GetLockInfo DONE"));
-        #endif
+        RDEBUG("WaitForRequestL res", res);
         if ((res == KErrNotSupported) || (res == KErrGsmInvalidParameter))
-        {
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinSupported(): NOT SUPPORTED"));
-            #endif
-            return EFalse;
+            {
+            RDEBUG("0", 0);
+            isSupported = EFalse;
+            }
+        else
+            {
+            RDEBUG("1", 1);
+            isSupported = ETrue;
+            }
         }
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinSupported(): SUPPORTED: %d"), res);
-        #endif
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinSupported() END"));
-        #endif
-        return ETrue;
-            
-        #endif //WINS
-      }
     else
-        return EFalse;
-}
+        isSupported = EFalse;
+    RDEBUG("isSupported", isSupported);
+    return isSupported;
+    }
 //
 // ----------------------------------------------------------
-// CSecuritySettings::IsCodeBlocked()
+// CSecuritySettings::IsUpinBlocked()
 // Return is a code blocked
 // ----------------------------------------------------------
-//
+// qtdone
 EXPORT_C TBool CSecuritySettings::IsUpinBlocked()
-{
-TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ));
-    TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin ));
-    if(wcdmaSupported || upinSupported)
-      {
-    #ifdef __WINS__
-        return EFalse;
-    #else//__WINS__
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinBlocked() BEGIN"));
-        #endif
-    	RMmCustomAPI::TSecurityCodeType secCodeType;
+    {
+    TBool wcdmaSupported(FeatureManager::FeatureSupported(KFeatureIdProtocolWcdma));
+    TBool upinSupported(FeatureManager::FeatureSupported(KFeatureIdUpin));
+    if (wcdmaSupported || upinSupported)
+        {
+        RMmCustomAPI::TSecurityCodeType secCodeType;
         secCodeType = RMmCustomAPI::ESecurityUniversalPin;
         TBool isBlocked = EFalse;
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinBlocked() IsBlocked"));
-        #endif
-        TInt ret = iCustomPhone.IsBlocked(secCodeType,isBlocked);
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinBlocked() DONE.RETURN: %d"), ret);
-        #endif
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinBlocked():isblocked: %d"), isBlocked);
-        #endif
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinBlocked() END"));
-        #endif
+        RDEBUG("IsBlocked", 0);
+        TInt ret = iCustomPhone.IsBlocked(secCodeType, isBlocked);
+        RDEBUG("ret", ret);
+        RDEBUG("isBlocked", isBlocked);
         return isBlocked;
-    #endif //__WINS__
-      }
+        }
     else
         return EFalse;
-}
+    }
 //
 // ----------------------------------------------------------
-// CSecuritySettings::GetActivePinCode()
+// CSecuritySettings::IsUpinActive()
 // Return the code active in current application (PIN/UPIN)
 // ----------------------------------------------------------
-//
+// qtdone
 EXPORT_C TBool CSecuritySettings::IsUpinActive()
-{
-    TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ));
-    TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin ));
-    if(wcdmaSupported || upinSupported)
-      {
-        #ifdef __WINS__
-        return EFalse;
-        #else//__WINS__
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinActive() BEGIN"));
-        #endif
-    	RMobilePhone::TMobilePhoneSecurityCode activePin;
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinActive() GetActivePin"));
-        #endif
+    {
+    TBool wcdmaSupported(FeatureManager::FeatureSupported(KFeatureIdProtocolWcdma));
+    TBool upinSupported(FeatureManager::FeatureSupported(KFeatureIdUpin));
+    if (wcdmaSupported || upinSupported)
+        {
+        RMobilePhone::TMobilePhoneSecurityCode activePin;
+        RDEBUG("GetActivePin", 0);
         iCustomPhone.GetActivePin(activePin);
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinActive() GetActivePin DONE"));
-        #endif
-    	if(activePin == RMobilePhone::ESecurityUniversalPin)
-        {
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinActive(): UPIN ACTIVE"));
-            #endif
-    		return ETrue;
+        RDEBUG("activePin", activePin);
+        RDEBUG("RMobilePhone::ESecurityUniversalPin",
+                RMobilePhone::ESecurityUniversalPin);
+        if (activePin == RMobilePhone::ESecurityUniversalPin)
+            {
+            return ETrue;
+            }
+        return EFalse;
         }
-         #if defined(_DEBUG)
-         RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinActive(): UPIN NOT ACTIVE"));
-         #endif
-         #if defined(_DEBUG)
-         RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinActive(): END"));
-         #endif
-    	return EFalse;
-        #endif //__WINS__
-      }
     else
         return EFalse;
-}
+    }
+
+/**************************/
+// qtdone
+EXPORT_C TInt CSecuritySettings::ChangePinParamsL(RMobilePhone::TMobilePassword aOldPassword, RMobilePhone::TMobilePassword aNewPassword, TInt aFlags, TDes& aCaption,
+        TInt aShowError)
+    {
+    RDEBUG("aFlags", aFlags);
+    RDEBUG("aOldPassword", 0);
+    RDEBUGSTR(aOldPassword);
+    RDEBUG("aNewPassword", 0);
+    RDEBUGSTR(aNewPassword);
+    RDEBUG("aCaption", 0);
+    RDEBUGSTR(aCaption);
+    RDEBUG("aShowError", aShowError);
+
+    /*****************************************************
+     *    Series 60 Customer / ETel
+     *    Series 60  ETel API
+     *****************************************************/
+
+    TInt simState;
+    TInt err(KErrGeneral);
+    err = RProperty::Get(KPSUidStartup, KPSSimStatus, simState);
+    User::LeaveIfError(err);
+    TBool simRemoved(simState == ESimNotPresent);
+
+    RDEBUG("simRemoved", simRemoved);
+    if (simRemoved)
+        {
+        ShowResultNoteL(R_INSERT_SIM, CAknNoteDialog::EErrorTone);
+        return KErrAccessDenied;
+        }
+    RMobilePhone::TMobilePhoneSecurityCode secCodeType;
+    secCodeType = RMobilePhone::ESecurityCodePin1;
+
+    RMobilePhone::TMobilePassword oldPassword;
+    RMobilePhone::TMobilePassword newPassword;
+    RMobilePhone::TMobilePhonePasswordChangeV1 passwords;
+    RMobilePhone::TMobilePhoneSecurityCodeInfoV5 codeInfo;
+    RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg codeInfoPkg(codeInfo);
+    RMobilePhone::TMobilePassword required_fourth;
+    TInt queryAccepted = KErrCancel;
+
+    RDEBUG("0", 0);
+
+    RMobilePhone::TMobilePhoneLock lockType;
+    RMobilePhone::TMobilePhoneLockInfoV1 lockInfo;
+
+    lockType = RMobilePhone::ELockICC;
+
+    RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo);
+    RDEBUG("0", 0);
+    iWait->SetRequestType(EMobilePhoneGetLockInfo);
+    TInt res = KErrNone;
+    RDEBUG("GetLockInfo", 0);
+    iPhone.GetLockInfo(iWait->iStatus, lockType, lockInfoPkg);
+    RDEBUG("WaitForRequestL", 0);
+    res = iWait->WaitForRequestL();
+    RDEBUG("WaitForRequestL res", res);
+#ifdef __WINS__
+    if (res == KErrTimedOut)
+        {
+        lockInfo.iSetting = RMobilePhone::ELockSetEnabled;
+        res = KErrNone;
+        }
+#endif
+
+    User::LeaveIfError(res);
+
+    if (lockInfo.iSetting == RMobilePhone::ELockSetDisabled)
+        {
+        RDEBUG("RMobilePhone::ELockSetDisabled",
+                RMobilePhone::ELockSetDisabled);
+        ShowResultNoteL(R_PIN_NOT_ALLOWED, CAknNoteDialog::EErrorTone);
+        return KErrAccessDenied;
+        }
+
+    RDEBUG("0", 0);
+    iWait->SetRequestType(EMobilePhoneGetSecurityCodeInfo);
+    RDEBUG("GetSecurityCodeInfo", 0);
+    iPhone.GetSecurityCodeInfo(iWait->iStatus, secCodeType, codeInfoPkg);
+    RDEBUG("WaitForRequestL", 0);
+    res = iWait->WaitForRequestL();
+    RDEBUG("WaitForRequestL res", res);
+#ifdef __WINS__
+    if (res == KErrNotSupported || res == KErrTimedOut)
+        {
+        res = KErrNone;
+        codeInfo.iRemainingEntryAttempts = KMaxNumberOfPINAttempts;
+        }
+#endif
+    User::LeaveIfError(res);
+
+    RDEBUG("codeInfo.iRemainingEntryAttempts",
+            codeInfo.iRemainingEntryAttempts);
+    if (codeInfo.iRemainingEntryAttempts == KMaxNumberOfPINAttempts)
+        codeInfo.iRemainingEntryAttempts = -1;
+
+    RDEBUG("checking aOldPassword", 0);
+    if (aOldPassword.Length() == 0)
+        {
+        RDEBUG("asking aOldPassword", 0);
+        /* request PIN using QT */
+        queryAccepted = KErrCancel;
+        CSecQueryUi *iSecQueryUi;
+        iSecQueryUi = CSecQueryUi::NewL();
+        TBuf<0x100> title;
+        title.Zero();
+        HBufC* stringHolder = HbTextResolverSymbian::LoadLC(_L("txt_pin_code_dialog_pin_code"));
+        title.Append(stringHolder->Des());
+        CleanupStack::PopAndDestroy(stringHolder);
+        title.Append(_L("$"));
+        title.AppendNum(codeInfo.iRemainingEntryAttempts);
+        queryAccepted = iSecQueryUi->SecQueryDialog(title, oldPassword, SEC_C_PIN_CODE_MIN_LENGTH, SEC_C_PIN_CODE_MAX_LENGTH, ESecUiAlphaNotSupported | ESecUiCancelSupported
+                | ESecUiEmergencyNotSupported | secCodeType);
+        RDEBUG("oldPassword", 0);
+        RDEBUGSTR(oldPassword);
+        RDEBUG("queryAccepted", queryAccepted);
+        delete iSecQueryUi;
+        if (queryAccepted != KErrNone)
+            return KErrAbort;
+        /* end request PIN using QT */
+
+        // verify it now, so that the user doesn't need to see the error _after_ typing the new ones
+        RDEBUG("VerifySecurityCode", 0);
+        iPhone.VerifySecurityCode(iWait->iStatus, secCodeType, oldPassword, required_fourth);
+        RDEBUG("WaitForRequestL", 0);
+        res = iWait->WaitForRequestL();
+        RDEBUG("WaitForRequestL res", res);
+#ifdef __WINS__
+        if (res == KErrNotSupported)
+            res = KErrNone;
+#endif
+        if (res != KErrNone)
+            {
+            ShowResultNoteL(res, CAknNoteDialog::EErrorTone);
+            return res; // not sure if it's wise to exit now.
+            }
+
+        newPassword = _L("");
+        }
+    else
+        {
+        oldPassword.Copy(aOldPassword);
+        newPassword.Copy(aNewPassword);
+        }
+
+    RDEBUG("res", res);
+    while (newPassword.Length() == 0)
+        {
+        // this is not needed because the dialog won't allow to close, unless codes match
+        // codes do not match -> note -> ask new pin and verification codes again
+        // if(newPassword.Length()>0)
+        //  ShowResultNoteL(R_CODES_DONT_MATCH, CAknNoteDialog::EErrorTone);
+
+        newPassword = _L("");
+
+        // new pin code query
+        if (aOldPassword.Length() == 0) // only if input parameters are empty
+            {
+            queryAccepted = KErrCancel;
+            CSecQueryUi *iSecQueryUi;
+            iSecQueryUi = CSecQueryUi::NewL();
+            // this queries both, and verifies itself
+            TBuf<0x100> title;
+            title.Zero();
+            HBufC* stringHolder = HbTextResolverSymbian::LoadLC(_L("txt_pin_code_dialog_new_pin_code"));
+            title.Append(stringHolder->Des());
+            CleanupStack::PopAndDestroy(stringHolder);
+            title.Append(_L("|"));
+            HBufC* stringHolder2 = HbTextResolverSymbian::LoadLC(_L("txt_pin_code_dialog_verify_new_pin_code"));
+            title.Append(stringHolder2->Des());
+            CleanupStack::PopAndDestroy(stringHolder2);
+            queryAccepted = iSecQueryUi->SecQueryDialog(title, newPassword, SEC_C_PIN_CODE_MIN_LENGTH, SEC_C_PIN_CODE_MAX_LENGTH, ESecUiAlphaNotSupported | ESecUiCancelSupported
+                    | ESecUiEmergencyNotSupported | secCodeType);
+            RDEBUG("newPassword", 1);
+            RDEBUGSTR(newPassword);
+            RDEBUG("queryAccepted", queryAccepted);
+            delete iSecQueryUi;
+            if (queryAccepted != KErrNone)
+                return KErrAbort;
+            RDEBUG("0", 0);
+            }
+        }
+
+    // send code
+    passwords.iOldPassword = oldPassword;
+    passwords.iNewPassword = newPassword;
+    RDEBUG("passwords", 0);
+    RDEBUGSTR(passwords.iOldPassword);
+    RDEBUGSTR(passwords.iNewPassword);
+    RDEBUG("SetRequestType", 0);
+    iWait->SetRequestType(EMobilePhoneChangeSecurityCode);
+    RDEBUG("ChangeSecurityCode", 0);
+    iPhone.ChangeSecurityCode(iWait->iStatus, secCodeType, passwords);
+    RDEBUG("WaitForRequestL", 0);
+    res = iWait->WaitForRequestL();
+    RDEBUG("WaitForRequestL res", res);
+#ifdef __WINS__
+    if (res == KErrNotSupported)
+        res = KErrNone;
+#endif
+
+    switch (res)
+        {
+        case KErrNone:
+            {
+            // code changed 
+            ShowResultNoteL(R_PIN_CODE_CHANGED_NOTE, CAknNoteDialog::EConfirmationTone);
+            break;
+            }
+        case KErrGsm0707IncorrectPassword:
+        case KErrAccessDenied:
+            {
+            // code was entered erroneously. This is strange, because it was verified before
+            ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone);
+            ChangePinParamsL(_L(""), _L(""), aFlags, aCaption, aShowError);
+            break;
+            }
+        case KErrGsmSSPasswordAttemptsViolation:
+        case KErrLocked:
+            {
+            // Pin1 blocked! 
+            return KErrLocked;
+            }
+        case KErrGsm0707OperationNotAllowed:
+            {
+            // not allowed with this sim
+            ShowResultNoteL(R_OPERATION_NOT_ALLOWED, CAknNoteDialog::EErrorTone);
+            return KErrGsm0707OperationNotAllowed;
+            }
+        case KErrAbort:
+            {
+            break;
+            }
+        default:
+            {
+            ShowErrorNoteL(res);
+            ChangePinParamsL(_L(""), _L(""), aFlags, aCaption, aShowError);
+            break;
+            }
+        }
+    return res;
+    }
+/*********************************************/
+// qtdone
+EXPORT_C TInt CSecuritySettings::ChangeUPinParamsL(RMobilePhone::TMobilePassword aOldPassword, RMobilePhone::TMobilePassword aNewPassword, TInt aFlags, TDes& aCaption,
+        TInt aShowError)
+    {
+    RDEBUG("aFlags", aFlags);
+    // the password parameters are not used
+    if (aOldPassword.Length() > 0)
+        RDEBUGSTR(aOldPassword);
+    if (aNewPassword.Length() > 0)
+        RDEBUGSTR(aNewPassword);
+
+    if (aCaption.Length() > 0)
+        RDEBUGSTR(aCaption);
+
+    TBool wcdmaSupported(FeatureManager::FeatureSupported(KFeatureIdProtocolWcdma));
+    TBool upinSupported(FeatureManager::FeatureSupported(KFeatureIdUpin));
+    if (!(wcdmaSupported || upinSupported))
+        {
+        RDEBUG("! upinSupported", upinSupported);
+        return KErrAccessDenied;
+        }
+
+    RDEBUG("upinSupported", upinSupported);
+    TInt simState;
+    TInt err(KErrGeneral);
+    err = RProperty::Get(KPSUidStartup, KPSSimStatus, simState);
+    User::LeaveIfError(err);
+    TBool simRemoved(simState == ESimNotPresent);
+
+    if (simRemoved)
+        {
+        ShowResultNoteL(R_INSERT_SIM, CAknNoteDialog::EErrorTone);
+        return KErrAccessDenied;
+        }
+
+    RMobilePhone::TMobilePhoneSecurityCode secCodeType;
+    secCodeType = RMobilePhone::ESecurityUniversalPin;
+
+    RMobilePhone::TMobilePassword oldPassword;
+    RMobilePhone::TMobilePassword newPassword;
+    RMobilePhone::TMobilePassword verifcationPassword;
+    RMobilePhone::TMobilePhonePasswordChangeV1 passwords;
+    RMobilePhone::TMobilePhoneSecurityCodeInfoV5 codeInfo;
+    RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg codeInfoPkg(codeInfo);
+    RMobilePhone::TMobilePhoneLock lockType;
+    RMobilePhone::TMobilePhoneLockInfoV1 lockInfo;
+    TInt queryAccepted = KErrCancel;
+
+    lockType = RMobilePhone::ELockUniversalPin;
+
+    RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo);
+    iWait->SetRequestType(EMobilePhoneGetLockInfo);
+    RDEBUG("GetLockInfo", 0);
+    iPhone.GetLockInfo(iWait->iStatus, lockType, lockInfoPkg);
+    RDEBUG("WaitForRequestL", 0);
+    TInt res = iWait->WaitForRequestL();
+    RDEBUG("WaitForRequestL res", res);
+#ifdef __WINS__
+    if (res == KErrNotSupported)
+        {
+        res = KErrNone;
+        lockInfo.iSetting = RMobilePhone::ELockSetEnabled;
+        }
+#endif
+    User::LeaveIfError(res);
+
+    RDEBUG("lockInfo.iSetting", lockInfo.iSetting);
+    RDEBUG("RMobilePhone::ELockSetDisabled", RMobilePhone::ELockSetDisabled);
+    if (lockInfo.iSetting == RMobilePhone::ELockSetDisabled)
+        {
+        ShowResultNoteL(R_UPIN_NOT_ALLOWED, CAknNoteDialog::EErrorTone);
+        return KErrAccessDenied;
+        }
+
+    iWait->SetRequestType(EMobilePhoneGetSecurityCodeInfo);
+    RDEBUG("GetSecurityCodeInfo", 0);
+    iPhone.GetSecurityCodeInfo(iWait->iStatus, secCodeType, codeInfoPkg);
+    RDEBUG("WaitForRequestL", 0);
+    res = iWait->WaitForRequestL();
+    RDEBUG("WaitForRequestL res", res);
+#ifdef __WINS__
+    if (res == KErrNotSupported || res == KErrTimedOut)
+        {
+        res = KErrNone;
+        codeInfo.iRemainingEntryAttempts = KMaxNumberOfPINAttempts;
+        }
+#endif
+    User::LeaveIfError(res);
+
+    RDEBUG("codeInfo.iRemainingEntryAttempts",
+            codeInfo.iRemainingEntryAttempts);
+    if (codeInfo.iRemainingEntryAttempts == KMaxNumberOfPINAttempts)
+        codeInfo.iRemainingEntryAttempts = -1;
+
+    queryAccepted = KErrCancel;
+    CSecQueryUi *iSecQueryUi;
+    iSecQueryUi = CSecQueryUi::NewL();
+    TBuf<0x100> title;
+    title.Zero();
+    HBufC* stringHolder = HbTextResolverSymbian::LoadLC(_L("txt_pin_code_dialog_upin_code"));
+    title.Append(stringHolder->Des());
+    CleanupStack::PopAndDestroy(stringHolder);
+    title.Append(_L("$"));
+    title.AppendNum(codeInfo.iRemainingEntryAttempts);
+    queryAccepted = iSecQueryUi->SecQueryDialog(title, oldPassword, SEC_C_PIN_CODE_MIN_LENGTH, SEC_C_PIN_CODE_MAX_LENGTH, ESecUiAlphaNotSupported | ESecUiCancelSupported
+            | ESecUiEmergencyNotSupported | secCodeType);
+    RDEBUG("oldPassword", 0);
+    RDEBUGSTR(oldPassword);
+    RDEBUG("queryAccepted", queryAccepted);
+    delete iSecQueryUi;
+    if (queryAccepted != KErrNone)
+        return KErrAbort;
+    res = KErrNone; // indicate that everything is ok
+
+        {
+        queryAccepted = KErrCancel;
+        CSecQueryUi * iSecQueryUi;
+        iSecQueryUi = CSecQueryUi::NewL();
+        // this queries both, and verifies itself
+        TBuf<0x100> title;
+        title.Zero();
+
+        HBufC* stringHolder = HbTextResolverSymbian::LoadLC(_L("txt_pin_code_dialog_new_upin_code"));
+        title.Append(stringHolder->Des());
+        CleanupStack::PopAndDestroy(stringHolder);
+        title.Append(_L("|"));
+        HBufC* stringHolder2 = HbTextResolverSymbian::LoadLC(_L("txt_pin_code_dialog_retype_upin_code"));
+        title.Append(stringHolder2->Des());
+        CleanupStack::PopAndDestroy(stringHolder2);
+        queryAccepted = iSecQueryUi->SecQueryDialog(title, newPassword, SEC_C_PIN_CODE_MIN_LENGTH, SEC_C_PIN_CODE_MAX_LENGTH, ESecUiAlphaNotSupported | ESecUiCancelSupported
+                | ESecUiEmergencyNotSupported | secCodeType);
+        RDEBUG("newPassword", 0);
+        RDEBUGSTR(newPassword);
+        RDEBUG("queryAccepted", queryAccepted);
+        delete iSecQueryUi;
+        if (queryAccepted != KErrNone)
+            return KErrAbort;
+        }
+    // send code
+    passwords.iOldPassword = oldPassword;
+    passwords.iNewPassword = newPassword;
+    iWait->SetRequestType(EMobilePhoneChangeSecurityCode);
+    RDEBUG("ChangeSecurityCode", 0);
+    iPhone.ChangeSecurityCode(iWait->iStatus, secCodeType, passwords);
+    RDEBUG("WaitForRequestL", 0);
+    res = iWait->WaitForRequestL();
+    RDEBUG("WaitForRequestL res", res);
+#ifdef __WINS__
+    if (res == KErrNotSupported)
+        res = KErrNone;
+#endif
+    switch (res)
+        {
+        case KErrNone:
+            {
+            // code changed 
+            ShowResultNoteL(R_UPIN_CODE_CHANGED_NOTE, CAknNoteDialog::EConfirmationTone);
+            break;
+            }
+        case KErrGsm0707IncorrectPassword:
+        case KErrAccessDenied:
+            {
+            // code was entered erroneously
+            ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone);
+            ChangeUPinParamsL(_L(""), _L(""), aFlags, aCaption, aShowError);
+            break;
+            }
+        case KErrGsmSSPasswordAttemptsViolation:
+        case KErrLocked:
+            {
+            return KErrLocked;
+            }
+        case KErrGsm0707OperationNotAllowed:
+            {
+            // not allowed with this sim
+            ShowResultNoteL(R_OPERATION_NOT_ALLOWED, CAknNoteDialog::EErrorTone);
+            return KErrGsm0707OperationNotAllowed;
+            }
+        case KErrAbort:
+            {
+            break;
+            }
+        default:
+            {
+            ShowErrorNoteL(res);
+            ChangeUPinParamsL(_L(""), _L(""), aFlags, aCaption, aShowError);
+            break;
+            }
+        }
+    return res;
+    }
+/***************************************/
+// qtdone
+EXPORT_C TInt CSecuritySettings::ChangePin2ParamsL(RMobilePhone::TMobilePassword aOldPassword, RMobilePhone::TMobilePassword aNewPassword, TInt aFlags, TDes& aCaption,
+        TInt aShowError)
+    {
+    RDEBUG("aFlags", aFlags);
+    // the password parameters are not used
+    if (aOldPassword.Length() > 0)
+        RDEBUGSTR(aOldPassword);
+    if (aNewPassword.Length() > 0)
+        RDEBUGSTR(aNewPassword);
+
+    if (aCaption.Length() > 0)
+        RDEBUGSTR(aCaption);
+
+    TInt simState;
+    TInt err(KErrGeneral);
+    err = RProperty::Get(KPSUidStartup, KPSSimStatus, simState);
+    User::LeaveIfError(err);
+    TBool simRemoved(simState == ESimNotPresent);
+
+    if (simRemoved)
+        {
+        ShowResultNoteL(R_INSERT_SIM, CAknNoteDialog::EErrorTone);
+        return KErrAccessDenied;
+        }
+
+    RMmCustomAPI::TSecurityCodeType secCodeType;
+    RMobilePhone::TMobilePhoneSecurityCode EtelsecCodeType;
+    secCodeType = RMmCustomAPI::ESecurityCodePin2;
+    RMobilePhone::TMobilePassword oldPassword;
+    RMobilePhone::TMobilePassword newPassword;
+    RMobilePhone::TMobilePassword verifcationPassword;
+    RMobilePhone::TMobilePhonePasswordChangeV1 passwords;
+    RMobilePhone::TMobilePhoneSecurityCodeInfoV5 codeInfo;
+    RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg codeInfoPkg(codeInfo);
+    TInt queryAccepted = KErrCancel;
+
+    // check if pin2 is blocked...
+    TBool isBlocked = EFalse;
+
+    TInt ret = iCustomPhone.IsBlocked(secCodeType, isBlocked);
+    RDEBUG("isBlocked", isBlocked);
+    if (isBlocked)
+        return KErrAccessDenied;
+    RDEBUG("ret", ret);
+#ifdef __WINS__
+    if (ret == KErrNotSupported)
+        ret = KErrNone;
+#endif
+
+    if (ret != KErrNone)
+        {
+        switch (ret)
+            {
+            // PIN2 Blocked.
+            case KErrGsm0707SIMPuk2Required:
+                break;
+            case KErrGsmSSPasswordAttemptsViolation:
+            case KErrLocked:
+                // Pin2 features blocked permanently!
+                ShowResultNoteL(R_PIN2_REJECTED, CAknNoteDialog::EConfirmationTone);
+                break;
+            case KErrGsm0707SimNotInserted:
+                // not allowed with this sim
+                ShowResultNoteL(R_OPERATION_NOT_ALLOWED, CAknNoteDialog::EErrorTone);
+                break;
+            default:
+                ShowErrorNoteL(ret);
+                break;
+            }
+        return KErrAccessDenied;
+        }
+
+    // Security code must be changed to Etel API format
+    // Custom API Pin1 and Pin2 have the same enum values as the Etel ones
+    EtelsecCodeType = (RMobilePhone::TMobilePhoneSecurityCode) secCodeType;
+    iWait->SetRequestType(EMobilePhoneGetSecurityCodeInfo);
+    RDEBUG("GetSecurityCodeInfo", 0);
+    iPhone.GetSecurityCodeInfo(iWait->iStatus, EtelsecCodeType, codeInfoPkg);
+    RDEBUG("WaitForRequestL", 0);
+    ret = iWait->WaitForRequestL();
+    RDEBUG("WaitForRequestL ret", ret);
+#ifdef __WINS__
+    if (ret == KErrNotSupported || ret == KErrTimedOut)
+        {
+        codeInfo.iRemainingEntryAttempts = 1;
+        ret = KErrNone;
+        }
+#endif
+    User::LeaveIfError(ret);
+
+    RDEBUG("codeInfo.iRemainingEntryAttempts",
+            codeInfo.iRemainingEntryAttempts);
+    if (codeInfo.iRemainingEntryAttempts == KMaxNumberOfPINAttempts)
+        codeInfo.iRemainingEntryAttempts = -1;
+
+    /* request PIN using QT */
+    queryAccepted = KErrCancel;
+    CSecQueryUi *iSecQueryUi;
+    iSecQueryUi = CSecQueryUi::NewL();
+    TBuf<0x100> title;
+    title.Zero();
+    HBufC* stringHolder = HbTextResolverSymbian::LoadLC(_L("txt_pin_code_dialog_pin2_code"));
+    title.Append(stringHolder->Des());
+    CleanupStack::PopAndDestroy(stringHolder);
+    title.Append(_L("$"));
+    title.AppendNum(codeInfo.iRemainingEntryAttempts);
+    queryAccepted = iSecQueryUi->SecQueryDialog(title, oldPassword, SEC_C_PIN2_CODE_MIN_LENGTH, SEC_C_PIN2_CODE_MAX_LENGTH, ESecUiAlphaNotSupported | ESecUiCancelSupported
+            | ESecUiEmergencyNotSupported | secCodeType);
+    RDEBUG("oldPassword", 0);
+    RDEBUGSTR(oldPassword);
+    RDEBUG("queryAccepted", queryAccepted);
+    delete iSecQueryUi;
+    if (queryAccepted != KErrNone)
+        return KErrAbort;
+    /* end request PIN using QT */
+
+    /* request PIN using QT */
+        {
+        queryAccepted = KErrCancel;
+        CSecQueryUi * iSecQueryUi;
+        iSecQueryUi = CSecQueryUi::NewL();
+        // this queries both, and verifies itself
+        TBuf<0x100> title;
+        title.Zero();
+        HBufC* stringHolder = HbTextResolverSymbian::LoadLC(_L("txt_pin_code_dialog_new_pin2_code"));
+        title.Append(stringHolder->Des());
+        CleanupStack::PopAndDestroy(stringHolder);
+        title.Append(_L("|"));
+        HBufC* stringHolder2 = HbTextResolverSymbian::LoadLC(_L("Verify"));
+        title.Append(stringHolder2->Des());
+        CleanupStack::PopAndDestroy(stringHolder2);
+        queryAccepted = iSecQueryUi->SecQueryDialog(title, newPassword, SEC_C_PIN2_CODE_MIN_LENGTH, SEC_C_PIN2_CODE_MAX_LENGTH, ESecUiAlphaNotSupported | ESecUiCancelSupported
+                | ESecUiEmergencyNotSupported | secCodeType);
+        RDEBUG("newPassword", 0);
+        RDEBUGSTR(newPassword);
+        RDEBUG("queryAccepted", queryAccepted);
+        delete iSecQueryUi;
+        if (queryAccepted != KErrNone)
+            return KErrAbort;
+        }
+    /* end request PIN using QT */
+
+    passwords.iOldPassword = oldPassword;
+    passwords.iNewPassword = newPassword;
+    iWait->SetRequestType(EMobilePhoneChangeSecurityCode);
+    RDEBUG("ChangeSecurityCode", 0);
+    iPhone.ChangeSecurityCode(iWait->iStatus, EtelsecCodeType, passwords);
+    RDEBUG("WaitForRequestL", 0);
+    TInt res = iWait->WaitForRequestL();
+    RDEBUG("WaitForRequestL res", res);
+#ifdef __WINS__
+    if (res == KErrNotSupported)
+        res = KErrNone;
+#endif
+    switch (res)
+        {
+        case KErrNone:
+            {
+            // code changed 
+            ShowResultNoteL(R_PIN2_CODE_CHANGED_NOTE, CAknNoteDialog::EConfirmationTone);
+            break;
+            }
+        case KErrGsm0707IncorrectPassword:
+        case KErrAccessDenied:
+            {
+            ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone);
+            ChangePin2ParamsL(_L(""), _L(""), aFlags, aCaption, aShowError);
+            break;
+            }
+        case KErrGsmSSPasswordAttemptsViolation:
+        case KErrLocked:
+            {
+            // Pin2 blocked!
+            ShowResultNoteL(KErrLocked, CAknNoteDialog::EErrorTone);
+            CSecurityHandler* handler = new (ELeave) CSecurityHandler(iPhone);
+            CleanupStack::PushL(handler);
+            handler->HandleEventL(RMobilePhone::EPuk2Required);
+            CleanupStack::PopAndDestroy(handler); // handler    
+            return KErrLocked;
+            }
+        case KErrGsm0707OperationNotAllowed:
+            {
+            // not allowed with this sim
+            ShowResultNoteL(R_OPERATION_NOT_ALLOWED, CAknNoteDialog::EErrorTone);
+            return KErrGsm0707OperationNotAllowed;
+            }
+        case KErrAbort:
+            {
+            break;
+            }
+        default:
+            {
+            ShowErrorNoteL(res);
+            ChangePin2ParamsL(_L(""), _L(""), aFlags, aCaption, aShowError);
+            break;
+            }
+        }
+    return res;
+    }
+/************************************************/
+// qtdone
+EXPORT_C TInt CSecuritySettings::ChangeSecCodeParamsL(RMobilePhone::TMobilePassword aOldPassword, RMobilePhone::TMobilePassword aNewPassword, TInt aFlags, TDes& aCaption,
+        TInt aShowError)
+    {
+    RDEBUG("aFlags", aFlags);
+    RDEBUG("aShowError", aShowError);
+    /*****************************************************
+     *    Series 60 Customer / ETel
+     *    Series 60  ETel API
+     *****************************************************/
+    TInt res = KErrNone;
+    TInt queryAccepted = KErrCancel;
+    RMobilePhone::TMobilePassword newPassword;
+
+    RMobilePhone::TMobilePhoneSecurityCode secCodeType;
+    secCodeType = RMobilePhone::ESecurityCodePhonePassword;
+    RMobilePhone::TMobilePassword oldPassword;
+    RMobilePhone::TMobilePassword required_fourth;
+    RMobilePhone::TMobilePhonePasswordChangeV1 passwords;
+
+		// confirm that it can be changed now
+		{
+       RArray<TDevicelockPolicies> aFailedPolicies;
+       TDevicelockPolicies failedPolicy;
+       TInt retLockcode = KErrNone;
+       RSCPClient scpClient;
+       retLockcode = scpClient.Connect();
+       RDEBUG( "retLockcode", retLockcode );
+       if(retLockcode == KErrNone )
+       	{
+	       RDEBUG( "scpClient.VerifyNewLockcodeAgainstPolicies", 0 );
+	       retLockcode = scpClient.IsLockcodeChangeAllowedNow( aFailedPolicies );
+	       RDEBUG( "retLockcode", retLockcode );
+	       RDEBUG( "aFailedPolicies.Count()", aFailedPolicies.Count() );
+	       res = retLockcode;
+	       for(TInt i=0; i<aFailedPolicies.Count(); i++)
+		       {
+		       failedPolicy = aFailedPolicies[i];
+		       RDEBUG( "failedPolicy", failedPolicy );
+		       // it could also be res = KErrGsm0707IncorrectPassword;
+		       res = KErrTDevicelockPolicies + failedPolicy;
+		       }
+	     	 scpClient.Close();
+	     	 if(retLockcode!=KErrNone)
+	     	 		{
+	     	 		ShowResultNoteL(res, CAknNoteDialog::EErrorTone);
+     	 	 		return res;
+     	 	 		}
+				}
+			else
+				{
+					RDEBUG( "failed connecting to SCP", retLockcode );
+					// what to do? let's assume that we don't need special policies.
+				}
+		}
+
+    RDEBUG("aOldPassword.Length()", aOldPassword.Length());
+    if (aOldPassword.Length() == 0)
+        {
+        // aOldPassword was not given as a parameter
+        queryAccepted = KErrCancel;
+        CSecQueryUi *iSecQueryUi;
+        iSecQueryUi = CSecQueryUi::NewL();
+        TBuf<0x100> title;
+        title.Zero();
+        HBufC* stringHolder = HbTextResolverSymbian::LoadLC(_L("txt_pin_code_dialog_sec_code"));
+        title.Append(stringHolder->Des());
+        CleanupStack::PopAndDestroy(stringHolder);
+        queryAccepted = iSecQueryUi->SecQueryDialog(title, oldPassword, SEC_C_SECURITY_CODE_MIN_LENGTH, SEC_C_SECURITY_CODE_MAX_LENGTH, ESecUiAlphaSupported
+                | ESecUiCancelSupported | ESecUiEmergencyNotSupported | secCodeType);
+        RDEBUG("oldPassword", 0);
+        RDEBUGSTR(oldPassword);
+        RDEBUG("queryAccepted", queryAccepted);
+        delete iSecQueryUi;
+        if (queryAccepted != KErrNone)
+            return KErrAbort;
+        newPassword = _L("");
+        }
+    else
+        {
+        RDEBUG("parameter includes oldPassword", 1);
+        oldPassword.Copy(aOldPassword);
+        newPassword.Copy(aNewPassword);
+        }
+
+    // check current code before proceeding
+    RDEBUG("EMobilePhoneVerifySecurityCode", EMobilePhoneVerifySecurityCode);
+    iWait->SetRequestType(EMobilePhoneVerifySecurityCode);	// 0x59F1
+    RDEBUG("VerifySecurityCode", 0);
+    iPhone.VerifySecurityCode(iWait->iStatus, secCodeType, oldPassword, required_fourth);
+    RDEBUG("WaitForRequestL", 0);
+    res = iWait->WaitForRequestL();
+    RDEBUG("WaitForRequestL res", res);
+#ifdef __WINS__
+    if (res == KErrNotSupported)
+        res = KErrNone;
+#endif
+
+    if (res != KErrNone)
+        {
+        ShowResultNoteL(res, CAknNoteDialog::EErrorTone);
+        return res;
+        }
+
+    while (newPassword.Length() == 0)
+        {
+        // codes do not match -> note -> ask new pin and verification codes again  
+        // note that this never happens because the dialog doesn't dismiss until both codes match
+        if (newPassword.Length() > 0)
+            ShowResultNoteL(R_CODES_DONT_MATCH, CAknNoteDialog::EErrorTone);
+
+            {
+            queryAccepted = KErrCancel;
+            CSecQueryUi *iSecQueryUi;
+            iSecQueryUi = CSecQueryUi::NewL();
+            // will ask both codes and compare itself
+            // mix, max , alpha is handled using TARM params, in the dialog itself
+            TInt lType = ESecUiAlphaSupported | ESecUiCancelSupported | ESecUiEmergencyNotSupported | secCodeType;
+            RDEBUG("lType", lType);
+            TBuf<0x100> title;
+            title.Zero();
+            HBufC* stringHolder = HbTextResolverSymbian::LoadLC(_L("txt_pin_code_dialog_new_sec_code"));
+            title.Append(stringHolder->Des());
+            CleanupStack::PopAndDestroy(stringHolder);
+            title.Append(_L("|"));
+            HBufC* stringHolder2 = HbTextResolverSymbian::LoadLC(_L("Verify"));
+            title.Append(stringHolder2->Des());
+            CleanupStack::PopAndDestroy(stringHolder2);
+            queryAccepted = iSecQueryUi->SecQueryDialog(title, newPassword, SEC_C_SECURITY_CODE_MIN_LENGTH, SEC_C_SECURITY_CODE_MAX_LENGTH, lType);
+            RDEBUG("newPassword", 0);
+            RDEBUGSTR(newPassword);
+            RDEBUG("queryAccepted", queryAccepted);
+            delete iSecQueryUi;
+            if (queryAccepted != KErrNone)
+                return KErrAbort;
+            }
+
+        } // while
+
+			 // Confirm that the new code is nice.
+			 // This is also done on every key-press in the dialog, but it doesn't harm to repeat.
+			 // In fact this is needed for the case when newPassword is provided.
+       RArray<TDevicelockPolicies> aFailedPolicies;
+       TDevicelockPolicies failedPolicy;
+       TInt retLockcode = KErrNone;
+       RSCPClient scpClient;
+       retLockcode = scpClient.Connect();
+       RDEBUG( "retLockcode", retLockcode );
+       if(retLockcode == KErrNone )
+       	{
+	       RDEBUG( "scpClient.VerifyNewLockcodeAgainstPolicies", 0 );
+	       retLockcode = scpClient.VerifyNewLockcodeAgainstPolicies( newPassword, aFailedPolicies );
+	       RDEBUG( "retLockcode", retLockcode );
+	       RDEBUG( "aFailedPolicies.Count()", aFailedPolicies.Count() );
+	       for(TInt i=0; i<aFailedPolicies.Count(); i++)
+		       {
+		       failedPolicy = aFailedPolicies[i];
+		       RDEBUG( "failedPolicy", failedPolicy );
+		       // it could also be res = KErrGsm0707IncorrectPassword;
+		       res = KErrTDevicelockPolicies + failedPolicy;
+		       }
+	     	 scpClient.Close();
+				}
+			else
+				{
+					RDEBUG( "failed connecting to SCP", retLockcode );
+					// what to do? let's assume that we don't need special policies.
+				}
+
+    // change code
+    RDEBUG("res", res);
+    if (res == KErrNone)
+        {
+        passwords.iOldPassword = oldPassword;
+        passwords.iNewPassword = newPassword;
+        iWait->SetRequestType(EMobilePhoneChangeSecurityCode);
+        RDEBUG("ChangeSecurityCode", 0);
+        iPhone.ChangeSecurityCode(iWait->iStatus, secCodeType, passwords);
+        RDEBUG("WaitForRequestL", 0);
+        res = iWait->WaitForRequestL();
+        RDEBUG("WaitForRequestL res", res);
+#ifdef __WINS__
+        if (res == KErrNotSupported)
+            res = KErrNone;
+#endif
+
+        if (res == KErrNone && 1 == 0) // TODO not possible to enable because it asks code again
+            {
+            RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockPhoneDevice;
+            RMobilePhone::TMobilePhoneLockSetting lockChangeSetting = RMobilePhone::ELockSetEnabled;
+            iWait->SetRequestType(EMobilePhoneSetLockSetting);
+            RDEBUG("SetLockSetting", 0);
+            iPhone.SetLockSetting(iWait->iStatus, lockType, lockChangeSetting);
+            RDEBUG("WaitForRequestL", 0);
+            res = iWait->WaitForRequestL();
+            RDEBUG("WaitForRequestL res", res);
+#ifdef __WINS__
+            if (res == KErrNotSupported || res == KErrTimedOut)
+                res = KErrNone;
+#endif
+            }
+        }
+
+    RDEBUG("res", res);
+    switch (res)
+        {
+        case KErrNone:
+            {
+            // code changed ... unless TARM rejects it
+                {
+                // Send the changed code to the SCP server, even with device lock enhancements.
+                RDEBUG("scpClient.Connect", 0);
+                RSCPClient scpClient;
+                TSCPSecCode newScpCode;
+                TSCPSecCode oldScpCode;
+                newScpCode.Copy(newPassword);
+                oldScpCode.Copy(oldPassword);
+                if (scpClient.Connect() == KErrNone)
+                    {
+                    RDEBUG("scpClient.StoreLockcode", 0);
+                    // this is the old method. Obsolete now
+                    // scpClient.StoreCode( newCode );
+                    RArray<TDevicelockPolicies> aFailedPolicies;
+                    TDevicelockPolicies failedPolicy;
+                    TInt retLockcode = KErrNone;
+                    retLockcode = scpClient.StoreLockcode(newScpCode, oldScpCode, aFailedPolicies);
+                    RDEBUG( "retLockcode", retLockcode );
+                    RDEBUG( "KErrAccessDenied", KErrAccessDenied );
+                    RDEBUG( "aFailedPolicies.Count()", aFailedPolicies.Count() );
+                    for (TInt i = 0; i < aFailedPolicies.Count(); i++)
+                        {
+                        failedPolicy = aFailedPolicies[i];
+                        RDEBUG( "failedPolicy", failedPolicy );
+                        }
+                    // Don't know what to do if TARM fails. Hopefully it was stopped at typing, as well as VerifyNewLockcodeAgainstPolicies
+                    // The code is already changed in iPhone !
+                    // For now, just undo the changed password
+                    if(retLockcode!=KErrNone)
+                    	{
+                    	RDEBUG("Undo password change because retLockcode", retLockcode);
+                    	ShowResultNoteL(retLockcode, CAknNoteDialog::EConfirmationTone);
+                    	
+                    	// go back to previous password.
+	           	        passwords.iOldPassword = newPassword;
+							        passwords.iNewPassword = oldPassword;
+							        iWait->SetRequestType(EMobilePhoneChangeSecurityCode);
+							        RDEBUG("ChangeSecurityCode", 0);
+							        iPhone.ChangeSecurityCode(iWait->iStatus, secCodeType, passwords);
+							        RDEBUG("WaitForRequestL", 0);
+							        res = iWait->WaitForRequestL();	// this can't fail. ISA is always allowing to undo the password change.
+							        RDEBUG("WaitForRequestL res", res);
+											#ifdef __WINS__
+							        if (res == KErrNotSupported)
+							            res = KErrNone;
+											#endif
+	                    res = retLockcode;
+	                    }
+                    scpClient.Close();
+                    }
+                if(res==KErrNone)
+                	{
+                	RDEBUG( "showing R_SECURITY_CODE_CHANGED_NOTE", R_SECURITY_CODE_CHANGED_NOTE );
+                	ShowResultNoteL(R_SECURITY_CODE_CHANGED_NOTE, CAknNoteDialog::EConfirmationTone);
+                	}
+                }
+            break;
+            }
+        case KErrGsmSSPasswordAttemptsViolation:
+        case KErrLocked:
+            {
+            ShowResultNoteL(R_SEC_BLOCKED, CAknNoteDialog::EErrorTone);
+            ChangeSecCodeParamsL(aOldPassword, aNewPassword, aFlags, aCaption, aShowError);
+            break;
+            }
+        case KErrGsm0707IncorrectPassword:
+        case KErrAccessDenied:
+            {
+            // code was entered erroneously
+            ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone);
+            ChangeSecCodeParamsL(aOldPassword, aNewPassword, aFlags, aCaption, aShowError);
+            break;
+            }
+        case KErrAbort:
+            {
+            break;
+            }
+        default:
+            {
+            ShowErrorNoteL(res);
+            ChangeSecCodeParamsL(aOldPassword, aNewPassword, aFlags, aCaption, aShowError);
+            break;
+            }
+        } // switch
+    RDEBUG("return res", res);
+    return res;
+    }
+
+/**************************************/
+// qtdone
+// the params are changed in the settings,. This only asks for password.
+EXPORT_C TInt CSecuritySettings::ChangeAutoLockPeriodParamsL(TInt aPeriod, RMobilePhone::TMobilePassword aOldPassword, TInt aFlags, TDes& aCaption, TInt aShowError)
+    {
+    RDEBUG("aPeriod", aPeriod);
+    RDEBUG("aFlags", aFlags);
+    /*****************************************************
+     *    Series 60 Customer / ETel
+     *    Series 60  ETel API
+     *****************************************************/
+
+    RMobilePhone::TMobilePhoneLockSetting lockChange(RMobilePhone::ELockSetDisabled);
+    RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockPhoneDevice;
+    TInt oldPeriod = aPeriod;
+
+    TInt maxPeriod = 0;
+    if (FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw))
+        {
+        // Retrieve the current autolock period max. value from the SCP server, 
+        // and check that the value the user
+        // selected is ok from the Corporate Policy point of view.
+        RSCPClient scpClient;
+        TInt ret = scpClient.Connect();
+        if (ret == KErrNone)
+            {
+            CleanupClosePushL(scpClient);
+            TBuf<KSCPMaxIntLength> maxPeriodBuf;
+            if (scpClient.GetParamValue(ESCPMaxAutolockPeriod, maxPeriodBuf) == KErrNone)
+                {
+                TLex lex(maxPeriodBuf);
+                if ((lex.Val(maxPeriod) == KErrNone) && (maxPeriod > 0))
+                    {
+                    RDEBUG("from SCP maxPeriod", maxPeriod);
+                    }
+                else
+                    {
+                    maxPeriod = 0;
+                    RDEBUG("not from SCP maxPeriod", maxPeriod);
+                    }
+                }
+            else
+                {
+                RDEBUG("Failed to retrieve max period", maxPeriod);
+                }
+            }
+        else
+            {
+            RDEBUG("Failed to connect to SCP", 0);
+            }
+        CleanupStack::PopAndDestroy(); // scpClient 
+        }
+    RDEBUG("maxPeriod", maxPeriod);
+    if (FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw))
+        {
+        TBool allow = ETrue;
+
+        if ((aPeriod == 0) && (maxPeriod > 0))
+            {
+            RDEBUG("The period is not allowed by TARM", aPeriod);
+            RDEBUG( "maxPeriod", maxPeriod );
+            allow = EFalse;
+            ShowResultNoteL(R_SECUI_TEXT_AUTOLOCK_MUST_BE_ACTIVE, CAknNoteDialog::EErrorTone);
+            }
+        if (!allow)
+            {
+            return ChangeAutoLockPeriodParamsL(aPeriod, aOldPassword, aFlags, aCaption, aShowError); // ask again
+            }
+        }
+
+    if (aPeriod == 0)
+        {
+        // If remote lock is enabled, don't disable the domestic OS device lock
+        // since that would render the RemoteLock useless.
+        // Instead just re-set the DOS lock to enabled which as a side effect
+        // requests the security code from the user.
+
+        TBool remoteLockStatus(EFalse);
+        CRemoteLockSettings* remoteLockSettings = CRemoteLockSettings::NewL();
+
+        if (remoteLockSettings->GetEnabled(remoteLockStatus))
+            {
+            if (remoteLockStatus)
+                {
+                // Remote lock is enabled
+                lockChange = RMobilePhone::ELockSetEnabled;
+                RDEBUG( "RemoteLock is enabled lockChange", lockChange );
+                }
+            else
+                {
+                // Remote lock is disabled
+                lockChange = RMobilePhone::ELockSetDisabled;
+                RDEBUG( "RemoteLock is disabled lockChange", lockChange );
+                }
+            }
+        else
+            {
+            // Failed to get remote lock status
+            RDEBUG( "Failed to get remote lock status lockChange", lockChange );
+            }
+
+        delete remoteLockSettings;
+        remoteLockSettings = NULL;
+
+        }
+    else
+        {
+        lockChange = RMobilePhone::ELockSetEnabled;
+        RDEBUG("aPeriod != 0 lockChange", lockChange);
+        }
+
+    iWait->SetRequestType(EMobilePhoneSetLockSetting);
+    RDEBUG("lockChange", lockChange);
+    RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, ESecurityUIsQueryRequestOk);
+    RDEBUG("SetLockSetting", 0);
+    iPhone.SetLockSetting(iWait->iStatus, lockType, lockChange); // this eventually calls PassPhraseRequiredL
+    RDEBUG("WaitForRequestL", 0);
+    TInt status = KErrNone;
+    status = iWait->WaitForRequestL();
+    RDEBUG("WaitForRequestL status", status);
+#ifdef __WINS__
+    if (status == KErrNotSupported || status == KErrTimedOut)
+        status = KErrNone;
+#endif
+    switch (status)
+        {
+        case KErrNone:
+            break;
+        case KErrGsmSSPasswordAttemptsViolation:
+        case KErrLocked:
+            RDEBUG("KErrLocked", KErrLocked)
+            ;
+            ShowResultNoteL(KErrLocked, CAknNoteDialog::EErrorTone); // the old code didn't show messages
+            return ChangeAutoLockPeriodParamsL(oldPeriod, aOldPassword, aFlags, aCaption, aShowError); // ask again
+        case KErrGsm0707IncorrectPassword:
+        case KErrAccessDenied:
+            RDEBUG("KErrAccessDenied", KErrAccessDenied)
+            ;
+            // code was entered erroneously
+            ShowResultNoteL(KErrAccessDenied, CAknNoteDialog::EErrorTone); // the old code didn't show messages
+            return ChangeAutoLockPeriodParamsL(oldPeriod, aOldPassword, aFlags, aCaption, aShowError); // ask again
+        case KErrAbort:
+            // User pressed "cancel" in the code query dialog.
+            return oldPeriod;
+        default:
+            RDEBUG("default", status)
+            ;
+            ShowResultNoteL(status, CAknNoteDialog::EErrorTone); // the old code didn't show messages
+            return ChangeAutoLockPeriodParamsL(oldPeriod, aOldPassword, aFlags, aCaption, aShowError); // ask again
+        }
+    RDEBUG("aPeriod", aPeriod);
+    return aPeriod;
+    }
+/*****************************/
+// qtdone
+EXPORT_C TInt CSecuritySettings::ChangePinRequestParamsL(TInt aEnable, RMobilePhone::TMobilePassword aOldPassword, TInt aFlags, TDes& aCaption, TInt aShowError)
+    {
+    RDEBUG("aEnable", aEnable);
+    RDEBUG("aFlags", aFlags);
+    TInt simState = 0;
+    TInt lEnable = aEnable;
+    TInt err(KErrGeneral);
+    err = RProperty::Get(KPSUidStartup, KPSSimStatus, simState);
+    User::LeaveIfError(err);
+    TBool simRemoved(simState == ESimNotPresent);
+
+    if (simRemoved)
+        {
+        ShowResultNoteL(R_INSERT_SIM, CAknNoteDialog::EErrorTone);
+        return KErrAccessDenied;
+        }
+
+    RMobilePhone::TMobilePhoneLockInfoV1 lockInfo;
+    RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo);
+    RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockICC;
+
+    RMobilePhone::TMobilePhoneLockSetting lockChangeSetting;
+
+    //get lock info
+    iWait->SetRequestType(EMobilePhoneGetLockInfo);
+    iPhone.GetLockInfo(iWait->iStatus, lockType, lockInfoPkg);
+    RDEBUG("WaitForRequestL", 0);
+    TInt status = iWait->WaitForRequestL();
+    RDEBUG("WaitForRequestL status", status);
+#ifdef __WINS__
+    if (status == KErrNotSupported || status == KErrTimedOut)
+        {
+        lockInfo.iSetting = RMobilePhone::ELockSetDisabled;
+        status = KErrNone;
+        }
+#endif
+    User::LeaveIfError(status);
+
+    if (aOldPassword.Length() == 0) // only if input parameters are empty
+        {
+        // switch the value.
+        if (lockInfo.iSetting == RMobilePhone::ELockSetDisabled)
+            lEnable = 1; // on
+        else
+            lEnable = 0; // off
+        }
+
+    RDEBUG("lEnable", lEnable);
+    if (lEnable == 0)
+        {
+        lockChangeSetting = RMobilePhone::ELockSetDisabled;
+        }
+    else
+        {
+        lockChangeSetting = RMobilePhone::ELockSetEnabled;
+        }
+
+    RDEBUG("lockChangeSetting", lockChangeSetting);
+    // Raise a flag to indicate that the PIN
+    // request coming from ETEL has originated from SecUi and not from Engine.
+    TInt tRet = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsSecUIOriginated);
+    RDEBUG("tRet", tRet);
+
+    // Change the lock setting
+    iWait->SetRequestType(EMobilePhoneSetLockSetting);
+    RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, ESecurityUIsQueryRequestOk);
+    RDEBUG("SetLockSetting", 0);
+    iPhone.SetLockSetting(iWait->iStatus, lockType, lockChangeSetting); // this will trigger Pin1RequiredL
+    RDEBUG("WaitForRequestL", 0);
+    status = iWait->WaitForRequestL();
+    RDEBUG("WaitForRequestL status", status);
+#ifdef __WINS__
+    if (status == KErrNotSupported || status == KErrTimedOut)
+        status = KErrNone;
+#endif
+
+    // Lower the flag                             
+    RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsSecUIOriginatedUninitialized);
+
+    switch (status)
+        {
+        case KErrNone:
+            {
+            break;
+            }
+        case KErrGsm0707OperationNotAllowed:
+            {
+            // not allowed with this sim
+            ShowResultNoteL(R_OPERATION_NOT_ALLOWED, CAknNoteDialog::EErrorTone);
+            return KErrGsm0707OperationNotAllowed;
+            }
+        case KErrGsm0707IncorrectPassword:
+        case KErrAccessDenied:
+            {
+            // code was entered erroneously
+            return ChangePinRequestParamsL(aEnable, aOldPassword, aFlags, aCaption, aShowError);
+            }
+        case KErrGsmSSPasswordAttemptsViolation:
+        case KErrLocked:
+            {
+            return KErrLocked;
+            }
+        case KErrAbort:
+            {
+            return KErrAbort;
+            }
+        default:
+            {
+            return ChangePinRequestParamsL(aEnable, aOldPassword, aFlags, aCaption, aShowError);
+            }
+        }
+    return KErrNone;
+    }
+
+//
+// ----------------------------------------------------------
+// CSecuritySettings::AskSecCodeParamsL()
+// For asking security code e.g in settings
+// not used
+// ----------------------------------------------------------
+// qtdone
+EXPORT_C TBool CSecuritySettings::AskSecCodeParamsL(RMobilePhone::TMobilePassword &aOldPassword, TInt aFlags, TDes& aCaption, TInt aShowError)
+    {
+    RDEBUG("aFlags", aFlags);
+    RDEBUG("aShowError", aShowError);
+    RDEBUG("This doesn't do anything", 0);
+    RDEBUG("aFlags", aFlags);
+
+    // the password parameters are not used
+    if (aOldPassword.Length() > 0)
+        RDEBUGSTR(aOldPassword);
+
+    return EFalse;
+    }
 
 // End of file
--- a/securitydialogs/SecUi/Src/SecUiSystemLock.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/securitydialogs/SecUi/Src/SecUiSystemLock.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -22,7 +22,7 @@
 #include    <coreapplicationuisdomainpskeys.h>
 #include    "SecUiSystemLock.h"
 #include    <eikenv.h>
-#include    <AknNotifierController.h>
+// #include    <AknNotifierController.h>
 #include    <rmmcustomapi.h>
 #include    "secuisecuritysettings.h"
 #include    "SecUiWait.h"
@@ -30,6 +30,8 @@
 #include 	<e32property.h>
 #include <ctsydomainpskeys.h>
 #include    <securityuisprivatepskeys.h>
+#include    <devicelockaccessapi.h>
+
     /*****************************************************
     *    Series 60 Customer / TSY
     *    Needs customer TSY implementation
@@ -48,6 +50,7 @@
 // 
 EXPORT_C CSystemLock* CSystemLock::NewL()
     {
+    RDebug::Printf( "%s %s (%u) this should not be called=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
     CSystemLock* self = new(ELeave) CSystemLock();
     CleanupStack::PushL(self);
     self->ConstructL();
@@ -62,6 +65,7 @@
 // 
 void CSystemLock::ConstructL()    
     {    
+    RDebug::Printf( "%s %s (%u) this should not be called=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
     /*****************************************************
     *    Series 60 Customer / ETel
     *    Series 60  ETel API
@@ -141,7 +145,8 @@
 //
 // ----------------------------------------------------------
 // CSystemLock::SetLockedL()
-// Activates system lock 
+// Activates system lock
+// this was used by SysAp, but it's not longer used
 // ----------------------------------------------------------
 //
 EXPORT_C void CSystemLock::SetLockedL()
@@ -150,97 +155,29 @@
     *    Series 60 Customer / ETel
     *    Series 60  ETel API
     *****************************************************/
+    RDebug::Printf( "%s %s (%u) this should not be called=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
     #if defined(_DEBUG)
     RDebug::Print(_L("(SECUI)CSystemLock::SetLockedL()"));
     #endif
     // close fast-swap window
-    CEikonEnv::Static()->DismissTaskList();
-
-#ifdef __WINS__
-    // can not verify security code in emulator ---> lock system 
-#ifdef RD_REMOTELOCK
-		iProperty.Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, EManualLocked);
-#else// !RD_REMOTELOCK
-        iProperty.Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, EAutolockOn);
-#endif//RD_REMOTELOCK
-#else //__WINS__
-
-    if(IsActive())
-        return;
-
-
-    RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockPhoneDevice;
-    RMobilePhone::TMobilePhoneLockInfoV1 lockInfo;
-    RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo);
-    RMobilePhone::TMobilePhoneLockSetting lockChange(RMobilePhone::ELockSetDisabled);
-    CWait* wait = CWait::NewL();
-    CleanupStack::PushL( wait );
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSystemLock::SetLockedL() GetLockInfo"));
-    #endif
-    iPhone.GetLockInfo(wait->iStatus, lockType, lockInfoPkg);
-    if (wait->WaitForRequestL() == KErrNone)
-        {
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSystemLock::SetLockedL() KErrNone"));
-        #endif
-        if (lockInfo.iSetting == RMobilePhone::ELockSetDisabled)
-            {
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSystemLock::SetLockedL() ELockSetDisabled"));
-            #endif
-            // ask code
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSystemLock::SetLockedL() SetLockSetting"));
-            #endif
-            //iCustomPhone.CheckSecurityCode(iStatus, RMmCustomAPI::ESecurityCodePassPhrase);
-            lockChange = RMobilePhone::ELockSetEnabled;
-            RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsSystemLockOriginated);
-            iPhone.SetLockSetting(iStatus, lockType, lockChange);
-            SetActive();
-            }        
-        else
-            {
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSystemLock::SetLockedL() Lock System"));
-            #endif
- // lock system 
-#ifdef RD_REMOTELOCK
-		iProperty.Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, EManualLocked);
-#else// !RD_REMOTELOCK
-        iProperty.Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, EAutolockOn);
-#endif //RD_REMOTELOCK
-
-            #if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSystemLock::SetLockedL() Lock System OK"));
-            #endif
-            }
-        }
-    else
-        {
-        // ask code 
-        #if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSystemLock::SetLockedL() ask code (SLS) "));
-        #endif
-        lockChange = RMobilePhone::ELockSetEnabled;
-        RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsSystemLockOriginated);
-        iPhone.SetLockSetting(iStatus, lockType, lockChange);
-        SetActive();
-        }
-    CleanupStack::PopAndDestroy();
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSystemLock::SetLockedL() END"));
-    #endif // DEBUG
-    #endif // WINS
+            RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
+            CDevicelockAccessApi* iDevicelockAccess = CDevicelockAccessApi::NewL( );
+           	RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
+						iDevicelockAccess->OfferDevicelock();
+						// this will do				EnableDevicelock( EDevicelockManual );
+						RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
     }
 //
 // ----------------------------------------------------------
 // CSystemLock::RunL()
 // Handles query result
+// this was used by SysAp, but it's not longer used
 // ----------------------------------------------------------
 // 
 void CSystemLock::RunL()
     {    
+    RDebug::Printf( "%s %s (%u) this should not be called=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
+
     #if defined(_DEBUG)
     TInt status(iStatus.Int());
     RDebug::Print(_L("(SECUI)CSystemLock::RunL(): %d"), status);
@@ -258,14 +195,16 @@
         		RDebug::Print(_L("(SECUI)CSystemLock::RunL() KErrNone"));
         		#endif
         		// clear notifiers
-        		AknNotifierController::HideAllNotifications(ETrue);
+        		// not any more. Avkon is deprecated. Besides, this function should not be called.
+        		// AknNotifierController::HideAllNotifications(ETrue);
         		// query approved -> lock system  
 			#ifdef RD_REMOTELOCK
 				iProperty.Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, EManualLocked);
 			#else// !RD_REMOTELOCK
         		iProperty.Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, EAutolockOn);
         	#endif//RD_REMOTELOCK
-        		AknNotifierController::HideAllNotifications(EFalse);
+        		// not any more. Avkon is deprecated. Besides, this function should not be called.
+        		// AknNotifierController::HideAllNotifications(EFalse);
     		}
         }
     else if((iStatus != KErrCancel) && (iStatus != KErrAbort))
--- a/securitydialogs/SecUi/Src/SecUiWait.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/securitydialogs/SecUi/Src/SecUiWait.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -77,10 +77,8 @@
 //
 TInt CWait::WaitForRequestL()
     {    
-    CWaitAbsorbingControl* absorbing = CWaitAbsorbingControl::NewLC();
     SetActive();
     iWait.Start();
-    CleanupStack::PopAndDestroy(absorbing);
     return iStatus.Int();
     }
 //
@@ -128,6 +126,33 @@
     return iRequestType;
 }
 //
+// class CAutolockQuery
+//
+CAutolockQuery::CAutolockQuery()
+    {
+    }
+
+CAutolockQuery::~CAutolockQuery()
+    {
+    
+    }
+
+CAutolockQuery* CAutolockQuery::NewLC()
+    {
+    return NULL;
+    }
+
+void CAutolockQuery::ConstructL()
+    {
+    
+    }
+
+TKeyResponse CAutolockQuery::OfferKeyEventL(const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/)
+    {
+    return EKeyWasConsumed; 
+    }
+/***********/
+//
 // class CWaitAbsorbingControl
 //
 CWaitAbsorbingControl::CWaitAbsorbingControl()
@@ -136,32 +161,22 @@
 
 CWaitAbsorbingControl::~CWaitAbsorbingControl()
     {
-    if (iCoeEnv && iAppUi)
-        iAppUi->RemoveFromStack(this);
+    
     }
 
 CWaitAbsorbingControl* CWaitAbsorbingControl::NewLC()
     {
-    CWaitAbsorbingControl* self= new(ELeave) CWaitAbsorbingControl();
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    return self;
+    return NULL;
     }
 
 void CWaitAbsorbingControl::ConstructL()
     {
-    CreateWindowL();
-    SetExtent(TPoint(0,0), TSize(0,0));
-    ActivateL();
-    SetPointerCapture(ETrue);
-    ClaimPointerGrab(ETrue);
-    iAppUi=iEikonEnv->EikAppUi();
-    iAppUi->AddToStackL(this, ECoeStackPriorityEnvironmentFilter);
+    
     }
 
 TKeyResponse CWaitAbsorbingControl::OfferKeyEventL(const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/)
     {
-    return EKeyWasConsumed;
+    return EKeyWasConsumed; 
     }
 
 // End of file
--- a/securitydialogs/SecUi/group/SecUi.mmp	Thu Aug 19 10:45:23 2010 +0300
+++ b/securitydialogs/SecUi/group/SecUi.mmp	Tue Aug 31 16:04:40 2010 +0300
@@ -20,6 +20,8 @@
 #include <platform_paths.hrh>
 #include <data_caging_paths.hrh>
 
+SYSTEMINCLUDE   /epoc32/include/mw/hb/hbcore 
+
 TARGET  secui.dll
 TARGETTYPE  dll
 UID 0x1000006C 0x100058ED
@@ -40,81 +42,27 @@
 
 MW_LAYER_SYSTEMINCLUDE ../../../inc 
 
-
-#ifdef __PROTOCOL_CDMA
-
-    SOURCEPATH ../Cdma/Src
-    SOURCE  SecUiSecuritySettingsCdma.cpp
-    SOURCE  SecUiSecurityHandlerCdma.cpp
-    SOURCE  SecUiObsStartterCdma.cpp
-    SOURCE  SecUiAutoLockSettingPageCdma.cpp
-    SOURCE  SecUiSystemLockCdma.cpp
-
-    SOURCEPATH ../Src
-    SOURCE  SecUi.cpp
-    SOURCE  SecUiCodeQueryDialog.cpp
-    SOURCE  SecUiCodeQueryControl.cpp
-    SOURCE  SecUiManualSecuritySettings.cpp
-    SOURCE  SecUiWait.cpp
-
-
-    library EUSER.LIB BAFL.LIB CONE.LIB
-    library EIKCORE.LIB EIKCOCTL.LIB
-    library avkon.lib  eikdlg.lib 
-    library etel.lib etelmm.lib
-    library eikctl.lib 
-    library ws32.lib commonengine.lib
-    library efsrv.lib 
-	LIBRARY centralrepository.lib
-	LIBRARY aknNotifierWrapper.lib
-    library customapi.lib
-    library securityclient.lib  //Security Engine
-    library apparc.lib //For starting application in secuiobsstartter
-
-   LIBRARY SCPClient.lib // SCP server
-
-#else //If GSM:
-
-
-    SOURCEPATH ../Src
+SOURCEPATH ../Src
 
-    SOURCE  ../Src/SecUi.cpp
-    SOURCE  ../Src/SecUiCodeQueryDialog.cpp
-    SOURCE  ../Src/SecUiSecuritySettings.cpp
-    SOURCE  ../Src/SecUiSecurityHandler.cpp
-    SOURCE  ../Src/SecUiCodeQueryControl.cpp
-    SOURCE  ../Src/SecUiAutoLockSettingPage.cpp
-    SOURCE  ../Src/SecUiObsStartter.cpp
-    SOURCE  ../Src/SecUiManualSecuritySettings.cpp
-    SOURCE  ../Src/SecUiSystemLock.cpp
-    SOURCE  ../Src/SecUiWait.cpp
-    SOURCE  ../Src/SecUiLockObserver.cpp
-#ifdef RD_REMOTELOCK
-    SOURCE  ../Src/SecUiRemoteLockSettingPage.cpp
-#endif    
+SOURCE  ../Src/SecUi.cpp
+SOURCE  ../Src/SecUiCodeQueryDialog.cpp
+SOURCE  ../Src/SecUiSecuritySettings.cpp
+SOURCE  ../Src/SecUiSecurityHandler.cpp
+SOURCE  ../Src/SecUiAutoLockSettingPage.cpp
+SOURCE  ../Src/SecUiObsStartter.cpp
+SOURCE  ../Src/SecUiManualSecuritySettings.cpp
+SOURCE  ../Src/SecUiSystemLock.cpp
+SOURCE  ../Src/SecUiWait.cpp
+SOURCE  ../Src/SecQueryUi.cpp
 
-    library     euser.lib bafl.lib cone.lib
-    library     eikcore.lib eikcoctl.lib
-    library     avkon.lib  eikdlg.lib 
-    library     etel.lib etelmm.lib
-    library     eikctl.lib 
-    library     ws32.lib commonengine.lib
-    library     efsrv.lib 
-    library     eiksrvui.lib
-    library     customapi.lib
-    LIBRARY     starterclient.lib       //use of Starter to remove splash screen
-    library     sysutil.lib
-    library     estor.lib
-
-#ifdef RD_REMOTELOCK
-    library     rlocksettings.lib 
-#endif    
-
-
-   LIBRARY      scpclient.lib // SCP server         
-	LIBRARY centralrepository.lib
-	LIBRARY aknnotifierwrapper.lib
-#endif //__PROTOCOL_CDMA
+// library avkon.lib  eikdlg.lib 
+library     euser.lib
+library     etel.lib etelmm.lib
+library     commonengine.lib
+library     customapi.lib
+library     rlocksettings.lib 
+LIBRARY     scpclient.lib // SCP server         
+LIBRARY			centralrepository.lib
 
 // Modified by build team
 #if defined(WINSCW)
@@ -123,6 +71,11 @@
 LIBRARY                 featmgr.lib
 LIBRARY aknnotify.lib
 
+LIBRARY HbCore.lib
+LIBRARY HbWidgets.lib
+LIBRARY lockclient.lib 
+LIBRARY phoneclient.lib
+
 SMPSAFE
 
 // end of file
--- a/securitydialogs/SecUi/group/bld.inf	Thu Aug 19 10:45:23 2010 +0300
+++ b/securitydialogs/SecUi/group/bld.inf	Tue Aug 31 16:04:40 2010 +0300
@@ -26,18 +26,13 @@
 //SecUi iby files
 ../rom/SecUi.iby CORE_MW_LAYER_IBY_EXPORT_PATH(secui.iby)
 ../rom/SecUiResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(secuiresources.iby)
-//Sim Sec Plugin iby files
-../rom/GSSimSecPlugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH(gssimsecplugin.iby)
-../rom/GSSimSecPluginResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(gssimsecpluginresources.iby)
+
 //localisation files
 ../loc/SecUi.loc MW_LAYER_LOC_EXPORT_PATH(secui.loc)
-../GSSimSecPlugin/loc/gssecurity.loc MW_LAYER_LOC_EXPORT_PATH(gssecurity.loc)
+
 //ADO internal APIs
 ../Inc/SecUiSystemLock.h MW_LAYER_PLATFORM_EXPORT_PATH(secuisystemlock.h)
 
 PRJ_MMPFILES
 
 ../group/SecUi.mmp
-//SIM security plugin for General Settings
-../GSSimSecPlugin/GSSimSecPlugin.mmp
-
--- a/securitydialogs/SecUi/rom/GSSimSecPlugin.iby	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +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:  GSAccsPlugin ROM files.
-*
-*/
-
-#ifndef GSSIMSECPLUGIN_IBY
-#define GSSIMSECPLUGIN_IBY
-
-    #ifdef RD_GS_RENOVATION
-
-        ECOM_PLUGIN( GSSimSecPlugin.dll, 10207438.rsc )
-
-    #endif // RD_GS_RENOVATION
-
-#endif // GSSIMSECPLUGIN_IBY
-//  End of File
--- a/securitydialogs/SecUi/rom/GSSimSecPluginResources.iby	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +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:  GSSecurityPlugin ROM resources.
-*
-*/
-
-#ifndef GSSIMSECPLUGINRESOURCES_IBY
-#define GSSIMSECPLUGINRESOURCES_IBY
-
-    #ifdef RD_GS_RENOVATION
-
-        data=DATAZ_\RESOURCE_FILES_DIR\GSSimSecPluginRsc.rsc     RESOURCE_FILES_DIR\GSSimSecPluginRsc.rsc
-
-    #endif // RD_GS_RENOVATION
-
-#endif // GSSIMSECPLUGINRESOURCES_IBY
-//  End of File
--- a/securitydialogs/Securitynotifier/Group/Securitynotifier.mmp	Thu Aug 19 10:45:23 2010 +0300
+++ b/securitydialogs/Securitynotifier/Group/Securitynotifier.mmp	Tue Aug 31 16:04:40 2010 +0300
@@ -51,7 +51,7 @@
 #if defined(WINSCW)
 DEFFILE ../BWinsCw/SecurityNotifierU.def
 #endif
-LIBRARY                 featmgr.lib  apgrfx.lib apparc.lib
+LIBRARY                 featmgr.lib apgrfx.lib apparc.lib
 
 SMPSAFE
 
--- a/securitydialogs/Securitynotifier/Src/SecurityNotifier.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/securitydialogs/Securitynotifier/Src/SecurityNotifier.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -34,10 +34,10 @@
 #include <apgcli.h>
 
 //  LOCAL CONSTANTS AND MACROS
-	/*****************************************************
-	*	Series 60 Customer / TSY
-	*	Needs customer TSY implementation
-	*****************************************************/
+  /*****************************************************
+  * Series 60 Customer / TSY
+  * Needs customer TSY implementation
+  *****************************************************/
 
 const TInt KTriesToConnectServer( 2 );
 const TInt KTimeBeforeRetryingServerConnection( 50000 );
@@ -92,10 +92,10 @@
         if ( scpClient.QueryAdminCmd( ESCPCommandLockPhone ) )
             {
             #if defined(_DEBUG)
-        	RDebug::Print(_L("CSecObsNotify::SCP admin command, no action required"));
-	        #endif
+          RDebug::Print(_L("CSecObsNotify::SCP admin command, no action required"));
+          #endif
 
-	        isAdminCall = ETrue;
+          isAdminCall = ETrue;
             }
 
         scpClient.Close();
@@ -137,7 +137,7 @@
 //
 CSecurityNotifier::~CSecurityNotifier()
     {
-    	FeatureManager::UnInitializeLib();
+      FeatureManager::UnInitializeLib();
     }
 //
 // ----------------------------------------------------------
@@ -158,9 +158,9 @@
 //
 MEikSrvNotifierBase2::TNotifierInfo CSecurityNotifier::RegisterL()
     {
-	#if defined(_DEBUG)
+  #if defined(_DEBUG)
     RDebug::Print(_L("(SECURITYNOTIFIER)CSecurityNotifier::RegisterL()"));
-	#endif
+  #endif
     iInfo.iUid = KSecurityNotifierUid;
     iInfo.iChannel = KSecurityNotifierChannel;
     iInfo.iPriority = ENotifierPriorityHigh;
@@ -174,9 +174,9 @@
 //
 MEikSrvNotifierBase2::TNotifierInfo CSecurityNotifier::Info() const
     {
-	#if defined(_DEBUG)
+  #if defined(_DEBUG)
     RDebug::Print(_L("(SECURITYNOTIFIER)CSecurityNotifier::Info()"));
-	#endif
+  #endif
     return iInfo;
     }
 
@@ -190,9 +190,9 @@
 //
 TPtrC8 CSecurityNotifier::StartL(const TDesC8& /*aBuffer*/)
     {
-	#if defined(_DEBUG)
+  #if defined(_DEBUG)
     RDebug::Print(_L("(SECURITYNOTIFIER)CSecurityNotifier::StartL()"));
-	#endif
+  #endif
     TPtrC8 ret(KNullDesC8);
     return (ret);
     }
@@ -204,9 +204,9 @@
 //
 void CSecurityNotifier::StartL(const TDesC8& aBuffer, TInt aReturnVal,const RMessagePtr2& aMessage)
     {
-	#if defined(_DEBUG)
+  #if defined(_DEBUG)
     RDebug::Print(_L("(SECURITYNOTIFIER)CSecurityNotifier::StartL2()"));
-	#endif
+  #endif
     TRAPD(err, GetParamsL(aBuffer, aReturnVal, aMessage));
     if (err)
         {
@@ -225,15 +225,44 @@
 //
 void CSecurityNotifier::GetParamsL(const TDesC8& aBuffer, TInt aReturnVal, const RMessagePtr2& aMessage)
     {
-	/*****************************************************
-	*	Series 60 Customer / ETel
-	*	Series 60  ETel API
-	*****************************************************/
+  #if defined(_DEBUG)
+  RDebug::Printf( "%s %s (%u) searching for autolock.exe =%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0x0 );
+  #endif
+    
+  TApaTaskList taskList( CCoeEnv::Static()->WsSession() );
+  const TUid KAutolockUid = { 0x100059B5 };
+  TApaTask task( taskList.FindApp( KAutolockUid ) );
+  if ( !task.Exists() )
+    {
+    #if defined(_DEBUG)
+    RDebug::Printf( "%s %s (%u) autolock.exe not running. Starting now=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0x1 );
+    #endif
+    RApaLsSession ls;                   
+    User::LeaveIfError(ls.Connect());   
+    CleanupClosePushL(ls);         
+    
+    CApaCommandLine* commandLine = CApaCommandLine::NewLC();
+    commandLine->SetExecutableNameL( _L("autolock.exe" ) );     
+    commandLine->SetCommandL( EApaCommandRun );
+    
+    // Try to launch the application.        
+    TInt err = ls.StartApp(*commandLine);
+    #if defined(_DEBUG)
+    RDebug::Printf( "%s %s (%u) autolock.exe err=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, err );
+    #endif
+    
+    CleanupStack::PopAndDestroy(2); // commandLine, ls
+    }
+
+  /*****************************************************
+  * Series 60 Customer / ETel
+  * Series 60  ETel API
+  *****************************************************/
     iMessage = aMessage;
     iReturnVal = aReturnVal;
     TBool skipQuery = EFalse; // In some cases the query is handled by some other entity and SecurityNotifier should skip it.
 
-	#if defined(_DEBUG)
+  #if defined(_DEBUG)
     RDebug::Print(_L("(SECURITYNOTIFIER)CSecurityNotifier::GetParamsL() Start BEGIN"));
     #endif
     
@@ -243,38 +272,9 @@
     iStartup = pckg().iStartup;
     iEvent = static_cast<RMobilePhone::TMobilePhoneSecurityEvent>(pckg().iEvent);
     
-	#if defined(_DEBUG)
-	RDebug::Printf( "%s %s (%u) searching for autolock.exe =%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0x0 );
-	RDebug::Printf( "%s %s (%u) iEvent=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iEvent );
-	RDebug::Printf( "%s %s (%u) 2 RMobilePhone::EPin1Required=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, RMobilePhone::EPin1Required );
-	#endif
-	TApaTaskList taskList( CCoeEnv::Static()->WsSession() );
-	const TUid KAutolockUid = { 0x100059B5 };
-	TApaTask task( taskList.FindApp( KAutolockUid ) );
-	if ( !task.Exists() && iEvent != RMobilePhone::EPin1Required )	// PIN-request should not start autolock, to prevent that lock-code is secretly accepted by TARM. Rely on Startup.
-		{
-		#if defined(_DEBUG)
-		RDebug::Printf( "%s %s (%u) autolock.exe not running. Starting now=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0x1 );
-		#endif
-		RApaLsSession ls;                   
-		User::LeaveIfError(ls.Connect());   
-		CleanupClosePushL(ls);         
-		
-		CApaCommandLine* commandLine = CApaCommandLine::NewLC();
-		commandLine->SetExecutableNameL( _L("autolock.exe" ) );     
-		commandLine->SetCommandL( EApaCommandRun );
-		
-		// Try to launch the application.        
-		User::LeaveIfError(ls.StartApp(*commandLine));
-		#if defined(_DEBUG)
-		RDebug::Printf( "%s %s (%u) autolock.exe created=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0x2 );
-		#endif
-		
-		CleanupStack::PopAndDestroy(2); // commandLine, ls
-		}
 
 if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw ))
-		{
+    {
     if(iEvent == RMobilePhone::EPhonePasswordRequired)
         {
             skipQuery = IsAdminCall(); // SCP handles the call.
@@ -292,7 +292,7 @@
         SetActive();
         iStatus = KRequestPending;
         TRequestStatus* stat = &iStatus;
-	    #if defined(_DEBUG)
+      #if defined(_DEBUG)
         RDebug::Print(_L("CSecurityNotifier::GetParamsL() End"));
         #endif
         User::RequestComplete(stat, KErrNone); // jump to RunL
@@ -305,26 +305,26 @@
 // ----------------------------------------------------------
 void CSecurityNotifier::RunL()
     {
-	/*****************************************************
-	*	Series 60 Customer / ETel
-	*	Series 60  ETel API
-	*****************************************************/
-	/*****************************************************
-	*	Series 60 Customer / TSY
-	*	Needs customer TSY implementation
-	*****************************************************/
+  /*****************************************************
+  * Series 60 Customer / ETel
+  * Series 60  ETel API
+  *****************************************************/
+  /*****************************************************
+  * Series 60 Customer / TSY
+  * Needs customer TSY implementation
+  *****************************************************/
 
     TInt err( KErrGeneral );
     TInt thisTry( 0 );
-	RTelServer::TPhoneInfo PhoneInfo;
-	#if defined(_DEBUG)
+  RTelServer::TPhoneInfo PhoneInfo;
+  #if defined(_DEBUG)
     RDebug::Print(_L("CSecurityNotifier::RunL() Start"));
     #endif
     /*All server connections are tried to be made KTriesToConnectServer times because occasional
     fails on connections are possible, at least on some servers*/
 
     // connect to ETel server
-	#if defined(_DEBUG)
+  #if defined(_DEBUG)
     RDebug::Print(_L("CSecurityNotifier::RunL() connect to ETel server"));
     #endif
     while ( ( err = iServer.Connect() ) != KErrNone && ( thisTry++ ) <= KTriesToConnectServer )
@@ -336,11 +336,14 @@
     thisTry = 0;
 
     // load TSY
-	#if defined(_DEBUG)
+  #if defined(_DEBUG)
     RDebug::Print(_L("CSecurityNotifier::RunL() load TSY"));
     #endif
-    err = iServer.LoadPhoneModule( KMmTsyModuleName );
-    if ( err != KErrAlreadyExists )
+    
+    if ( !iPhone.SubSessionHandle() )    
+    {
+      err = iServer.LoadPhoneModule( KMmTsyModuleName );
+      if ( err != KErrAlreadyExists )
         {
         // may also return KErrAlreadyExists if something
         // else has already loaded the TSY module. And that is
@@ -348,20 +351,22 @@
         User::LeaveIfError( err );
         }
 
-    // open phones
-	#if defined(_DEBUG)
-    RDebug::Print(_L("CSecurityNotifier::RunL() open phones"));
-    #endif
-    User::LeaveIfError(iServer.SetExtendedErrorGranularity(RTelServer::EErrorExtended));
-	User::LeaveIfError(iServer.GetPhoneInfo(PhoneIndex, PhoneInfo));
-    User::LeaveIfError(iPhone.Open(iServer,PhoneInfo.iName));
+       // open phones
+      #if defined(_DEBUG)
+      RDebug::Print(_L("CSecurityNotifier::RunL() open phones"));
+      #endif
+      User::LeaveIfError(iServer.SetExtendedErrorGranularity(RTelServer::EErrorExtended));
+      User::LeaveIfError(iServer.GetPhoneInfo(PhoneIndex, PhoneInfo));
+      User::LeaveIfError(iPhone.Open(iServer,PhoneInfo.iName));
+    }   
+        
     RProperty Property;
     CleanupClosePushL( Property );
     err = Property.Set(KPSUidStartup, KStartupSecurityCodeQueryStatus, ESecurityQueryActive);
     User::LeaveIfError( err );
 
     // initialize security ui
-	#if defined(_DEBUG)
+  #if defined(_DEBUG)
     RDebug::Print(_L("CSecurityNotifier::RunL() initialize security ui"));
     #endif
     CSecurityHandler* handler = new(ELeave) CSecurityHandler(iPhone);
@@ -388,11 +393,11 @@
     // if something went wrong cancel the code request
     if (error)
         {
-		#if defined(_DEBUG)
-		RDebug::Print(_L("CSecurityNotifier::RunL() ERROR: %d"), error);
-		#endif
-		TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ));
-		TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin ));
+    #if defined(_DEBUG)
+    RDebug::Print(_L("CSecurityNotifier::RunL() ERROR: %d"), error);
+    #endif
+    TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ));
+    TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin ));
         switch (iEvent)
             {
             case RMobilePhone::EUniversalPinRequired:
@@ -407,19 +412,19 @@
                    iPhone.AbortSecurityCode(RMobilePhone::ESecurityUniversalPuk);
                   }
                 break;
-			case RMobilePhone::EPin1Required:
+      case RMobilePhone::EPin1Required:
                 iPhone.AbortSecurityCode(RMobilePhone::ESecurityCodePin1);
                 break;
-			case RMobilePhone::EPuk1Required:
+      case RMobilePhone::EPuk1Required:
                 iPhone.AbortSecurityCode(RMobilePhone::ESecurityCodePuk1);
                 break;
-			case RMobilePhone::EPin2Required:
+      case RMobilePhone::EPin2Required:
                 iPhone.AbortSecurityCode(RMobilePhone::ESecurityCodePin2);
                 break;
-			case RMobilePhone::EPuk2Required:
+      case RMobilePhone::EPuk2Required:
                 iPhone.AbortSecurityCode(RMobilePhone::ESecurityCodePuk2);
                 break;
-			case RMobilePhone::EPhonePasswordRequired:
+      case RMobilePhone::EPhonePasswordRequired:
                 iPhone.AbortSecurityCode(RMobilePhone::ESecurityCodePhonePassword);
                 break;
             default:
@@ -449,9 +454,9 @@
     iReturnVal = KErrNone;
     //Leave the window group to foreground for a short time to absorb key presses so that autolock has time to activate.
     if(!StartUp)
-		User::After(KDelayPeriod);
-	( CEikonEnv::Static() )->BringForwards(EFalse);
-	#if defined(_DEBUG)
+    User::After(KDelayPeriod);
+  ( CEikonEnv::Static() )->BringForwards(EFalse);
+  #if defined(_DEBUG)
     RDebug::Print(_L("CSecurityNotifier::RunL() End"));
     #endif
     }
--- a/securitydialogs/Securitynotifier/Src/Securitynotifierwrapper.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/securitydialogs/Securitynotifier/Src/Securitynotifierwrapper.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -18,7 +18,9 @@
 
 
 #include <ecom/implementationproxy.h>
-
+#include <e32notif.h>
+#include <e32base.h>
+#include <eiknotapi.h>
 #include <AknNotifierWrapper.h> // link against aknnotifierwrapper.lib
 
 #define KMyNotifierUid TUid::Uid(0x10005988) //  uid
@@ -48,6 +50,9 @@
     // Create Wrappers
 
     // Session owning notifier(if default implementation is enough)
+    RDebug::Printf( "%s %s (%u) !!!!**  creating SecurityNotifier.dll . This means that PIN/unlock queries will work **!!!! 0=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
+
+    
     CAknCommonNotifierWrapper* master = 
         CAknCommonNotifierWrapper::NewL( KMyNotifierUid,
                                    KMyNotifierUid,
@@ -58,6 +63,7 @@
 	  	
 	   
     subjects->AppendL( master );
+    
     CleanupStack::Pop();	// array cleanup
     #if defined(_DEBUG)
     RDebug::Print(_L("(SECURITYNOTIFIER)WRAPPER DoCreateNotifierArrayL END"));
--- a/securitydialogs/group/bld.inf	Thu Aug 19 10:45:23 2010 +0300
+++ b/securitydialogs/group/bld.inf	Tue Aug 31 16:04:40 2010 +0300
@@ -24,14 +24,14 @@
 PRJ_MMPFILES
 
 #include "../keylockpolicyapi/group/bld.inf"
-#include "../Autolock/group/bld.inf"
+// Autolock is now a QT project built from Autolock.pro
+// #include "../Autolock/group/bld.inf"
 #include "../SecUi/group/bld.inf"
 #include "../Securitynotifier/Group/bld.inf"
 #include "../Securityobserver/Group/bld.inf"
+// As far as I know, lockclient is also a QT project. I wonder why it's left as   .inf
 #include "../lockclient/group/bld.inf"
 #include "../lockapp/group/bld.inf"
-#include "../simlockui/group/bld.inf"
-
 
 PRJ_TESTMMPFILES
 
--- a/securitydialogs/lockapp/cenrep/AutolockPrivateCRKeys.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +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:  Autolock local variation Central Repository keys.
- *
-*/
-
-
-#ifndef AUTOLOCKPRIVATECRKEYS_H
-#define AUTOLOCKPRIVATECRKEYS_H
-
-// =============================================================================
-// Autolock Configuration API
-// =============================================================================
-const TUid KCRUidAutolockConf = { 0x102824AE };
-
-/**
- * Bitmask used in configuring automatic keylock.
- */
-const TUint32 KAutoKeyLockConf = 0x00000001;
-
-// =============================================================================
-// Automatic Keylock Local Variation constants (KAutoKeyLockConf)
-// =============================================================================
-
-/** 
- * KAutolockFeatureIdFlipOpenDisabled is an on/off setting for 
- * disabling automatic keyguard locking when flip is open. By default off.
- * Possible values: 0 (locking enabled), 1 (locking diabled) <-- 
- */
-const TInt KAutoKeylockFeatureIdFlipOpenDisabled= 0x01;  // 2^0
-
-#endif
--- a/securitydialogs/lockapp/data/lockapp.rss	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +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:  LockApp resource file
- *
-*/
-
-
-// RESOURCE IDENTIFIER
-NAME LOCK
-
-//  INCLUDES
-#include "lockapp.loc"
-#include <eikon.rh>
-#include <eikon.rsg>
-#include <avkon.rh>
-#include <avkon.rsg>
-
-//  RESOURCE DEFINITIONS
-
-// ---------------------------------------------------------
-//    Define the resource file signature
-//    This resource should be empty.
-// ---------------------------------------------------------
-//
-RESOURCE RSS_SIGNATURE { }
-
-// ---------------------------------------------------------
-//    Default Document Name
-// ---------------------------------------------------------
-//
-RESOURCE TBUF r_default_document_name { buf=""; }
-
-// ---------------------------------------------------------
-//    Define default menu and CBA key.
-// ---------------------------------------------------------
-//
-RESOURCE EIK_APP_INFO
-    {
-    }
-    
-// ---------------------------------------------------------
-//    Define title pane in devicelock mode.
-// ---------------------------------------------------------
-//
-RESOURCE TBUF r_title_pane_locked
-    {
-    buf = qtn_set_sec_title_locked;
-    }
--- a/securitydialogs/lockapp/data/lockapp_reg.rss	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +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:  RSS for creating the registration file for LockApp.
- *
-*/
-
-
-#include <appinfo.rh>
-
-UID2 KUidAppRegistrationResourceFile
-UID3 0x10283322
-
-RESOURCE APP_REGISTRATION_INFO
-    {
-    app_file = "!LockApp";
-    hidden = KAppIsHidden;
-    }
--- a/securitydialogs/lockapp/group/ABLD.BAT	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-@ECHO OFF
-
-REM Bldmake-generated batch file - ABLD.BAT
-REM ** DO NOT EDIT **
-
-perl -S ABLD.PL "\sf\mw\securitysrv\securitydialogs\lockapp\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9
-if errorlevel==1 goto CheckPerl
-goto End
-
-:CheckPerl
-perl -v >NUL
-if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed?
-goto End
-
-:End
--- a/securitydialogs/lockapp/group/bld.inf	Thu Aug 19 10:45:23 2010 +0300
+++ b/securitydialogs/lockapp/group/bld.inf	Tue Aug 31 16:04:40 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2005 Nokia Corporation and/or 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,33 +11,16 @@
 *
 * Contributors:
 *
-* Description:  LockApp build info
- *
+* Description:  build info file for lockapp 
+*
 */
 
 
 #include <platform_paths.hrh>
 
-PRJ_PLATFORMS
-DEFAULT
 
 PRJ_EXPORTS
 ../rom/lockapp.iby CORE_MW_LAYER_IBY_EXPORT_PATH(lockapp.iby)
-../rom/lockappresources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(lockappresources.iby)
-../loc/lockapp.loc MW_LAYER_LOC_EXPORT_PATH(lockapp.loc)
-../pubsub/SecurityUIsPrivatePSKeys.h |../../../inc/securityuisprivatepskeys.h
-../sis/lockapp_stub.sis /epoc32/data/z/system/install/lockapp_stub.sis
-
-PRJ_EXTENSIONS
-
-START EXTENSION s60/mifconv
-OPTION TARGETFILE lockapp.mif
-OPTION HEADERFILE lockapp.mbg
-OPTION SOURCES -c8,8 qgn_graf_phone_locked
-END
 
 PRJ_MMPFILES
-//gnumakefile lockapp_icons_dc.mk
 lockapp.mmp
-
-//  End of File
--- a/securitydialogs/lockapp/group/lockapp.mmp	Thu Aug 19 10:45:23 2010 +0300
+++ b/securitydialogs/lockapp/group/lockapp.mmp	Tue Aug 31 16:04:40 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2005 Nokia Corporation and/or 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,126 +11,40 @@
 *
 * Contributors:
 *
-* Description:  Keyguard and Devicelock application server LockApp
- *
+* Description: Implementation of lockapp
+*
 */
 
-
+// To get the APP_LAYER_SYSTEMINCLUDE-definition
 #include <platform_paths.hrh>
-#include <data_caging_paths.hrh>
 
-TARGET          lockapp.exe
-TARGETTYPE      exe
-EPOCSTACKSIZE   0x5000
+#include "defaultcaps.hrh"
+CAPABILITY CAP_APPLICATION ProtServ NetworkControl
 
-VENDORID        VID_DEFAULT
+TARGET        lockapp.exe
 
-// ProtServ for being a server
-// WriteDeviceData Devicelock configuration needs it
-// SWEvent for capturing/generating key events
-// NetworkServices for remote lock for devicelock
+targettype exe
 
-CAPABILITY      CAP_APPLICATION ProtServ NetworkControl
+EPOCSTACKSIZE      0x5000
 
 UID             0x100039CE 0x10283322
-
-SECUREID 0x100059B5
-
-//LANG            SC
+SECUREID        0x100059B5
+VENDORID        VID_DEFAULT
 
 SOURCEPATH      ../src
-
-// AppArc framework
-SOURCE          lockappapplication.cpp
-SOURCE          lockappappui.cpp
-SOURCE          lockappdocument.cpp
-
-// State control
-SOURCE          lockappobserverlist.cpp
-SOURCE          lockappstatecontrol.cpp
-SOURCE          lockappbasecontrol.cpp
-
-// State observers
-SOURCE          lockappidlecontrol.cpp
-SOURCE          lockappkeyguardcontrol.cpp
-SOURCE          lockappdevicelockcontrol.cpp
-SOURCE          lockappdevicelockcontainer.cpp
-SOURCE          lockappecsdetector.cpp
-SOURCE          lockappstatepublisher.cpp
-
-// CenRep and PS observers
-SOURCE          lockappcenrepobserver.cpp
-SOURCE          lockapppubsubobserver.cpp
+SOURCE          lockapp.cpp
 
-// Keyguard notes
-SOURCE          lockappsleepingnote.cpp
-SOURCE          lockapplockednote.cpp
-SOURCE          lockappecsnote.cpp
-
-// LockApp Server
-SOURCE          lockappserver.cpp
-SOURCE          lockappsession.cpp
+USERINCLUDE     . ../inc 
 
-// LockApp Utils
-SOURCE          lockappkeycapturecontroller.cpp
-SOURCE          lockappkeypattern.cpp
-SOURCE          lockapputils.cpp
-SOURCE          lockappwait.cpp
-
-SOURCEPATH      ../group
-
-USERINCLUDE     ../inc ../loc ../cenrep
-
-APP_LAYER_SYSTEMINCLUDE
-SYSTEMINCLUDE   ../../../inc
-
+MW_LAYER_SYSTEMINCLUDE
 
-LIBRARY         euser.lib // USER services
-LIBRARY         apparc.lib  // application architecture
-LIBRARY         cone.lib   // Cone
-LIBRARY         bafl.lib // BaflUtils, reading localisation resources
-LIBRARY         ws32.lib // accessing window groups
-LIBRARY         apgrfx.lib // accessing window group names
-LIBRARY         eikcore.lib  // eikon environment
-LIBRARY         eikcoctl.lib // ceikstatuspane
-LIBRARY         eikdlg.lib // eikdialogs
-LIBRARY         gdi.lib  // drawing
-LIBRARY         fbscli.lib // required for CFbsBitmap
-LIBRARY         efsrv.lib // server library
-LIBRARY         etel.lib  // telephony
-LIBRARY         etelmm.lib // telephony
-LIBRARY         customapi.lib // custom api
-LIBRARY         centralrepository.lib // central repository
-LIBRARY         cenrepnotifhandler.lib // central repository notify handler
-LIBRARY         featmgr.lib // feature manager
-LIBRARY         cdlengine.lib // layout engine
-LIBRARY         avkon.lib  // Avkon
-LIBRARY         aknicon.lib // icon support
-LIBRARY         aknlayout2.lib // old layouts
-LIBRARY         aknlayout2scalable.lib // new layouts
-LIBRARY         aknskins.lib // skins
-LIBRARY         aknnotify.lib // aknsmallindicator
-LIBRARY         activitymanager.lib // Activity manager
-LIBRARY         secui.lib // Security UI
-
-LIBRARY         flogger.lib // File logging
-
-LIBRARY         keylockpolicyapi.lib // Keylock policy
-
-#ifdef __SAP_TERMINAL_CONTROL_FW
-LIBRARY         scpclient.lib
-#endif // __SAP_TERMINAL_CONTROL_FW
-
-START RESOURCE ../data/lockapp.rss
-HEADER
-TARGETPATH APP_RESOURCE_DIR
-//LANG SC
-LANGUAGE_IDS
-END
-
-START RESOURCE ../data/lockapp_reg.rss
-TARGETPATH	/private/10003a3f/apps
-END
-
+// Symbian
+LIBRARY         euser.lib
+LIBRARY         efsrv.lib
+LIBRARY	ws32.lib
+LIBRARY	eikcore.lib
+LIBRARY	apgrfx.lib
+LIBRARY	apparc.lib
+LIBRARY	cone.lib
 
 SMPSAFE
--- a/securitydialogs/lockapp/group/lockapp_icons_dc.mk	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +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)\lockapp.mif
-
-HEADERDIR=\epoc32\include
-HEADERFILENAME=$(HEADERDIR)\lockapp.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_graf_phone_locked \
-
-
-FREEZE : do_nothing
-
-SAVESPACE : do_nothing
-
-RELEASABLES :
-	@echo $(HEADERFILENAME)&& \
-	@echo $(ICONTARGETFILENAME)
-
-FINAL : do_nothing
--- a/securitydialogs/lockapp/inc/lockapp.hrh	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +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:  General application spesific enumeration values
- *
-*/
-
-
-#ifndef __LOCKAPP_HRH__
-#define __LOCKAPP_HRH__
-
-/**
- *  LockApp panic codes
- *
- *  @lib    lockapp
- *  @since  5.0
- *  @author Joona Petrell
- *  @author Tamas Koteles
- */
-enum TLockAppPanic
-	{
-	ELockPanicGeneral,
-	ELockPanicIllegalMessage,
-	ELockUnknownValue,
-	ELockIllegalState,
-	ELockPanicOutOfRange,
-	ELockPanicObserverAlreadyExists,
-	ELockPanicObserverNotFound,
-	};
-
-/**
- *  Three possible states of LockApp: unlocked, keyguard active, devicelock active
- *
- *  @lib    lockapp
- *  @since  5.0
- *  @author Joona Petrell
- *  @author Tamas Koteles
- */
-enum TLockStatus
-	{
-	ELockNotActive = 0,
-	EKeyguardActive,
-	EDevicelockActive
-	};
-
-/**
- *  Three possible reason for devicelock: manual, remote, timer
- *
- *  @lib    lockapp
- *  @since  5.0
- *  @author Joona Petrell
- *  @author Tamas Koteles
- */
-enum TDevicelockReason
-	{
-	EDevicelockManual = 1,
-	EDevicelockRemote,
-	EDevicelockTimer
-	};
-
-/**
- *  Bit-field representing screen saver status
- */
-const TUint KLockAppEnvScreenSaverOn = 1;
-
-/**
- *  Bit-field representing phonecall status
- */
-const TUint KLockAppEnvPhonecallOngoing = 2;
-
-/**
- *  Bit-field representing idle status
- */
-const TUint KLockAppEnvIdleOnForeground = 4;
-
-/**
- *  Bit-field representing grip status
- */
-const TUint KLockAppEnvGrip = 8;
-
-/**
- *  Bit-field representing FPS status
- */
-const TUint KLockAppEnvFPS = 0x10;
-
-#endif // __LOCKAPP_HRH__
--- a/securitydialogs/lockapp/inc/lockappapplication.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +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:  Application class that also creates the appserver
- *
-*/
-
-
-#ifndef __LOCKAPP_APPLICATION_H__
-#define __LOCKAPP_APPLICATION_H__
-
-// INCLUDES
-#include <aknapp.h>
-
-/**
- *  CLockAppApplication class, is the application part of the Avkon 
- *  framework.
- *
- *  @lib    lockapp
- *  @since  5.0
- *  @author Joona Petrell
- *  @author Tamas Koteles
- */
-class CLockAppApplication : public CAknApplication
-	{
-	public:
-
-		/**
-		 * @return LockApp application Uid.
-		 */
-		TUid AppDllUid( ) const;
-
-	protected:
-
-		CApaDocument* CreateDocumentL( );
-
-	};
-
-#endif // __LOCKAPP_APPLICATION_H__
--- a/securitydialogs/lockapp/inc/lockappappui.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +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:  LockApp Application UI class
- *
-*/
-
-
-#ifndef __LOCKAPP_APPUI_H__
-#define __LOCKAPP_APPUI_H__
-
-// INCLUDES
-#include <aknappui.h>
-#include "lockapp.hrh"
-
-// FORWARD DECLARATIONS
-class CLockAppAppView;
-class MLockAppStateControl;
-class CLockAppStateControl;
-class CLockAppServer;
-
-/**
- *  CLockAppApplication class is the central user interface class in Avkon.
- *  Owns the LockApp state control and the server component.
- *
- *  @lib    lockapp
- *  @since  5.0
- *  @author Joona Petrell
- *  @author Tamas Koteles
- */
-class CLockAppAppUi : public CAknAppUi
-	{
-	public:
-
-		/**
-		 * Second constructor that can fail (leave).
-		 */
-		void ConstructL( );
-
-		/**
-		 * C++ default constructor.
-		 */
-		CLockAppAppUi( );
-
-		/**
-		 * Destructor.
-		 */
-		~CLockAppAppUi( );
-
-	public:
-
-		/** 
-		 * @see CAknAppUi::HandleResourceChangeL(TInt aType) 
-		 */
-		void HandleResourceChangeL( TInt aType );
-
-	public:
-
-		/**
-		 * Access to main lock state control (used by the server).
-		 *
-		 * @return pointer to state control
-		 */
-		MLockAppStateControl* StateControl( );
-
-	protected:
-
-#ifdef __SAP_TERMINAL_CONTROL_FW
-
-		/**
-		 * From CEikAppUi, handles the TARM unlock message, other messages
-		 * are propagated to the superclass handler.
-		 * 
-		 * @param aClientHandleOfTargetWindowGroup The window group that the message was sent to.
-		 * @param aMessageUid The message UID.
-		 * @param aMessageParameters The message parameters
-		 * @return TMessageResponse EMessageHandled if the message was the TARM unlock message,
-		 * otherwise the return value from the superclass handler.
-		 */
-		MCoeMessageObserver::TMessageResponse HandleMessageL(
-				TUint32 aClientHandleOfTargetWindowGroup,
-				TUid aMessageUid,
-				const TDesC8& aMessageParameters );
-
-#endif // __SAP_TERMINAL_CONTROL_FW
-
-		/** 
-		 * @see CAknAppUi::HandleWsEventL(const TWsEvent& aEvent,CCoeControl* aDestination) 
-		 */
-		void HandleWsEventL( const TWsEvent& aEvent, CCoeControl* aDestination );
-
-	private:
-
-		/**
-		 * Main control of the LockApp.
-		 * Owned.
-		 */
-		CLockAppStateControl* iStateControl;
-
-		/**
-		 * Main server of the LockApp.
-		 * Own.
-		 */
-		CLockAppServer* iLockServer;
-	};
-
-#endif // __LOCKAPP_APPUI_H__
--- a/securitydialogs/lockapp/inc/lockappbasecontrol.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,158 +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:  Base control for logical UI components
- *
-*/
-
-
-#ifndef __LOCKAPPBASECONTROL_H__
-#define __LOCKAPPBASECONTROL_H__
-
-// INCLUDES
-#include <coecntrl.h>
-#include "lockappstateobserver.h"
-#include "lockapplockednote.h"
-#include "lockappkeypattern.h"
-#include <keylockpolicyapi.h>
-
-// FORWARD DECLARATIONS
-class MLockAppStateControl;
-class CEikButtonGroupContainer;
-
-/**
- *  CLockAppBaseControl class is the base control of lockapp state controls,
- *  provides common interface and some protected utility methods.
- *
- *  @lib    lockapp
- *  @since  5.0
- *  @author Joona Petrell
- *  @author Tamas Koteles
- */
-class CLockAppBaseControl : public CCoeControl, public MLockAppStateObserver
-	{
-	public:
-
-		/**
-		 * Destructor.
-		 */
-		~CLockAppBaseControl( );
-
-		/**
-		 * From @c MLockAppStateObserver. Method handles the lock state changes.
-		 *
-		 * @param aStatus The new lock state
-		 */
-		virtual void HandleLockStatusChangedL( TLockStatus aStatus );
-
-		/**
-		 * Handles control activation.
-		 * 
-		 * @param aEnvMask environment bitmask
-		 */
-		virtual void HandleActivateEventL( TUint aEnvMask );
-
-		/**
-		 * Handles control deactivation.
-		 * 
-		 * @param aEnvMask environment bitmask
-		 */
-		virtual void HandleDeActivateEventL( TUint aEnvMask );
-
-		/**
-		 * Handle environment bitmask change.
-		 * 
-		 * @param aEnvMask environment bitmask
-		 * @param aEventMask event bitmask
-		 */
-		virtual void HandleEnvironmentChange( TUint aEnvMask, TUint aEventMask );
-
-	protected:
-
-		/**
-		 * Default Constructor.
-		 * 
-		 * @param aStateControl state control interface
-		 */
-		CLockAppBaseControl( MLockAppStateControl& aStateControl );
-
-		/**
-		 * 2nd phase constructor.
-		 */
-		void ConstructL( );
-
-		/**
-		 * Set up the control's keypattern matcher with the specified keylockpolicy.
-		 * 
-		 * @param aType keylock policy type (lock,unlock,devicelock) 
-		 */
-		TBool SetupKeyPatternsWithPolicyL( TLockPolicyType aType );
-
-		/**
-		 * Show a note. (cancels previous one if shown)
-		 * 
-		 * @param aNote    note to be shown
-		 * @param aTimeout timeout for the note
-		 * @param aTone    tone type
-		 */
-		void ShowNote( CLockAppLockedNote* aNote, const TInt aTimeout,
-				const CAknNoteDialog::TTone aTone );
-
-		/**
-		 * Dismisses a note.
-		 */
-		void CancelNote( );
-
-		/**
-		 * Capture/Release primary keys.
-		 */
-		void CapturePrimaryKeys( const TBool aCapture );
-
-		/**
-		 * Show/Hide softkey cba.
-		 */
-		void ShowCba( const TBool aShow );
-		
-		/**
-		 * Capture/Release pointer events.
-		 */
-		void SetPointerEventCapture( const TBool aEnable );
-
-		/**
-		 * Show/Hide keyguard indicator state.
-		 */
-		void SetKeyguardIndicatorStateL( const TBool aEnable );
-
-	protected:
-
-		// interface to parent state control
-		MLockAppStateControl& iStateControl;
-
-		// application's window group
-		RWindowGroup& iWindowGroup;
-
-		// control's currently shown note (not owned)
-		CLockAppLockedNote* iCurrentNote;
-
-		// control's Cba (owned)
-		CEikButtonGroupContainer* iCba;
-
-		// key pattern matching (owned)
-		CLockAppKeyPattern* iKeyPattern;
-
-		// if control is active
-		TBool iActive;
-
-	};
-
-#endif // __LOCKAPPBASECONTROL_H__
--- a/securitydialogs/lockapp/inc/lockappcenrepobserver.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,136 +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:  Central Repository key observer
- *
-*/
-
-
-#ifndef __LOCKAPPCENREPOBSERVER_H__
-#define __LOCKAPPCENREPOBSERVER_H__
-
-// INCLUDES
-#include <e32std.h>
-#include <cenrepnotifyhandler.h>
-#include "lockappobserverinterface.h"
-
-/**
- *  CLockAppCenRepObserver class is a Central Repository key observer
- *  which can be used to monitor and set a CenRep value.
- *
- *  @lib    lockapp
- *  @since  5.0
- *  @author Tamas Koteles
- */
-class CLockAppCenRepObserver : public CBase, public MCenRepNotifyHandlerCallback
-	{
-	public:
-
-		/**
-		 * Two-phased constructor.
-		 *
-		 * @param aObserver   pointer to observer
-		 * @param aCenRepUid  repository Uid
-		 * @param aKeyId      repository key Id
-		 * @return            the instance just created
-		 */
-		static CLockAppCenRepObserver* NewL( MLockAppObserverInterface* aObserver, TUid aCenRepUid,
-				TUint32 aKeyId );
-
-		/**
-		 * Destructor.
-		 */
-		~CLockAppCenRepObserver( );
-
-		/**
-		 * Get key value from CenRep.
-		 */
-		TInt GetValue( TInt& aValue );
-
-		/**
-		 * Get the value from a different CenRep key.
-		 */
-		TInt GetKeyValue( TUint32 aKey, TInt& aValue );
-
-		/**
-		 * Set key value to CenRep.
-		 */
-		TInt SetValue( TInt aValue );
-
-		/**
-		 * Set the value of a different CenRep key.
-		 */
-		TInt SetKeyValue( TUint32 aKey, TInt aValue );
-
-	public:
-
-		/**
-		 * From MCenRepNotifyHandlerCallback. Handles change event. Called by CenRep.
-		 *
-		 * @param aId the id of the changed setting
-		 * @param aNewValue the new value of the changed setting
-		 */
-		void HandleNotifyInt( TUint32 aId, TInt aNewValue );
-
-		void HandleNotifyError( TUint32 aId, TInt error, CCenRepNotifyHandler* aHandler );
-
-		void HandleNotifyGeneric( TUint32 aId );
-
-	protected:
-
-		/**
-		 * C++ default constructor.
-		 *
-		 * @param aObserver  pointer to observer
-		 * @param aCenRepUid central repository Uid
-		 * @param aKeyId     key Id
-		 */
-		CLockAppCenRepObserver( MLockAppObserverInterface* aObserver, TUid aCenRepUid,
-				TUint32 aKeyId );
-
-		/**
-		 * Symbian OS constructor.
-		 */
-		void ConstructL( );
-
-	protected:
-
-		/**
-		 * Observer's callback interface. Not owned.
-		 */
-		MLockAppObserverInterface* iObserver;
-
-		/**
-		 * CenRep value notifier.
-		 */
-		CCenRepNotifyHandler* iNotifyHandler;
-
-		/**
-		 * Access to central repository.
-		 */
-		CRepository* iRepository;
-
-		/**
-		 * Repository Uid.
-		 */
-		TUid iCenRepUid;
-
-		/**
-		 * Repository key Id.
-		 */
-		TUint32 iKeyId;
-
-	};
-
-#endif // __LOCKAPPCENREPOBSERVER_H__
-// END OF FILE
--- a/securitydialogs/lockapp/inc/lockappdevicelockcontainer.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +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:  Devicelock Background UI (window owning control)
- *
-*/
-
-
-#ifndef LOCKAPPDEVICELOCKCONTAINER_H
-#define LOCKAPPDEVICELOCKCONTAINER_H
-
-// INCLUDES
-#include <coecntrl.h>
-#include <eikimage.h>
-#include <eiklabel.h>
-#include <AknSkinnableClock.h>
-
-// FORWARD DECLARATIONS
-class CAknsLayeredBackgroundControlContext;
-
-/**
- *  CLockAppDevicelockContainer class contains UI components 
- *  for the devicelock control.
- *
- *  @lib    lockapp
- *  @since  5.0
- *  @author Joona Petrell
- *  @author Tamas Koteles
- *  @see    CLockAppDevicelockControl
- */
-class CLockAppDevicelockContainer : public CCoeControl, MCoeControlObserver
-	{
-	public:
-
-		/**
-		 * Two-phased constructor.
-		 */
-		static CLockAppDevicelockContainer* CLockAppDevicelockContainer::NewL( RWindowGroup& aWg );
-
-		/**
-		 * Destructor.
-		 */
-		~CLockAppDevicelockContainer( );
-
-	public:
-
-		/**
-		 * From CCoeControl, MopSupplyObject
-		 */
-		TTypeUid::Ptr MopSupplyObject( TTypeUid aId );
-
-	private:
-
-		/**
-		 * 2nd stage construction
-		 */
-		void ConstructL( RWindowGroup& aWg );
-
-		TRect GetMainPaneRect( );
-
-	private:
-
-		void SizeChanged( );
-
-		TInt CountComponentControls( ) const;
-
-		CCoeControl* ComponentControl( TInt aIndex ) const;
-
-		void Draw( const TRect& aRect ) const;
-
-		void HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType );
-
-	private:
-
-		CEikImage* iEikBitmap;
-		CFbsBitmap* iBitmap;
-		CFbsBitmap* iMask;
-
-		// Owned background context.
-		CAknsLayeredBackgroundControlContext* iBgContext;
-
-		// Clock for landscape.
-		CAknSkinnableClock* iClock;
-	};
-
-#endif
-
-// End of File
--- a/securitydialogs/lockapp/inc/lockappdevicelockcontrol.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,238 +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:  Devicelock UI
- *
-*/
-
-
-#ifndef LOCKAPPDEVICELOCKCONTROL_H
-#define LOCKAPPDEVICELOCKCONTROL_H
-
-// INCLUDES
-#include "lockappbasecontrol.h"
-#include "lockappobserverinterface.h"
-#include <etelmm.h>
-#include <rmmcustomapi.h>
-#include <LockDomainCRKeys.h>
-
-// FORWARD DECLARATIONS
-class CLockAppDevicelockContainer;
-class CUserActivityManager;
-class CLockAppPubSubObserver;
-class CLockAppCenRepObserver;
-
-/**
- *  CLockAppDevicelockControl represents the devicelock state in the state machine.
- *  Window-owning compound control that provides visible user interface,
- *  shows the lock bitmap by its child container, handles all events 
- *  and asks for security code if "unlock" is pressed.
- *
- *  @lib    lockapp
- *  @since  5.0
- *  @author Joona Petrell
- *  @author Tamas Koteles
- *  @see    CLockAppBaseControl
- *  @see    CLockAppDevicelockContainer
- *  @see    MLockAppStateControl
- *  @see    CUserActivityManager
- *  @see    CLockAppPubSubObserver
- *  @see    CLockAppCenRepObserver
- */
-class CLockAppDevicelockControl : public CLockAppBaseControl, public MEikCommandObserver,
-		public MLockAppObserverInterface
-	{
-	public:
-
-		/**
-		 * Two-phased constructor.
-		 */
-		static CLockAppDevicelockControl* NewL( MLockAppStateControl& aStateControl,
-				RWindowGroup& aWg );
-
-		/**
-		 * Destructor.
-		 */
-		~CLockAppDevicelockControl( );
-		
-		/**
-		 * Finalize the construction by connecting to Phone side.
-		 */
-		void CLockAppDevicelockControl::ConnectToPhoneL( RWindowGroup& aWg );
-
-		/**
-		 * Is it allowed to activate control.
-		 */
-		TBool ActivationAllowedL( TDevicelockReason aReason );
-
-		/**
-		 * is it allowed to deactivate control.
-		 */
-		TBool DeActivationAllowedL( );
-
-		virtual void HandleActivateEventL( TUint aEnvMask );
-
-		virtual void HandleDeActivateEventL( TUint aEnvMask );
-
-		virtual void HandleEnvironmentChange( TUint aEnvMask, TUint aEventMask );
-
-		/**
-		 * Set the reason for devicelock.
-		 */
-		void SetLockingReason( TDevicelockReason aReason );
-
-	private:
-
-		/**
-		 * Constructor for performing 1st stage construction
-		 */
-		CLockAppDevicelockControl( MLockAppStateControl& aStateControl );
-
-		/**
-		 * 2nd stage construction
-		 */
-		void ConstructL( RWindowGroup& aWg );
-
-		void DefinePubSubKeysL( );
-
-		void HandleUnlockCommandL( );
-
-	public:
-
-		/**
-		 * Handle Central Repository observer callback.
-		 */
-		void HandleCenRepNotify( TUid aCenRepUid, TUint32 aKeyId, TInt aValue );
-
-		/**
-		 * Handle Publish & Subscribe observer callback.
-		 */
-		void HandlePubSubNotify( TUid aPubSubUid, TUint aKeyId, TInt aValue );
-
-	public:
-
-		void HandleResourceChange( TInt aType );
-
-		TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
-
-	private:
-
-		TInt CountComponentControls( ) const;
-
-		CCoeControl* ComponentControl( TInt aIndex ) const;
-
-	private:
-
-		/*
-		 * Checks whether we are booting from a Hidden Reset
-		 */
-		TBool IsHiddenReset( );
-
-		/*
-		 * Checks whether the pin is blocked.
-		 */
-		TBool IsPinBlocked( );
-
-		/*
-		 * Checks whether TARM admin flag is set (optionally unsets it).
-		 */
-		TBool TarmAdminFlag( TBool unSetFlag );
-
-		TBool ETelActivationAllowed( );
-
-		// Get autolock timeout (in seconds)
-		TInt GetAutoLockTimeout( );
-
-		// Starts monitoring user activity
-		void StartActivityMonitoringL( );
-
-		// Gets new autolock period and starts monitoring user activity
-		void ResetInactivityTimeout( );
-
-		// Stop monitoring user activity.
-		void StopActivityMonitoring( );
-
-		// Handles Active event. Called by ActivityManager
-		static TInt HandleActiveEventL( TAny* aPtr );
-
-		// Handles Inactive event. Called by ActivityManager
-		static TInt HandleInactiveEventL( TAny* aPtr );
-
-		// Set custom status pane visible/invisible
-		void ShowStatusPane( const TBool aVisible );
-
-	private:
-
-		/**
-		 * From @c MEikCommandObserver. Dialogs and CBA send
-		 * UI commands to parent using method ProcessCommandL.
-		 *
-		 * @param aCommandId Command to be handled
-		 */
-		void ProcessCommandL( TInt aCommandId );
-
-	private:
-
-		/*****************************************************
-		 *    S60 Customer / ETel
-		 *    S60 ETel API
-		 *****************************************************/
-
-		RTelServer iTelServer;
-		int iTelServerInitialized;
-		RMobilePhone iPhone;
-		int iPhoneInitialized;
-		RMmCustomAPI iCustomPhone;
-		int iCustomPhoneInitialized;
-
-		/**
-		 * Devicelock auto-locking timeout observer 
-		 * (value in minutes)
-		 */
-		CLockAppCenRepObserver* iCRAutoLockTime;
-
-		/**
-		 * Devicelock status publisher.
-		 * (Permamanent setting: On/Off)
-		 */
-		CLockAppCenRepObserver* iCRAutoLockStatus;
-
-		/**
-		 * Autolock state PubSub publisher.
-		 * (Runtime setting)
-		 */
-		CLockAppPubSubObserver* iPSAutolockState; 
-
-		/**
-		 * User activity manager/observer
-		 */
-		CUserActivityManager* iActivityManager;
-
-		/**
-		 * Background image container control
-		 */
-		CLockAppDevicelockContainer* iContainer;
-
-		/**
-		 * Feature manager value for CDMA protocol
-		 */
-		TBool iFeatureProtocolCdma;
-
-		/**
-		 * Is security code query shown
-		 */
-		TBool iShowingSecCodeQuery;
-
-	};
-
-#endif // LOCKAPPDEVICELOCKCONTROL_H
--- a/securitydialogs/lockapp/inc/lockappdocument.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +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:  LockApp application document class
- *
-*/
-
-
-#ifndef __LOCKAPP_DOCUMENT_H__
-#define __LOCKAPP_DOCUMENT_H__
-
-// INCLUDES
-#include <AknDoc.h>
-
-// FORWARD DECLARATIONS
-class CLockAppAppUi;
-class CEikApplication;
-
-/**
- *  CLockAppDocument class is derived from CAknDocument,
- *  based on standard Avkon document template.
- *
- *  @lib    lockapp
- *  @since  5.0
- *  @author Joona Petrell
- *  @author Tamas Koteles
- */
-class CLockAppDocument : public CAknDocument
-	{
-	public:
-
-		/**
-		 * Two-phased constructor.
-		 *
-		 * @param aApp application class
-		 */
-		static CLockAppDocument* NewL( CEikApplication& aApp );
-		static CLockAppDocument* NewLC( CEikApplication& aApp );
-
-		/**
-		 * Destructor
-		 */
-		~CLockAppDocument( );
-
-	public:
-
-		/*
-		 * From @c CAknDocument. Creates AppUi.
-		 *
-		 * @return generic AppUI object
-		 */
-		CEikAppUi* CreateAppUiL( );
-
-	private:
-
-		/**
-		 * Second constructor that can fail (leave).
-		 */
-		void ConstructL( );
-
-		/**
-		 * C++ default constructor.
-		 */
-		CLockAppDocument( CEikApplication& aApp );
-
-	};
-
-#endif // __LOCKAPP_DOCUMENT_H__
--- a/securitydialogs/lockapp/inc/lockappecsdetector.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +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:  Provides emergency call support for keyguard/devicelock
- *
-*/
-
-
-#ifndef __LOCKAPPSTATEDETECTOR_H__
-#define __LOCKAPPSTATEDETECTOR_H__
-
-// INCLUDES
-#include "lockappstateobserver.h"
-#include <AknEcs.h> // MAknEcsObserver and CAknEcsDetector
-
-// FORWARD DECLARATIONS
-class CLockAppEcsNote;
-
-/**
- *  CLockAppEcsDetector class owns emergency note and emergency detector.
- *  Taps directly to AppUi windowserver event source for receiving key events.
- *  If user presses emergency numbers defined in SIM, emergency note is shown.
- *  Only works when keyguard or devicelock is activated.
- *
- *  @lib    lockapp
- *  @since  5.0
- *  @author Joona Petrell
- *  @author Tamas Koteles
- */
-class CLockAppEcsDetector : public CBase, public MLockAppStateObserver, public MAknEcsObserver
-    {
-    public:
-
-        /**
-         * Two-phased constructor.
-         */
-        static CLockAppEcsDetector* NewL( );
-
-        /**
-         * Destructor
-         */
-        ~CLockAppEcsDetector( );
-
-    private:
-
-        /**
-         * C++ default constructor.
-         */
-        CLockAppEcsDetector( );
-
-        /**
-         * Second constructor that can fail (leave).
-         */
-        void ConstructL( );
-
-    public:
-
-        /**
-         * From @c CLockAppStateObserver. Method handles the lock state changes.
-         *
-         * @param aLockStatus The new lock state
-         */
-        virtual void HandleLockStatusChangedL( TLockStatus aLockStatus );
-
-    private:
-
-        /**
-         * From @c MAknEcsObserver. Handles changes in emergency call detector.
-         * @param aEcsDetector a pointer to ecsdetector component
-         * @param aState the new emergency detector state.
-         */
-        void HandleEcsEvent( CAknEcsDetector* aEcsDetector, CAknEcsDetector::TState aState );
-
-    public:
-
-        /**
-         * Emergency note is visible.
-         *
-         * @return true if emergency note is on the screen.
-         */
-        TBool EcsNoteOnScreen( ) const;
-
-        /**
-         * Internal Method only used for testing since emergency number
-         * detection does not work in emulator.
-         *
-         * @return KErrNone if there were no problems
-         */
-        TInt TestEcsNote( );
-
-    private:
-
-        /**
-         * Receives emergency number key events and handles emergency dialing.
-         * Own.
-         */
-        CAknEcsDetector* iEcsDetector;
-
-        /**
-         * Emergency note to be shown when user has dialed emergency number.
-         * Own.
-         */
-        CLockAppEcsNote* iEcsNote;
-
-    };
-
-#endif // __LOCKAPPSTATEDETECTOR_H__
-// End of File
-
--- a/securitydialogs/lockapp/inc/lockappecsnote.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +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:  Emergency number dialog
- *
-*/
-
-
-#ifndef __LOCKAPPECSNOTE_H__
-#define __LOCKAPPECSNOTE_H__
-
-// INCLUDES
-#include <aknnotedialog.h>
-
-/**
- *  CLockAppEcsNote class is derived from Avkon note implementation;
- *  shows emergency numbers on a dialog once the user has dialed
- *  the numbers.
- *
- *  @lib    lockapp
- *  @since  5.0
- *  @author Joona Petrell
- *  @author Tamas Koteles
- */
-class CLockAppEcsNote : public CAknNoteDialog
-    {
-    public:
-
-        /**
-         * C++ constructor.
-         */
-        CLockAppEcsNote( );
-
-        /**
-         * Destructor.
-         */
-        ~CLockAppEcsNote( );
-
-    public:
-
-        /**
-         * Constructs sleeping note
-         */
-        void ConstructSleepingNoteL( TInt aResourceId );
-
-        /**
-         * Shows sleeping note
-         */
-        TInt ShowNote( );
-
-        /**
-         * Hides sleeping note
-         */
-        void SleepNote( );
-
-        /**
-         * Consume key events
-         */
-        TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
-
-        /**
-         * API to set the emergency number to be displayed
-         *
-         * aMatchedNumber    text to display (e.g. "112" )
-         */
-        void SetEmergencyNumber( const TDesC& aMatchedNumber );
-
-    public:
-
-        TBool iNoteOnScreen;
-
-    };
-
-#endif // __LOCKAPPECSNOTE_H__
-// End of File
--- a/securitydialogs/lockapp/inc/lockappidlecontrol.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +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:  Idle (unlocked) UI
- *
-*/
-
-
-#ifndef LOCKAPPIDLECONTROL_H
-#define LOCKAPPIDLECONTROL_H
-
-// INCLUDES
-#include <eiknotapi.h>
-#include <eikbtgpc.h>
-#include <AknNotifyStd.h>
-#include <aknnotedialog.h>
-#include <AknNotifierControllerPlugin.h>
-#include <AknQueryDialog.h>   // phone query
-#include "lockappbasecontrol.h"
-
-/**
- *  CLockAppIdleControl class represents the unlocked state in the locking state machine.
- * 
- *  @lib    lockapp
- *  @since  5.0
- *  @author Joona Petrell
- *  @author Tamas Koteles
- *  @see    CLockAppBaseControl
- *  @see    MLockAppStateControl
- */
-class CLockAppIdleControl : public CLockAppBaseControl, public MEikCommandObserver
-    {
-    public:
-
-        /**
-         * Two-phased constructor.
-         */
-        static CLockAppIdleControl* NewL( MLockAppStateControl& aStateControl );
-
-        /**
-         * Destructor.
-         */
-        ~CLockAppIdleControl( );
-
-    private:
-
-        /**
-         * Constructor for performing 1st stage construction
-         */
-        CLockAppIdleControl( MLockAppStateControl& aStateControl );
-
-        /**
-         * EPOC default constructor for performing 2nd stage construction
-         */
-        void ConstructL( );
-
-    public:
-
-        void OfferKeyLock( );
-
-        void CancelOfferKeyLock( );
-
-        void HandleActivateEventL( TUint aEnvMask );
-
-        void HandleDeActivateEventL( TUint aEnvMask );
-
-    public:
-
-        void HandleResourceChange( TInt aType );
-
-        TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
-
-    private:
-
-        TInt CountComponentControls( ) const;
-
-        CCoeControl* ComponentControl( TInt aIndex ) const;
-
-    private:
-        /**
-         * From @c MEikCommandObserver. Dialogs and CBA send
-         * UI commands to parent using method ProcessCommandL.
-         *
-         * @param aCommandId Command to be handled
-         */
-        void ProcessCommandL( TInt aCommandId );
-
-    private:
-
-        // "offer to lock keys" note
-        CLockAppLockedNote* iOfferLockNote;
-
-    };
-
-#endif // LOCKAPPIDLECONTROL_H
--- a/securitydialogs/lockapp/inc/lockappkeycapturecontroller.h	Thu Aug 19 10:45:23 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:  Key capture controller
- *
-*/
-
-
-#ifndef __LOCKAPPKEYCAPTURECONTROLLER_H__
-#define __LOCKAPPKEYCAPTURECONTROLLER_H__
-
-//  INCLUDES
-#include <e32base.h>
-#include <e32keys.h>
-
-// enumerated type for captured key events
-enum TPhoneKeyCaptureType
-    {
-    EKeyCaptureEvent,
-    EKeyCaptureUpAndDownEvents,
-    EKeyCaptureAllEvents
-    };
-
-// Key capture data structure
-class TPhoneKeyCapture
-    {
-    public:
-        TStdScanCode iKey; // primary identifier
-        TKeyCode iKeyCode;
-        TPhoneKeyCaptureType iType;
-        TInt32 iHandle;
-        TInt32 iHandleForUpAndDown;
-    };
-
-// FORWARD DECLARATIONS
-class RWindowGroup;
-
-/**
- *  CLockAppKeyCaptureController class is a simple key capture utily that
- *  provides a way to capture/release keys for the current window group.
- *
- *  @lib    lockapp
- *  @since  5.0
- *  @author Joona Petrell
- *  @author Tamas Koteles
- */
-class CLockAppKeyCaptureController : public CBase
-    {
-    public:
-
-        /**
-         * Initialize the utility
-         */
-        static CLockAppKeyCaptureController* InitL( RWindowGroup& aWindowGroup );
-
-        /**
-         * Destroy the utility
-         */
-        static void Destroy( );
-
-        /**
-         * Set key to be captured
-         */
-        static void CaptureKey( TUint32 aKey, TUint32 aKeyCode, TPhoneKeyCaptureType aType );
-
-        /**
-         * Set key to be released
-         */
-        static void ReleaseKey( TUint32 aKey );
-
-    private:
-
-        /**
-         * C++ default constructor.
-         */
-        CLockAppKeyCaptureController( RWindowGroup& aWindowGroup );
-
-        /**
-         * Destructor.
-         */
-        virtual ~CLockAppKeyCaptureController( );
-
-    private:
-
-        /**
-         * Set key to be captured
-         */
-        void StartCapturingKey( TUint32 aKey, TUint32 aKeyCode, TPhoneKeyCaptureType aType );
-
-        /**
-         * Set key not to be captured
-         */
-        void StopCapturingKey( TUint32 aKey );
-
-        /**
-         * May be used to ask whether a key has been set to be captured or not
-         * @param aKey is the iScanCode of the key
-         * @return ETrue if the key is currently captured via this mechanism
-         */
-        TBool IsKeyCaptured( TUint32 aKey ) const;
-
-        /**
-         * Set key not to be captured
-         * @param aKeyCapture is the key not to be captured
-         */
-        void StopKeyCapture( TPhoneKeyCapture aKeyCapture );
-
-    private:
-
-        /**
-         * Private instance of the utility
-         */
-        static CLockAppKeyCaptureController* instance;
-
-        /**
-         * Array of keycodes currently captured which includes the window
-         * server handles for the captured keys.
-         */
-        RArray<TPhoneKeyCapture> iCapturedKeys;
-
-        /**
-         * application's window group
-         */
-        RWindowGroup& iWindowGroup;
-
-    };
-
-#endif  // LOCKAPPKEYCAPTURECONTROLLER_H
-
-// End of File
--- a/securitydialogs/lockapp/inc/lockappkeyguardcontrol.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,207 +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:  Keyguard UI (window-owning compound control)
- *
-*/
-
-
-#ifndef __LOCKAPPKEYGUARDCONTROL_H__
-#define __LOCKAPPKEYGUARDCONTROL_H__
-
-// INCLUDES
-#include "lockappbasecontrol.h"
-#include "lockappobserverinterface.h"
-#include <LockDomainCRKeys.h>
-
-// FORWARD DECLARATIONS
-class CLockAppPubSubObserver;
-class CLockAppCenRepObserver;
-class CUserActivityManager;
-
-/**
- *  CLockAppKeyguardControl class represents the keyguard state in the state machine. 
- *  Window-owning compound control that provides visible keyguard user interface. 
- *  Owns all keyguard dialogs and commands received from the child controls like 
- *  dialogs and cba.
- *
- *  @lib    lockapp
- *  @since  5.0
- *  @author Joona Petrell
- *  @author Tamas Koteles
- *  @see    CLockAppBaseControl
- *  @see    MLockAppStateControl
- *  @see    CUserActivityManager
- *  @see    CLockAppPubSubObserver
- *  @see    CLockAppCenRepObserver
- */
-class CLockAppKeyguardControl : public CLockAppBaseControl, public MEikCommandObserver,
-        public MLockAppObserverInterface
-    {
-    public:
-
-        /**
-         * Two-phased constructor.
-         *
-         * @param aStateControl reference to the main state control
-         */
-        static CLockAppKeyguardControl* NewL( MLockAppStateControl& aStateControl );
-
-        /**
-         * Destructor.
-         */
-        ~CLockAppKeyguardControl( );
-
-        TBool ActivationAllowedL( );
-
-        TBool DeActivationAllowedL( );
-
-        virtual void HandleActivateEventL( TUint aEnvMask );
-
-        virtual void HandleDeActivateEventL( TUint aEnvMask );
-
-        virtual void HandleEnvironmentChange( TUint aEnvMask, TUint aEventMask );
-
-    private:
-
-        /**
-         * C++ default constructor.
-         *
-         * @param aStateControl reference to the main state control
-         */
-        CLockAppKeyguardControl( MLockAppStateControl& aStateControl );
-
-        /**
-         * Second constructor that can fail (leave).
-         */
-        void ConstructL( );
-
-    public:
-
-        void DisplayLockedNote( );
-
-        void DisplayKeysLockedNote( );
-
-        void DisplayKeysActiveNote( );
-
-    public:
-
-        void HandleResourceChange( TInt aType );
-
-        TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
-
-    public:
-
-        /**
-         * Handle Central Repository observer callback.
-         */
-        void HandleCenRepNotify( TUid aCenRepUid, TUint32 aKeyId, TInt aValue );
-
-        /**
-         * Handle Publish & Subscribe observer callback.
-         */
-        void HandlePubSubNotify( TUid aPubSubUid, TUint aKeyId, TInt aValue );
-
-    private:
-
-        TInt CountComponentControls( ) const;
-
-        CCoeControl* ComponentControl( TInt aIndex ) const;
-
-    private:
-
-        /**
-         * UI commands to parent using method ProcessCommandL.
-         *
-         * @param aCommandId Command to be handled
-         */
-        void ProcessCommandL( TInt aCommandId );
-
-    private:
-
-        void DisplayConfirmationNote( );
-
-        // Is allowed to auto lock keys
-        TBool AutoActivationAllowedL( );
-
-        // Get auto keyguard timeout
-        TInt GetAutoKeyguardTimeout( );
-
-        // Starts monitoring user activity
-        void StartActivityMonitoringL( );
-
-        // Gets new autolock period and starts monitoring user activity
-        void ResetInactivityTimeout( );
-
-        // Stop monitoring user activity.
-        void StopActivityMonitoring( );
-
-        // Handles Active event. Called by ActivityManager
-        static TInt HandleActiveEventL( TAny* aPtr );
-
-        // Handles Inactive event. Called by ActivityManager
-        static TInt HandleInactiveEventL( TAny* aPtr );
-
-    private:
-
-        /**
-         * "Now press *" confirmation note.
-         */
-        CLockAppLockedNote* iConfirmationNote;
-
-        /**
-         * "Keys are locked. Press Unlock" note.
-         */
-        CLockAppLockedNote* iLockedNote;
-
-        /**
-         * "Keys locked" note
-         */
-        CLockAppLockedNote* iKeypadLockedNote;
-
-        /**
-         * "Keys activated" note
-         */
-        CLockAppLockedNote* iKeypadUnlockedNote;
-
-        /**
-         * CenRep observers
-         */
-        CLockAppCenRepObserver* iCRAutoKeyguardTime;
-        CLockAppCenRepObserver* iCRPersistentKeyguardStatus;
-
-        /**
-         * PubSub observers
-         */
-        CLockAppPubSubObserver* iPSStartupObserver;
-
-        /**
-         * User activity manager
-         */
-        CUserActivityManager* iActivityManager;
-
-        /**
-         * Hardware support for keyguard
-         */
-        TLockHardware iHardwareSupport;
-
-        /**
-         * Flags if we had already normal state
-         */
-        TBool iAlreadyNormalState;
-
-    };
-
-#endif // __LOCKAPPKEYGUARDCONTROL_H__
-
-// End of File
--- a/securitydialogs/lockapp/inc/lockappkeypattern.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,183 +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:  Key pattern matching component.
- *
-*/
-
-
-#ifndef __LOCKAPPKEYPATTERN__
-#define __LOCKAPPKEYPATTERN__
-
-// INCLUDES
-#include <w32std.h>
-#include <e32base.h>
-
-enum TPatternState
-    {
-    EPatternNotInitialized = 1,
-    EPatternNotEnabled,
-    EPatternNoMatch,
-    EPatternPrimaryMatch,
-    EPatternSecondaryMatch,
-    };
-
-/**
- *  CLockAppKeyPattern class implements a 2-key pattern matcher. 
- *  Can be used for both iCodes and iScancodes, as it matches integer numbers. 
- *  The caller's responsability is to make sense what is beeing matched. 
- *  Multiple patterns can be defined.
- *
- *  @lib    lockapp
- *  @since  5.0
- *  @author Tamas Koteles
- */
-class CLockAppKeyPattern : public CBase
-    {
-    public:
-
-        /**
-         * Two phased constructor.
-         */
-        static CLockAppKeyPattern* NewL( );
-
-        /**
-         * Destructor.
-         */
-        ~CLockAppKeyPattern( );
-
-        /**
-         * If no patterns have been defined it cannot be used.
-         * @return ETrue if has succesfully loaded policy
-         */
-        TBool HasPatterns( );
-
-        /**
-         * Gets the enabled state.
-         *
-         * @return true if the patterns are enabled, false othewise
-         */
-        TBool IsEnabled( );
-
-        /**
-         * Sets the enabled state.
-         */
-        void SetEnabled( TBool aEnabled );
-
-        /**
-         * Gets the primary key timeout.
-         *
-         * @return the timeout in miliseconds
-         */
-        TUint GetKeyTimeOut( );
-
-        /**
-         * Sets the primary key timeout.
-         *
-         */
-        void SetKeyTimeOut( TUint aTimeOut );
-
-        /**
-         * Adds a key combination.
-         *
-         * @param aPrimaryKey code for primary key
-         * @param aSecondaryKey code for secondary key
-         * @return standard Symbian error code
-         */
-        TInt AddPattern( TUint32 aPrimaryKey, TUint32 aSecondaryKey );
-
-        /**
-         * Gets a key combination.
-         *
-         * @param aIndex index of the key combination
-         * @param aPrimaryKey primary key code if found
-         * @param aSecondaryKey secondary key code if found
-         * @return standard Symbian error code
-         */
-        TInt GetPattern( TInt aIndex, TUint32& aPrimaryKey, TUint32& aSecondaryKey );
-
-        /**
-         * Clears all the defined key combinations.
-         *
-         * @return standard Symbian error code
-         */
-        TInt ClearPatterns( );
-
-        /**
-         * Handles Key events. Result of the event is returned in the pattern state.
-         *
-         * @param aKey the actual key event (code or scancode)
-         * @return TPatternState caused by the event.
-         */
-        TPatternState HandleKeyEvent( TUint32 aKey );
-
-    protected:
-
-        /**
-         * C++ default constructor (private so cannot be derived).
-         */
-        CLockAppKeyPattern( );
-
-        /**
-         * Second constructor initializes the policy
-         */
-        void ConstructL( );
-
-    private:
-
-        /**
-         * A primary key has been received, set primary-match state.
-         */
-        void HandlePrimaryKeyEvent( TUint32 aKey );
-
-        /**
-         * A secondary key has been received, set secondary-match state.
-         */
-        void HandleSecondaryKeyEvent( );
-
-        /**
-         * Any other key has been received, set no-match state.
-         */
-        void HandleOtherKeyEvent( );
-
-        /**
-         * A call back to the keylock timer
-         * param TAny aSelf a pointer to the parent class
-         */
-        static TInt HandleKeyTimerTimeout( TAny* aSelf );
-
-    private:
-
-        // defined configurations
-        RArray<TUint> iPrimaryKeys;
-        RArray<TUint> iSecondaryKeys;
-        RArray<TUint> iWaitingKeys;
-
-        // defined timeout
-        TUint iKeyTimeOut;
-
-        // first key pressed
-        TPatternState iState;
-
-        // if the keypatterns are enabled
-        TBool iEnabled;
-
-        // if the keylock policy exists
-        TBool iHasPatterns;
-
-        // timer used between primary and secondary keys
-        CPeriodic* iKeyTimer;
-
-    };
-
-#endif // __LOCKAPPKEYPATTERN__
--- a/securitydialogs/lockapp/inc/lockapplockednote.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +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:  Sleeping note with timeout and a reference flag that informs
- *                the parent when the note is visible
- *
-*/
-
-
-#include "lockappsleepingnote.h"
-
-#ifndef __LOCKAPPLOCKEDNOTE_H__
-#define __LOCKAPPLOCKEDNOTE_H__
-
-const TInt KNoteCmdFocusLost = 3100;
-
-/**
- *  CLockAppLockedNote class is used as the basic dismissable note in Lockapp.
- *
- *  @lib    lockapp
- *  @since  5.0
- *  @author Joona Petrell
- *  @author Tamas Koteles
- */
-class CLockAppLockedNote : public CLockAppSleepingNote
-    {
-    public:
-
-        /**
-         * C++ default constructor.
-         *
-         * @param aCommandObserver pointer to parent implementing observer interface
-         */
-        CLockAppLockedNote( MEikCommandObserver* aCommandObserver = NULL );
-
-        /**
-         * Destructor.
-         */
-        ~CLockAppLockedNote( );
-
-        /**
-         * Locked note can be canceled.
-         */
-        void CancelNote( );
-
-        /**
-         * From @c CCoeControl. Used to inform parent that
-         * dialog is no longer in focus.
-         */
-        void FocusChanged( TDrawNow aDrawNow );
-
-    };
-
-#endif // __LOCKAPPLOCKEDNOTE_H__
--- a/securitydialogs/lockapp/inc/lockappobserverinterface.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +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:  Interface for CenRep and PubSub observers
- *
-*/
-
-
-#ifndef __LOCKAPPOBSERVERINTERFACE_H__
-#define __LOCKAPPOBSERVERINTERFACE_H__
-
-// INCLUDES
-#include "lockapp.hrh"
-
-/**
- *  MLockAppObserverInterface class offers a CenRep/PubSub observer interface.
- *  Observer classes should implement this interface to get callback notifications
- *  on value changes.
- *
- *  @lib    lockapp
- *  @since  5.0
- *  @author Tamas Koteles
- */
-class MLockAppObserverInterface
-	{
-	public:
-
-		/** 
-		 * Handle Central Repository observer callback.
-		 *
-		 * @param aCenRepUid  Central Repository category id
-		 * @param aKeyId      Central Repository key id
-		 * @param aValue      Central Repository key's new value
-		 */
-		virtual void HandleCenRepNotify( TUid aCenRepUid, TUint32 aKeyId, TInt aValue ) = 0;
-
-		/** 
-		 * Handle Publish & Subscribe observer callback.
-		 *
-		 * @param aPubSubUid  Publish & Subscribe category id
-		 * @param aKeyId      Publish & Subscribe key id
-		 * @param aValue      Publish & Subscribe key's new value
-		 */
-		virtual void HandlePubSubNotify( TUid aPubSubUid, TUint aKeyId, TInt aValue ) = 0;
-
-	};
-
-#endif // __LOCKAPPOBSERVERINTERFACE_H__
-// End of File
--- a/securitydialogs/lockapp/inc/lockappobserverlist.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +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:  Controls observers and publishes state changes
- *
-*/
-
-
-#ifndef __LOCKAPPOBSERVERLIST_H__
-#define __LOCKAPPOBSERVERLIST_H__
-
-// INCLUDES
-#include <coecntrl.h>
-#include "lockapp.hrh"
-
-// FORWARD DECLARATIONS
-class MLockAppStateObserver;
-
-/**
- *  CLockAppObserverList class publishes lock state changes to all implemented state 
- *  observers. The list owns all childs and it is responsible for deleting them.
- *
- *  @lib    lockapp
- *  @since  5.0
- *  @author Joona Petrell
- *  @author Tamas Koteles
- */
-class CLockAppObserverList : public CCoeControl
-    {
-    public:
-
-        /**
-         * C++ default constructor.
-         */
-        CLockAppObserverList( );
-
-        /**
-         * Destructor.
-         */
-        virtual ~CLockAppObserverList( );
-
-    public:
-
-        /**
-         * Add new state observer.
-         * @param aObserver lock state observer
-         */
-        void AddObserverL( MLockAppStateObserver* aObserver );
-
-        /**
-         * Remove lock state observer.
-         * @param aObserver lock state observer
-         */
-        void RemoveObserver( MLockAppStateObserver* aObserver );
-
-    protected:
-
-        /**
-         * Has to be called by the derived class in the construction.
-         */
-        void BaseConstructL( );
-
-        /**
-         * Informs all observers about the status change.
-         *
-         * @param aStatusChange the new lock state.
-         */
-        void PostStatusChangeL( TLockStatus aStatusChange );
-
-        /**
-         * Class that derives from observer list will have first
-         * notification about the lock status chane.
-         *
-         * @param aLockStatus the new lock state.
-         */
-        virtual void HandleLockStatusChangedL( TLockStatus aLockStatus );
-
-    private:
-
-        /**
-         * Dynamic list storing observers. Both the list and observers are owned.
-         * Own.
-         */
-        RPointerArray<MLockAppStateObserver>* iObserverList;
-
-    };
-
-#endif // __LOCKAPPOBSERVERLIST_H__
-// End of File
--- a/securitydialogs/lockapp/inc/lockapppubsubobserver.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,129 +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:  Publish & Subscribe key observer
- *
-*/
-
-
-#ifndef __LOCKAPPPUBSUBOBSERVER_H__
-#define __LOCKAPPPUBSUBOBSERVER_H__
-
-// INCLUDES
-#include <w32std.h>
-#include <e32svr.h>
-#include <e32property.h>
-#include "lockappobserverinterface.h"
-
-/**
- *  CLockAppPubSubObserver class implements a Publish & Subscribe key observer.
- *  It can be used to monitor and also to set a PubSub key.
- *
- *  @lib    lockapp
- *  @since  5.0
- *  @author Tamas Koteles
- */
-class CLockAppPubSubObserver : public CActive
-	{
-	public:
-
-		/**
-		 * Two-phased constructor.
-		 *
-		 * @param aObserver   pointer to observer
-		 * @param aPubSubUid  publish & subscribe Uid
-		 * @param aKeyId      publish & subscribe key id
-		 * @return            the instance just created.
-		 */
-		static CLockAppPubSubObserver* NewL( MLockAppObserverInterface* aObserver, TUid aPubSubUid,
-				TUint32 aKeyId );
-
-		/**
-		 * Destructor.
-		 */
-		~CLockAppPubSubObserver( );
-
-		/**
-		 * Start obsering PubSub key
-		 */
-		TInt Start( );
-
-		/**
-		 * Stop observing PubSub key
-		 */
-		void Stop( );
-
-		/**
-		 * Get key value from P&S.
-		 */
-		TInt GetKeyValue( TInt& aValue );
-
-		/**
-		 * Set key value to P&S.
-		 */
-		TInt SetKeyValue( TInt aValue );
-
-	protected:
-
-		/**
-		 * C++ default constructor.
-		 *
-		 * @param aObserver observer
-		 * @param aPubSubUid publish & subscribe Uid
-		 * @param aKeyId key id
-		 */
-		CLockAppPubSubObserver( MLockAppObserverInterface* aObserver, TUid aPubSubUid,
-				TUint32 aKeyId );
-
-		/**
-		 * Symbian OS constructor.
-		 */
-		void ConstructL( );
-
-	private:
-
-		void RunL( );
-
-		void DoCancel( );
-
-	protected:
-
-		/**
-		 * Observer's callback interface. Not owned.
-		 */
-		MLockAppObserverInterface* iObserver;
-
-		/**
-		 * Access to Publish & Subscribe.
-		 */
-		RProperty iProperty;
-
-		/**
-		 * Publish & Subscribe Uid.
-		 */
-		TUid iPubSubUid;
-
-		/**
-		 * Publish & Subscribe key Id.
-		 */
-		TUint32 iKeyId;
-
-		/**
-		 * Publish & Subscribe key's value.
-		 */
-		TInt iValue;
-
-	};
-
-#endif // __LOCKAPPPUBSUBOBSERVER_H__
-// END OF FILE
--- a/securitydialogs/lockapp/inc/lockappserver.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +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:  Server implementation that responses to client API in
- *                lockclient
- *
-*/
-
-
-#ifndef __LOCKAPPSERVER_H__
-#define __LOCKAPPSERVER_H__
-
-// INCLUDES
-#include <apaserverapp.h>
-
-/**
- *  CLockAppServer class implements the application server of LockApp.
- *  The server is created with a fixed server name and offers only one service.
- *
- *  @lib    lockapp
- *  @since  5.0
- *  @author Joona Petrell
- *  @author Tamas Koteles
- */
-class CLockAppServer : public CApaAppServer
-	{
-	public:
-
-		/**
-		 * Two-phased constructor.
-		 */
-		static CLockAppServer* NewL( const TDesC& aFixedServerName );
-
-		/**
-		 * Offers support for multiple services, but only one is supported/used by LockApp Server.
-		 * 
-		 * @param aServiceType uid used to identify different services.
-		 */
-		CApaAppServiceBase* CreateServiceL( TUid aServiceType ) const;
-
-	private:
-
-		/**
-		 * C++ default constructor.
-		 */
-		CLockAppServer( );
-
-		/**
-		 * Establishes a new session between client and server.
-		 * 
-		 * @param aVersion for support of new server client-server API variations (not used).
-		 * @param aMessage message that started the session.
-		 */
-		CSession2* NewSessionL( const TVersion& aVersion, const RMessage2& aMessage ) const;
-
-	private:
-
-		// how many sessions are created to the server
-		TInt iSessionCount;
-
-	};
-
-#endif //__LOCKAPPSERVER_H__
--- a/securitydialogs/lockapp/inc/lockappsession.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,126 +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:  LockApp server session requested by lockclient
- *
-*/
-
-
-#ifndef __LOCKAPPSESSION_H__
-#define __LOCKAPPSESSION_H__
-
-// INCLUDES
-#include <apaserverapp.h>
-#include "lockapp.hrh"
-
-// FORWARD DECLARATIONS
-class MLockAppStateControl;
-
-/**
- *  CLockAppSession class is the server side implementation of the Lockapp API. 
- *  The session class offers keyguard and devicelock API for clients wanting to 
- *  alter phone lock states.
- *
- *  @lib    lockapp
- *  @since  5.0
- *  @author Joona Petrell
- *  @author Tamas Koteles
- */
-class CLockAppSession : public CApaAppServiceBase
-	{
-	public:
-
-		/**
-		 * C++ default constructor.
-		 */
-		CLockAppSession( );
-
-	private:
-		/**
-		 * Destructor.
-		 */
-		~CLockAppSession( );
-
-		/**
-		 * From @c CApaAppServiceBase. Handles possible error in
-		 * service. Method is empty.
-		 * @param aMessage received message
-		 * @param aError an error id
-		 */
-		void ServiceError( const RMessage2& aMessage, TInt aError );
-
-		/**
-		 * From @c CApaAppServiceBase. Receives messages.
-		 * @param aMessage received message
-		 */
-		void ServiceL( const RMessage2& aMessage );
-
-	private:
-
-		/**
-		 * Ask state control to activate keyguard lock.
-		 *
-		 * @param aWithNote if "keys locked" note is shown
-		 * @return error code
-		 */
-		TInt DoEnableKeyguardL( TBool aWithNote );
-
-		/**
-		 * Ask state control to deacctivate keyguard lock.
-		 *
-		 * @param aWithNote if "keys active" note is shown.
-		 * @return error code
-		 */
-		TInt DoDisableKeyguardL( TBool aWithNote );
-
-		/**
-		 * Ask state control to activate devicelock.
-		 * @return error code
-		 */
-		TInt DoEnableDevicelockL( TDevicelockReason aReason );
-
-		/**
-		 * Ask state control to deactivate devicelock.
-		 * @return error code
-		 */
-		TInt DoDisableDevicelockL( );
-
-		/**
-		 * Ask state control to offer to enable keyguard.
-		 * by showing "offerkeylock" note.
-		 * @return error code
-		 */
-		TInt DoOfferKeyguardL( );
-
-		/**
-		 * Ask state control to inform user that keys are locked.
-		 * @return error code
-		 */
-		TInt DoShowKeysLockedNoteL( );
-
-	private:
-
-		/**
-		 * Access to lock state control
-		 * @return the main state control, from which lock states are changed
-		 */
-		MLockAppStateControl* StateControlL( );
-
-		/**
-		 * The main state control
-		 * Not owned.
-		 */
-		MLockAppStateControl* iStateControl;
-	};
-
-#endif //__LOCKAPPSESSION_H__
--- a/securitydialogs/lockapp/inc/lockappsleepingnote.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +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:  Sleeping note with timeout
- *
-*/
-
-
-#include <aknnotedialog.h>
-
-#ifndef __LOCKAPPSLEEPINGNOTE_H__
-#define __LOCKAPPSLEEPINGNOTE_H__
-
-/**
- *  CLockAppSleepingNote class implement notes that are not destroyed between use. 
- *  Note is shown with timeout and internal changes are reported to parent 
- *  trough command observer interface.
- *
- *  @lib    lockapp
- *  @since  5.0
- *  @author Joona Petrell
- *  @author Tamas Koteles
- */
-class CLockAppSleepingNote : public CAknNoteDialog
-	{
-	public:
-
-		/**
-		 * C++ default constructor.
-		 *
-		 * @param aCommandObserver pointer to parent
-		 *                         implementing observer interface
-		 */
-		CLockAppSleepingNote( MEikCommandObserver* aCommandObserver = NULL );
-
-		/**
-		 * Sleeping note is constructed from a resource
-		 */
-		void ConstructSleepingNoteL( TInt aResourceId );
-
-		/**
-		 * Destructor.
-		 */
-		~CLockAppSleepingNote( );
-
-		/**
-		 * Show sleeping note with given timeout.
-		 * @param aTimeout how long note will be displayed.
-		 * @param aTone tone to be played.
-		 */
-		TInt ShowNote( const TInt aTimeout, const TTone aTone );
-
-		/**
-		 * Always called when note is dismissed
-		 *
-		 * @param aCommand reason for exit.
-		 */
-		TBool OkToExitL( TInt aCommand );
-
-		/**
-		 * Handles key events (from CoeControl)
-		 */
-		TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
-
-	protected:
-
-		void HandleResourceChange( TInt aType );
-
-		// pointer to keyguard UI
-		MEikCommandObserver* iCommandObserver;
-
-		// resource id is reserved for animation skin change
-		TInt iResourceId;
-
-	};
-
-#endif // __LOCKAPPSLEEPINGNOTE_H__
--- a/securitydialogs/lockapp/inc/lockappstatecontrol.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,322 +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:  Controls lock states (keyguard locked/unlocked, devicelock)
- *
-*/
-
-
-#ifndef __LOCKAPPSTATECONTROL_H__
-#define __LOCKAPPSTATECONTROL_H__
-
-// INCLUDES
-#include "lockappobserverlist.h"
-#include "lockappstatecontrolinterface.h"
-#include "lockappobserverinterface.h"
-#include <lockappclientserver.h>
-
-// FORWARD DECLARATIONS
-class CLockAppBaseControl;
-class CLockAppIdleControl;
-class CLockAppKeyguardControl;
-class CLockAppDevicelockControl;
-class CLockAppEcsDetector;
-class CLockAppPubSubObserver;
-class CAknIncallBubble;
-
-/**
- *  CLockAppStateControl class is the main locking state control class. 
- *  Class is derived from CLockAppObserverList observer list class. 
- *  Does not own visible user interface, but directs window server events like 
- *  key events to window-owning child controls (keyguard ui, emergency support). 
- *  All lock state changes should be handled through this class.
- *
- *  @lib    lockapp
- *  @since  5.0
- *  @author Joona Petrell
- *  @author Tamas Koteles
- */
-class CLockAppStateControl : public CLockAppObserverList, public MLockAppStateControl,
-		public MLockAppObserverInterface
-	{
-	public:
-
-		/**
-		 * Two-phased constructor.
-		 */
-		static CLockAppStateControl* NewL( );
-
-		/**
-		 * Destructor.
-		 */
-		~CLockAppStateControl( );
-
-	private:
-
-		/**
-		 * C++ default constructor.
-		 */
-		CLockAppStateControl( );
-
-		/**
-		 * Second phase constructor allowed to fail (leave).
-		 */
-		void ConstructL( );
-
-	public:
-
-		/**
-		 * Activate keyguard lock.
-		 *
-		 * @param aWithNote if "keys locked" note is shown
-		 * @return KErrAlreadyExists if already enabled
-		 *         KErrPermissionDenied if devicelock is activated
-		 *         KErrNone if succeeded
-		 */
-		TInt EnableKeyguardL( TBool aWithNote );
-
-		/**
-		 * Dectivate keyguard lock.
-		 *
-		 * @param aWithNote if "keys active" note is shown.
-		 * @return KErrAlreadyExists if already disabled
-		 *         KErrPermissionDenied if devicelock is activated
-		 *         KErrNone if succeeded
-		 */
-		TInt DisableKeyguardL( TBool aWithNote );
-
-		/**
-		 * Activate devicelock.
-		 *
-		 * @param aReason the device locking reason.
-		 * @return KErrAlreadyExists if already enabled.
-		 *         KErrNone if succeeded
-		 */
-		TInt EnableDevicelockL( TDevicelockReason aReason = EDevicelockManual );
-
-		/**
-		 * Dectivate devicelock.
-		 *
-		 * @return KErrAlreadyExists if already disabled
-		 *         KErrPermissionDenied if keyguard is activated
-		 *         KErrNone if succeeded
-		 */
-		TInt DisableDevicelockL( );
-
-		/**
-		 * Offer to enable keyguard by showing "offerkeylock" note.
-		 * @return KErrPermissionDenied if keyguard/devicelock already activated
-		 *         KErrNone if succeeded
-		 */
-		TInt OfferKeyguard( );
-
-		/**
-		 * Offer to enable keyguard by showing "offerkeylock" note.
-		 * 
-		 * @return KErrNone if succeeded
-		 *         KErrPermissionDenied if keyguard not enabled
-		 */
-		TInt ShowKeysLockedNote( );
-
-		/**
-		 * External access to lock state
-		 *
-		 * @return Current lock state
-		 */
-		TLockStatus LockStatus( ) const;
-
-		/**
-		 * External access to lock environment
-		 *
-		 * @return Current environment state mask
-		 */
-		TUint EnvironmentStatus( ) const;
-
-		/**
-		 * Only used for internal testing.
-		 * @return error code
-		 */
-		TInt ExecuteInternalTest( );
-
-	public:
-		// From MLockAppObserverInterface
-
-		/**
-		 * Handle Central Repository observer callback.
-		 */
-		void HandleCenRepNotify( TUid aCenRepUid, TUint32 aKeyId, TInt aValue );
-
-		/**
-		 * Handle Publish & Subscribe observer callback.
-		 */
-		void HandlePubSubNotify( TUid aPubSubUid, TUint aKeyId, TInt aValue );
-
-	public:
-		// from CCoeControl
-
-		TInt CountComponentControls( ) const;
-
-		CCoeControl* ComponentControl( TInt aIndex ) const;
-
-		TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
-
-		void HandleWsEventL( const TWsEvent& aEvent, CCoeControl* aDestination );
-
-		void HandleResourceChange( TInt aType );
-
-	private:
-
-		/**
-		 * Creates the second "visibility gate" window group.
-		 */
-		void CreateVisibilityGateWgL( );
-
-		/**
-		 * Logs the telephony P&S call state.
-		 */
-		void PrintCallState( TInt aValue );
-
-		/**
-		 * Update the environment variable with the event.
-		 * @return ETrue if the environment value has changed
-		 *         EFalse otherwise
-		 */
-		TBool HandleEnvironmentChange( TUint aEventMask, TBool aEnable );
-
-		/**
-		 * Check if given transition is valid.
-		 * @return KErrNone if transition is legal
-		 *         KErrAlreadyExists if LockApp already is in requested state
-		 *         KErrPermissionDenied if illegal transition
-		 */
-		TInt CheckIfLegal( TLockAppMessageReason aReason );
-
-		/**
-		 * Handle lock state change. Should only called from
-		 * method PostStatusChangeL.
-		 *
-		 * @param aLockStatus The new lock state
-		 */
-		void HandleLockStatusChangedL( TLockStatus aLockStatus );
-
-		void BringForward( TBool aForeground );
-
-		/**
-		 * Mute/Unmute key sounds when phone is locked/unlocked.
-		 * 
-		 * @param aMuteSounds mute switch
-		 */
-		void MuteSounds( TBool aMuteSounds );
-
-		/**
-		 * Prescreen key events for special cases before giving them to child controls.
-		 */
-		TKeyResponse PreCheckKeyEvents( const TKeyEvent& aKeyEvent, TEventCode aType );
-
-		/**
-		 * Power key needs to always activate lights.
-		 */
-		void CheckForPowerKeyLights( const TKeyEvent& aKeyEvent, TEventCode aType );
-
-		/**
-		 * Green and Red keys should be passed to Phone during phone call.
-		 * @return ETrue if the keys have been forwarded
-		 *         EFalse otherwise
-		 */
-		TBool CheckForPhoneKeys( const TKeyEvent& aKeyEvent, TEventCode aType );
-
-	private:
-
-		/**
-		 * Internal lock state.
-		 */
-		TLockStatus iLockStatus;
-
-		/**
-		 * Current control;
-		 */
-		CLockAppBaseControl* iCurrentControl;
-
-		/**
-		 * Idle UI.
-		 * Owned by superclass.
-		 */
-		CLockAppIdleControl* iIdle; // owned by superclass
-
-		/**
-		 * Keyguard UI.
-		 * Owned by superclass.
-		 */
-		CLockAppKeyguardControl* iKeyguard; // owned by superclass
-
-		/**
-		 * Autolock UI
-		 * Owned by superclass. 
-		 */
-		CLockAppDevicelockControl* iDevicelock;
-
-		/**
-		 * Emergency call detector with emergency note.
-		 * Owned by superclass.
-		 */
-		CLockAppEcsDetector* iLockEcsDetector;
-
-		/**
-		 * PubSub observers
-		 */
-		CLockAppPubSubObserver* iPSScreenSaverObserver;
-		CLockAppPubSubObserver* iPSTelephonyObserver;
-		CLockAppPubSubObserver* iPSGripObserver;
-		CLockAppPubSubObserver* iPSFPSObserver;
-
-		/**
-		 * Application's main window group - Event gate
-		 */
-		RWindowGroup& iWGEventGate;
-
-		/**
-		 * Visibility gate (owned)
-		 */
-		RWindowGroup iWGVisibilityGate;
-
-		/**
-		 * Incall Bubble. (owned)
-		 */
-		CAknIncallBubble* iIncallBubble;
-
-	private:
-
-		/**
-		 *  feature manager keys
-		 */
-		TBool iFeatureNoPowerkey;
-
-		/**
-		 * Offset value used to free reserved localization resources
-		 */
-		TInt iResourceFileOffset;
-
-		/**
-		 * if sounds are muted
-		 */
-		TBool iSoundsMuted;
-
-		/**
-		 * Environment state descriptor bit-mask
-		 */
-		TUint iEnvState;
-
-	};
-
-#endif // __LOCKAPPSTATECONTROL_H__
-// End of File
--- a/securitydialogs/lockapp/inc/lockappstatecontrolinterface.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +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:  Interface for controls that want to modify lock status
- *
-*/
-
-
-#ifndef __LOCKAPPSTATECONTROLINTERFACE_H__
-#define __LOCKAPPSTATECONTROLINTERFACE_H__
-
-// INCLUDES
-#include "lockapp.hrh"
-
-/**
- *  MLockAppStateControl class offers safe interface methods for lockapp controls.
- *  All internal child controls should use this interface for modifying
- *  the phone lock state.
- *
- *  @lib    lockapp
- *  @since  5.0
- *  @author Joona Petrell
- *  @author Tamas Koteles
- */
-class MLockAppStateControl
-	{
-	public:
-
-		/** 
-		 * Activate keyguard lock.
-		 *
-		 * @param aWithNote if "keys locked" note is shown
-		 * @return KErrAlreadyExists if already enabled
-		 *         KErrPermissionDenied if devicelock is activated
-		 *         KErrNone if succeeded
-		 */
-		virtual TInt EnableKeyguardL( TBool aWithNote ) = 0;
-
-		/**
-		 * Dectivate keyguard lock.
-		 *
-		 * @param aWithNote if "keys active" note is shown.
-		 * @return KErrAlreadyExists if already disabled
-		 *         KErrPermissionDenied if devicelock is activated
-		 *         KErrNone if succeeded
-		 */
-		virtual TInt DisableKeyguardL( TBool aWithNote ) = 0;
-
-		/**
-		 * Activate devicelock.
-		 * 
-		 * @param aReason the device locking reason.
-		 * @return KErrAlreadyExists if already enabled.
-		 *         KErrNone if succeeded
-		 */
-		virtual TInt EnableDevicelockL( TDevicelockReason aReason = EDevicelockManual ) = 0;
-
-		/**
-		 * Dectivate devicelock.
-		 *
-		 * @return KErrAlreadyExists if already disabled
-		 *         KErrPermissionDenied if keyguard is activated
-		 *         KErrNone if succeeded
-		 */
-		virtual TInt DisableDevicelockL( ) = 0;
-
-		/**
-		 * Offer to enable keyguard by showing "offerkeylock" note.
-		 * 
-		 * @return KErrPermissionDenied if keyguard/devicelock already activated
-		 *         KErrNone if succeeded
-		 */
-		virtual TInt OfferKeyguard( ) = 0;
-
-		/**
-		 * Offer to enable keyguard by showing "offerkeylock" note.
-		 * 
-		 * @return KErrNone if succeeded
-		 *         KErrPermissionDenied if keyguard is not enabled
-		 */
-		virtual TInt ShowKeysLockedNote( ) = 0;
-
-		/**
-		 * External access to lock state
-		 *
-		 * @return Current lock state
-		 */
-		virtual TLockStatus LockStatus( ) const = 0;
-
-		/**
-		 * External access to lock environment
-		 *
-		 * @return Current environment state
-		 */
-		virtual TUint EnvironmentStatus( ) const = 0;
-
-		/**
-		 * Used for internal testing only, disabled normally
-		 * 
-		 * @return error code
-		 */
-		virtual TInt ExecuteInternalTest( ) = 0;
-
-	};
-
-#endif // __LOCKAPPSTATECONTROLINTERFACE_H__
-// End of File
--- a/securitydialogs/lockapp/inc/lockappstateobserver.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +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:  Interface for controls that want to be informed about lock status
- *
-*/
-
-
-#ifndef __LOCKAPPSTATEOBSERVER_H__
-#define __LOCKAPPSTATEOBSERVER_H__
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-#include "lockapp.hrh"
-
-/**
- *  CLockAppStateObserver class offers a lockstate observer interface. 
- *  All observer classes derived from MLockAppStateObserver should be added to 
- *  the lockapp observer list in order to get notifications about lock state changes.
- *
- *  @lib    lockapp
- *  @since  5.0
- *  @author Joona Petrell
- *  @author Tamas Koteles
- */
-class MLockAppStateObserver
-	{
-	public:
-
-		/**
-		 * Lock status changes are handled trough HandleLockStatusChangedL method.
-		 * Must be overriden by derived class for observing.
-		 */
-		virtual void HandleLockStatusChangedL( TLockStatus aLockStatus ) = 0;
-
-	};
-
-#endif // __LOCKAPPSTATEOBSERVER_H__
-// End of File
--- a/securitydialogs/lockapp/inc/lockappstatepublisher.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +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:  Publishes LockApp states to other applications
- *
-*/
-
-
-#ifndef __LOCKAPPSTATEPUBLISHER_H__
-#define __LOCKAPPSTATEPUBLISHER_H__
-
-// INCLUDES
-#include "lockappstateobserver.h"
-#include <e32property.h>
-
-/**
- *  CLockAppStatePublisher class publishes lock state to external parties using P&S key.
- * 
- *  @lib    lockapp
- *  @since  5.0
- *  @author Joona Petrell
- *  @author Tamas Koteles
- **/
-class CLockAppStatePublisher : public CBase, public MLockAppStateObserver
-	{
-	public:
-		/**
-		 * Two-phased constructor.
-		 */
-		static CLockAppStatePublisher* NewL( );
-
-		/**
-		 * C++ default constructor.
-		 */
-		CLockAppStatePublisher( );
-
-		/**
-		 * Destructor.
-		 */
-		~CLockAppStatePublisher( );
-	private:
-
-		/**
-		 * Second constructor that can fail (leave).
-		 */
-		void ConstructL( );
-
-	public:
-		// from CLockAppStateObserver
-
-		virtual void HandleLockStatusChangedL( TLockStatus aLockStatus );
-
-	private:
-
-		// stores locking state property
-		RProperty iStatusProperty;
-
-	};
-
-#endif // __LOCKAPPSTATEPUBLISHER_H__
-// End of File
-
--- a/securitydialogs/lockapp/inc/lockapptrace.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,392 +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:  Trace macro support for lockapp
- *
-*/
-
-
-#ifndef LOCKAPPTRACE_H
-#define LOCKAPPTRACE_H
-
-#include "lockapptraceconfiguration.hrh"
-
-#ifdef TRACE_INTO_FILE
-#include <flogger.h> // RFileLogger
-#else
-#include <e32debug.h> // RDebug
-#endif
-
-//-----------------------------------------------------------------------------
-// Constants
-//-----------------------------------------------------------------------------
-//
-
-/**
-* Prefix trace macro to complete tracing with component name.
-* Returns TDesC which can be used directly with RDebug or RFileLogger.
-*/
-#define _PREFIX_TRACE( aMsg ) TPtrC( (const TText*)L"[LockApp]: " L##aMsg )
-
-/**
-* Prefix error trace
-*/
-#define _PREFIX_ERROR( aMsg ) _PREFIX_TRACE( "[ERROR: %d]: " L##aMsg )
-
-/**
-* Prefix info trace.
-*/
-#define _PREFIX_INFO( aMsg ) _PREFIX_TRACE( "[INFO]: " L##aMsg )
-
-/**
-* Prefix macro for strings
-*/
-#define _PREFIX_CHAR( aMsg ) (const char*)"[LockApp]: " ##aMsg
-
-/**
-* Define needed directories if TRACE_INTO_FILE macro in use
-*/
-#ifdef TRACE_INTO_FILE
-
-	_LIT( KDir, "lockapp" );
-	_LIT( KFile, "lockapp_log.txt" );
-	_LIT( KFullPath, "c:\\logs\\lockapp\\" );
-
-#endif
-
-//-----------------------------------------------------------------------------
-// Error trace macros
-//-----------------------------------------------------------------------------
-//
-#ifdef ERROR_TRACE
-
-	/**
-	* Error trace definitions.
-	*/
-	#ifdef TRACE_INTO_FILE
-
-		#define ERROR( aErr, aMsg )\
-			{\
-			if( aErr < KErrNone )\
-				{\
-				RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_ERROR( aMsg ), aErr );\
-				}\
-			}
-		#define ERROR_1( aErr, aMsg, aP1 )\
-			{\
-			if( aErr < KErrNone )\
-				{\
-				RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_ERROR( aMsg ), aErr, aP1 );\
-				}\
-			}
-		#define ERROR_2( aErr, aMsg, aP1, aP2 )\
-			{\
-			if( aErr < KErrNone )\
-				{\
-				RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_ERROR( aMsg ), aErr, aP1, aP2 );\
-				}\
-			}
-		#define ERROR_3( aErr, aMsg, aP1, aP2, aP3 )\
-			{\
-			if( aErr < KErrNone )\
-				{\
-				RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_ERROR( aMsg ), aErr, aP1, aP2, aP3 );\
-				}\
-			}
-
-	#else//TRACE_INTO_FILE not defined
-
-		#define ERROR( aErr, aMsg )\
-			{\
-			if( aErr < KErrNone )\
-				{\
-				RDebug::Print( _PREFIX_ERROR( aMsg ), aErr );\
-				}\
-			}
-		#define ERROR_1( aErr, aMsg, aP1 )\
-			{\
-			if( aErr < KErrNone )\
-				{\
-				RDebug::Print( _PREFIX_ERROR( aMsg ), aErr, aP1 );\
-				}\
-			}
-		#define ERROR_2( aErr, aMsg, aP1, aP2 )\
-			{\
-			if( aErr < KErrNone )\
-				{\
-				RDebug::Print( _PREFIX_ERROR( aMsg ), aErr, aP1, aP2 );\
-				}\
-			}
-		#define ERROR_3( aErr, aMsg, aP1, aP2, aP3 )\
-			{\
-			if( aErr < KErrNone )\
-				{\
-				RDebug::Print( _PREFIX_ERROR( aMsg ), aErr, aP1, aP2, aP3 );\
-				}\
-			}
-
-	#endif//TRACE_INTO_FILE
-
-	#define ERROR_GEN( aMsg ) ERROR( KErrGeneral, aMsg )
-	#define ERROR_GEN_1( aMsg, aP1 ) ERROR_1( KErrGeneral, aMsg, aP1 )
-	#define ERROR_GEN_2( aMsg, aP1, aP2 ) ERROR_2( KErrGeneral, aMsg, aP1, aP2 )
-	#define ERROR_GEN_3( aMsg, aP1, aP2, aP3 ) ERROR_3( KErrGeneral, aMsg, aP1, aP3 )
-
-#else//ERROR_TRACE not defined
-
-	#define ERROR( aErr, aMsg )
-	#define ERROR_1( aErr, aMsg, aP1 )
-	#define ERROR_2( aErr, aMsg, aP1, aP2 )
-	#define ERROR_3( aErr, aMsg, aP1, aP2, aP3 )
-	#define ERROR_GEN( aMsg )
-	#define ERROR_GEN_1( aMsg, aP1 )
-	#define ERROR_GEN_2( aMsg, aP1, aP2 )
-	#define ERROR_GEN_3( aMsg, aP1, aP2, aP3 )
-
-#endif//ERROR_TRACE
-
-//-----------------------------------------------------------------------------
-// Info trace macros
-//-----------------------------------------------------------------------------
-//
-#ifdef INFO_TRACE
-
-	/**
-	* Info log message definitions.
-	*/
-	#ifdef TRACE_INTO_FILE
-
-		#define INFO( aMsg )\
-			{\
-			RDebug::Print( _PREFIX_INFO( aMsg ) );\
-			RFileLogger::Write( KDir, KFile, EFileLoggingModeAppend, _PREFIX_INFO( aMsg ) );\
-			}
-		#define INFO_1( aMsg, aP1 )\
-			{\
-			RDebug::Print( _PREFIX_INFO( aMsg ), aP1 );\
-			RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_INFO( aMsg ), aP1 );\
-			}
-		#define INFO_2( aMsg, aP1, aP2 )\
-			{\
-			RDebug::Print( _PREFIX_INFO( aMsg ), aP1, aP2 );\
-			RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_INFO( aMsg ), aP1, aP2 );\
-			}
-		#define INFO_3( aMsg, aP1, aP2, aP3 )\
-			{\
-			RDebug::Print( _PREFIX_INFO( aMsg ), aP1, aP2, aP3 );\
-			RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_INFO( aMsg ), aP1, aP2, aP3 );\
-			}
-		#define INFO_4( aMsg, aP1, aP2, aP3, aP4 )\
-			{\
-			RDebug::Print( _PREFIX_INFO( aMsg ), aP1, aP2, aP3, aP4 );\
-			RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_INFO( aMsg ), aP1, aP2, aP3, aP4 );\
-			}
-
-	#else//TRACE_INTO_FILE not defined
-
-		#define INFO( aMsg )\
-			{\
-			RDebug::Print( _PREFIX_INFO( aMsg ) );\
-			}
-		#define INFO_1( aMsg, aP1 )\
-			{\
-			RDebug::Print( _PREFIX_INFO( aMsg ), aP1 );\
-			}
-		#define INFO_2( aMsg, aP1, aP2 )\
-			{\
-			RDebug::Print( _PREFIX_INFO( aMsg ), aP1, aP2 );\
-			}
-		#define INFO_3( aMsg, aP1, aP2, aP3 )\
-			{\
-			RDebug::Print( _PREFIX_INFO( aMsg ), aP1, aP2, aP3 );\
-			}
-		#define INFO_4( aMsg, aP1, aP2, aP3, aP4 )\
-			{\
-			RDebug::Print( _PREFIX_INFO( aMsg ), aP1, aP2, aP3, aP4 );\
-			}
-
-	#endif//TRACE_INTO_FILE
-
-#else//INFO_TRACE not defined
-
-	#define INFO( aMsg )
-	#define INFO_1( aMsg, aP1 )
-	#define INFO_2( aMsg, aP1, aP2 )
-	#define INFO_3( aMsg, aP1, aP2, aP3 )
-	#define INFO_4( aMsg, aP1, aP2, aP3, aP4 )
-
-#endif//INFO_TRACE
-
-//-----------------------------------------------------------------------------
-// Trace current client thread name and process id
-//-----------------------------------------------------------------------------
-//
-#ifdef CLIENT_TRACE
-
-	#define CLIENT( aMessage )\
-		{\
-		RThread thread;\
-		TInt err = aMessage.Client( thread );\
-		if( err == KErrNone )\
-			{\
-			RProcess process;\
-			err = thread.Process( process );\
-			if( err == KErrNone )\
-				{\
-				TPtrC thredName( thread.Name() );\
-				TUid processUid( process.SecureId() );\
-				INFO_2( "Current client process UID: [%x], thread name: [%S]",\
-					processUid,\
-					&thredName );\
-				}\
-			process.Close();\
-			}\
-		thread.Close();\
-		}
-
-#else
-
-	#define CLIENT( aMessage )
-
-#endif
-
-//-----------------------------------------------------------------------------
-// Function trace macros
-//-----------------------------------------------------------------------------
-//
-#ifdef FUNC_TRACE
-
-	/**
-	* Function logging definitions.
-	*/
-	#ifdef TRACE_INTO_FILE
-
-		#define FUNC( aMsg, aP1 )\
-			{\
-			TPtrC8 trace( _S8( aMsg ) );\
-			RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, trace, aP1 );\
-			}\
-
-	#else//TRACE_INTO_FILE not defined
-
-		#define FUNC( aMsg, aP1 )\
-			{\
-			RDebug::Printf( aMsg, aP1 );\
-			}\
-
-	#endif//TRACE_INTO_FILE
-
-	/**
-	* Function trace helper class.
-	*
-	* NOTE:
-	* LC -methods cannot be trapped. Therefore if LC -method leaves
-	* END trace is used instead of LEAVE trace.
-	* If you have an idea how to round this problem please tell.
-	*/
-	_LIT8( KFuncNameTerminator, "(" );
-	_LIT8( KFuncLeavePatternL, "L" );
-	class TFuncLog
-		{
-		public:
-			static void Cleanup( TAny* aPtr )
-				{
-				TFuncLog* self = static_cast< TFuncLog* >( aPtr );
-				self->iLeft = ETrue;
-				FUNC( _PREFIX_CHAR("%S-LEAVE"), &self->iFunc ); // Leave detected
-				}
-			inline TFuncLog( const char* aFunc ) :
-					iFunc( aFunc ? _S8( aFunc ) : _S8("") ),
-					iLeft( EFalse ),
-					iCleanupItem( Cleanup, this ),
-					iCanLeave( EFalse )
-				{
-				TInt pos( iFunc.Find( KFuncNameTerminator ) );
-				if( pos != KErrNotFound )
-					{
-					iFunc.Set( iFunc.Left( pos ) );
-					iCanLeave = !iFunc.Right( KFuncLeavePatternL().Length() ).Compare( KFuncLeavePatternL );
-					if ( iCanLeave )
-						{
-						CleanupStack::PushL( iCleanupItem ); // Ignore warnings
-						}
-					}
-				FUNC( _PREFIX_CHAR("%S-START"), &iFunc );
-				}
-
-			inline ~TFuncLog()
-				{
-				if ( !iLeft )
-					{
-					if ( iCanLeave )
-						{
-						CleanupStack::Pop( this ); // Pop the cleanup item
-						}
-					FUNC( _PREFIX_CHAR("%S-END"), &iFunc ); // Normally finished
-					}
-				}
-
-		private: // Data
-			TPtrC8 iFunc;
-			TBool iLeft;
-			TCleanupItem iCleanupItem;
-			TBool iCanLeave;
-		};
-	#define FUNC_LOG TFuncLog _fl( __PRETTY_FUNCTION__ );
-
-#else//FUNC_TRACE not defined
-
-	#define FUNC_LOG
-
-#endif//FUNC_TRACE
-
-//-----------------------------------------------------------------------------
-// Timestamp trace macros
-//-----------------------------------------------------------------------------
-//
-#ifdef TIMESTAMP_TRACE
-
-	#ifdef TRACE_INTO_FILE
-
-		#define TIMESTAMP( aCaption )\
-			{\
-			TTime t;\
-			t.HomeTime();\
-			TDateTime dt = t.DateTime();\
-			_LIT( KCaption, aCaption );\
-			RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend,\
-				_PREFIX_TRACE("[TIMESTAMP] %S %d:%02d:%02d.%d us"),\
-					&KCaption, dt.Hour(), dt.Minute(), dt.Second(), dt.MicroSecond() );\
-			}
-
-	#else//TRACE_INTO_FILE not defined
-
-		#define TIMESTAMP( aCaption )\
-			{\
-			TTime t;\
-			t.HomeTime();\
-			TDateTime dt = t.DateTime();\
-			_LIT( KCaption, aCaption );\
-			RDebug::Print( _PREFIX_TRACE("[TIMESTAMP] %S %d:%02d:%02d.%d us"),\
-				&KCaption, dt.Hour(), dt.Minute(), dt.Second(), dt.MicroSecond() );\
-			}
-
-	#endif//TRACE_INTO_FILE
-
-#else//TIMESTAMP_TRACE not defined
-
-	#define TIMESTAMP( aCaption )
-
-#endif//TIMESTAMP_TRACE
-
-#endif
--- a/securitydialogs/lockapp/inc/lockapptraceconfiguration.hrh	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +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:  Trace definitions for lockapp 
- *
-*/
-
-
-
-#ifndef LOCKAPPTRACECONFIGURATION_HRH
-#define LOCKAPPTRACECONFIGURATION_HRH
-
-//-----------------------------------------------------------------------------
-// Trace definitions
-//-----------------------------------------------------------------------------
-
-/**
-* Error trace enabled
-*/
-#ifdef _DEBUG
-    #define ERROR_TRACE
-#else
-    #undef ERROR_TRACE
-#endif
-
-/**
-* Info trace enabled
-*/
-#ifdef _DEBUG
-    #define INFO_TRACE
-#else
-    #undef INFO_TRACE
-#endif
-
-/**
-* Function trace enabled
-*/
-#ifdef _DEBUG
-    #define FUNC_TRACE
-#else
-    #undef FUNC_TRACE
-#endif
-
-/**
-* Timestamp tracing on
-*/
-#ifdef _DEBUG
-    #define TIMESTAMP_TRACE
-#else
-    #undef TIMESTAMP_TRACE
-#endif
-
-/**
-* Tracing current client process and thread
-*/
-#ifdef _DEBUG
-    #define CLIENT_TRACE
-#else
-    #undef CLIENT_TRACE
-#endif
-
-/**
-* Tracing into file enabled, default RDebug
-*/
-//#undef TRACE_INTO_FILE
-#define TRACE_INTO_FILE
-
-#endif
\ No newline at end of file
--- a/securitydialogs/lockapp/inc/lockapputils.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +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:  Internally used panic functions and test macros
- *
-*/
-
-
-#ifndef __LOCKAPPUTILS_H__
-#define __LOCKAPPUTILS_H__
-
-// INCLUDES
-#include "lockapp.hrh"
-#include "lockapptrace.h"
-#include <w32std.h>
-
-/**
- * Queries bits in aStatusMask specified by the aQueryMask
- */
-TBool IsBitFieldSet( TUint aStatusMask, TUint aQueryMask );
-
-/**
- * Sets bits in aResultMask specified by the aSetMask
- */
-void SetBitField( TUint &aResultMask, TUint aSetMask, TBool aSet );
-
-/**
- * Panic the LockApp (should only be used in debug)
- *
- * @param aPanic Identifies the reason to Panic
- */
-void DoPanic( TLockAppPanic aPanic );
-
-/**
- * Panic LockAppServer client for sending
- * illegal message
- *
- * @param aMessage Event id
- * @param aPanic Identifies the reason to Panic
- */
-void PanicClient( const RMessagePtr2& aMessage, TLockAppPanic aPanic );
-
-/**
- * Sends application spesific events to Sysap.
- * Used mainly for lights control.
- *
- * @param aMessage Event id
- */
-void SendMessageToSysAp(TInt aMessage);
-
-/**
- * Sends a key event to the windowgroup in background.
- * Used mainly for sending red and green keys to phone app when
- * devicelock or keyguard is in foreground.
- *
- * @param aKey key event
- * @param aType key event type
- */
-void SendKeyToPhoneApp(const TKeyEvent& aKey, TEventCode aType);
-
-#endif // __LOCKAPPTILS_H__
-
--- a/securitydialogs/lockapp/inc/lockappwait.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,130 +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:  Async-Sync utility class
- *
-*/
-
-
-#ifndef __LOCKAPPWAIT_H
-#define __LOCKAPPWAIT_H
-
-//  INCLUDES
-
-#include <e32base.h>
-#include <eikappui.h>
-#include <coecntrl.h>
-
-//  CLASS DEFINITIONS
-class CWait : public CActive
-	{
-public:
-	/**
-	 * Creates instance of the CWait class.
-	 *
-	 * @return Returns the instance just created.
-	 */
-	static CWait* NewL( );
-
-	/**
-	 * Destructor.
-	 */
-	~CWait( );
-
-	/**
-	 * Starts waiting for aReqStatus.
-	 */
-	TInt WaitForRequestL( );
-
-	/**
-	 * Sets active request type.
-	 */
-	void SetRequestType(TInt aRequestType );
-	
-	/**
-	 * Gets active request type.
-	 */
-	TInt GetRequestType( );
-
-private:
-	
-	/**
-	 * C++ default constructor.
-	 */
-	CWait( );
-	
-	/**
-	 * Symbian OS constructor.
-	 */
-	void ConstructL( );
-
-private: // from CActive
-
-	/** @see CActive::RunL() */
-	void RunL( );
-
-	/** @see CActive::DoCancel() */
-	void DoCancel( );
-
-private: // data
-
-	RTimer iTimer;
-
-	CActiveSchedulerWait iWait;
-
-	// Used if there is a need to cancel an active request;
-	// namely in situations where destructor is called when Wait
-	// is active.
-	TInt iRequestType;
-	};
-
-// ----------------------------------------------------------
-// CWaitAbsorbingControl
-// absorbs all the key presses.
-// ----------------------------------------------------------
-//
-class CWaitAbsorbingControl : public CCoeControl
-	{
-public:
-
-	/**
-	 * Creates instance of the CWaitAbsorbingControl class.
-	 *
-	 * @return Returns the instance just created.
-	 */
-	static CWaitAbsorbingControl* NewLC( );
-
-	/**
-	 * Destructor.
-	 */
-	virtual ~CWaitAbsorbingControl( );
-
-private:
-
-	virtual TKeyResponse OfferKeyEventL(const TKeyEvent& /*aKeyEvent*/, TEventCode /*aType*/);
-
-private:
-
-	CWaitAbsorbingControl( );
-
-	void ConstructL( );
-
-private: // data
-
-	CEikAppUi* iAppUi;
-
-	};
-
-#endif
-
-// End of file
--- a/securitydialogs/lockapp/loc/lockapp.loc	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +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:  Localisation strings for LockApp
- *
-*/
-
-
-// LOCALISATION STRINGS
-
-//d:Title pane text in System Lock View.(Phone is in locked mode)
-//l:title_pane_t2/opt9 
-//
-#define qtn_set_sec_title_locked "Locked"
-
-// End of File
--- a/securitydialogs/lockapp/pubsub/SecurityUIsPrivatePSKeys.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +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:  Private Publish&Subscribe definitions of the
- *                Security UIs subsystem
- *
-*/
-
-
-#ifndef SECURITYUISPRIVATEPSKEYS_H
-#define SECURITYUISPRIVATEPSKEYS_H
-
-// INCLUDES
-
-//CONSTANTS
-
-const TUid KPSUidSecurityUIs = { 0x100059b5 };
-// =============================================================================
-// Security Code UI Originator API
-// =============================================================================
-
-// Use TUid KPSUidSecurityUIs = { 0x100059b5 } 
-
-/**
- * Used by SecUI to differentiate between ETel API originated and SecUI originated
- * security queries.
- * Old Shared Data constant name: KSecUIOriginatedQuery
- */
-const TUint32 KSecurityUIsSecUIOriginatedQuery = 0x00000301;
-enum TSecurityUIsSecUIOriginatedQuery
-    {
-    ESecurityUIsSecUIOriginatedUninitialized = 0,
-    ESecurityUIsETelAPIOriginated,
-    ESecurityUIsSecUIOriginated,
-    ESecurityUIsSystemLockOriginated,
-    ESecurityUIsFpsOriginated
-    };
-
-/**
- * Used by SecUI to tell if a query request set by some ETELMM API lock setting function (i.e. SetXXXXSetting)
- * has been canceled sinnce canceling the setting request does not prompt a query cancel event from ETEL.
- * Old Shared Data constant name: KSecUIOriginatedQuery
- */    
-const TUint32 KSecurityUIsQueryRequestCancel = 0x00000302;
-enum TSecurityUIsQueryRequestCancel
-    {
-    ESecurityUIsQueryRequestUninitialized = 0,
-    ESecurityUIsQueryRequestOk,
-    ESecurityUIsQueryRequestCanceled
-    };
-
-#endif // SECURITYUISPRIVATEPSKEYS_H
-
-// End of File
-
--- a/securitydialogs/lockapp/rom/lockapp.iby	Thu Aug 19 10:45:23 2010 +0300
+++ b/securitydialogs/lockapp/rom/lockapp.iby	Tue Aug 31 16:04:40 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2009 Nokia Corporation and/or 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,20 +11,12 @@
 *
 * Contributors:
 *
-* Description:  LockApp files needed to image
- *
+* Description: Implementation of lockapp
+*
 */
-
-
 #ifndef __LOCKAPP_IBY__
 #define __LOCKAPP_IBY__
 
-#include <data_caging_paths_for_iby.hrh>
-
-S60_APP_EXE(lockapp)
-S60_APP_AIF_RSC(lockapp)
+S60_APP_EXE(LockApp)
 
-// To enable updating
-data=ZSYSTEM\install\lockapp_stub.sis system\install\lockapp_stub.sis
-
-#endif // __LOCKAPP_IBY__
+#endif
--- a/securitydialogs/lockapp/rom/lockappresources.iby	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +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:  LockApp resources needed to image
- *
-*/
-
-
-#ifndef __LOCKAPPRESOURCES_IBY__
-#define __LOCKAPPRESOURCES_IBY__
-
-#include <data_caging_paths_for_iby.hrh>
-  
-S60_APP_RESOURCE(lockapp)
-
-#endif // __LOCKAPPRESOURCES_IBY__
--- a/securitydialogs/lockapp/sis/lockapp.pkg	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +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: ;Language - standard language definitions
-;
-;Language - standard language definitions
-;Language - standard language definitions
-&EN
-
-; standard SIS file header
-#{"LockApp"}, (0x10283322), 1, 0, 0, TYPE=SA
-
-;Localised Vendor name
-%{"Nokia"}
-
-;Unique Vendor name
-:"Nokia"
-
-;Supports Series 60 v 3.0
-[0x101F7961], 0, 0, 0, {"Series60ProductID"}
-
-;Files to install
-"\Epoc32\release\armv5\udeb\lockapp.exe"-"z:\sys\bin\lockapp.exe"
-"\Epoc32\data\z\resource\apps\lockapp.rsc"-"z:\resource\apps\lockapp.rsc"
-"\Epoc32\data\z\private\10003a3f\apps\lockapp_reg.rsc"-"z:\private\10003a3f\import\apps\lockapp_reg.rsc"
-"\Epoc32\data\z\resource\apps\lockapp.mif"-"z:\resource\apps\lockapp.mif"
Binary file securitydialogs/lockapp/sis/lockapp_stub.sis has changed
--- a/securitydialogs/lockapp/sis/make_stubsis.bat	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +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
-
-makesis -s lockapp.pkg lockapp_stub.sis
--- a/securitydialogs/lockapp/sis/rd-key.pem	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIICXAIBAAKBgQDLRF+r1FGGkCwTrb420kbnAps7gi1yYUcXYUdWeFTuBeQe5eW4
-6Y+LWaA8HMlDdoHRB0FgASisYcFagwno9+oFf4AJka4H1gWEs5XTGwAA1s0d8XGh
-7W7Dt9F5FZij8F7/9Pi6+FhhxZFIf1DD+yry9D7+Sp+BgdNALe4XOpf25QIBAwKB
-gQCHgupyjYuvCsgNHn7PNtnvVxInrB5MQNoPli+O+uNJWUK/Q+57Rl+yO8AoEzDX
-pFaLWiuVVhsdloDnAgabT/FXzYncs6uOHyEUV+dSXb78vtLPJqAX+Fg2i3hOXreB
-yskcZ13/OsKVOu5wgrJkx2baZufkqMwOSytf5y9nwjEIKwJBAP+inobagVNrN62j
-KQva3cC+UN/6XnKdTc0CA6bHyLOaJoH1xiMwG/VS2PGjHI0tiSMNtLn/QPpHJ003
-iabGhdUCQQDLjp/9UjFT6K6CF66Chqf30pZXhx+GTSQZmv/gvZiMly7X9fX9BGX3
-2MbJohBC4yI21XKTbisWywkF73Hwh+TRAkEAqmxprzxWN5zPyRdwspHpKymLP/w+
-9xOJM1atGdqFzRFvAU6EF3Vn+OHl9my9s3OwwgkjJqorUYTE3iUGby8D4wJBAIe0
-aqjhdjfwdFa6dFcEb/qMZDpaFQQzbWZnVUB+ZbMPdI/5TqitmU/l2dvBYCyXbCSO
-TGJJcg8yBgP09qBamIsCQFL7j1tM0XPVQJQ89WpKCld7O9ORxRGVj1eG0tWijrH8
-mGbYh8SGCVoWV3vrKSS8GBrFVgQnqUaHuEdtM7tpCAQ=
------END RSA PRIVATE KEY-----
--- a/securitydialogs/lockapp/sis/rd.cer	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
------BEGIN CERTIFICATE-----
-MIICzDCCAjWgAwIBAgIBADANBgkqhkiG9w0BAQUFADArMRAwDgYDVQQKEwdSRCBD
-ZXJ0MRcwFQYDVQQDEw5SRCBDZXJ0aWZpY2F0ZTAeFw0wNDExMTUxMjQyMDZaFw0z
-NzA5MjMxMjQyMDZaMCsxEDAOBgNVBAoTB1JEIENlcnQxFzAVBgNVBAMTDlJEIENl
-cnRpZmljYXRlMIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQDLRF+r1FGGkCwT
-rb420kbnAps7gi1yYUcXYUdWeFTuBeQe5eW46Y+LWaA8HMlDdoHRB0FgASisYcFa
-gwno9+oFf4AJka4H1gWEs5XTGwAA1s0d8XGh7W7Dt9F5FZij8F7/9Pi6+FhhxZFI
-f1DD+yry9D7+Sp+BgdNALe4XOpf25QIBA6OCAQAwgf0wDAYDVR0TBAUwAwEB/zAL
-BgNVHQ8EBAMCAoQwHQYDVR0OBBYEFFi/kuGzxhVpjGxe9ZwlxC3fH9jFMFMGA1Ud
-IwRMMEqAFFi/kuGzxhVpjGxe9ZwlxC3fH9jFoS+kLTArMRAwDgYDVQQKEwdSRCBD
-ZXJ0MRcwFQYDVQQDEw5SRCBDZXJ0aWZpY2F0ZYIBADBsBgNVHSAEZTBjMGEGBFUd
-IAAwWTATBggrBgEFBQcCARYHaHR0cDovLzBCBggrBgEFBQcCAjA2GjRGb3IgUiZE
-IHVzYWdlIG9ubHkuIFRoaXMgY2VydGlmaWNhdGUgaXMgbm90IHRydXN0ZWQuMA0G
-CSqGSIb3DQEBBQUAA4GBAHGB4RQMAgBdeT2hxfOr6f2nA/dZm+M5yX5daUtZnET9
-Ed0A9sazLawfN2G1KFQT9kxEParAyoAkpbMAsRrnRz/9cM3OHgFm/NiKRnf50DpT
-7oCx0I/65mVD2kt+xXE62/Ii5KPnTufIkPi2uLvURCia1tTS8JmJ8dtxDGyQt8BR
------END CERTIFICATE-----
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/lockapp/src/lockapp.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies). 
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: Very small version of lockapp, which simply launches Autolock
+ * This is needed becauses starter has the hardcoded name "lockapp"
+ *
+ */
+
+// INCLUDES
+
+#include <e32svr.h>
+#include <centralrepository.h>
+
+#include <aknglobalpopupprioritycontroller.h>
+#include <apgcli.h>
+#include <apgtask.h>
+#include <eikenv.h>
+#include <e32property.h>
+#include <secuisecuritysettings.h>
+#include <coreapplicationuisdomainpskeys.h>
+
+// ----------------------------------------------------------------------------------------
+// Server startup code
+// ----------------------------------------------------------------------------------------
+static void RunServerL()
+    {
+    CActiveScheduler* s = new (ELeave) CActiveScheduler;
+    CleanupStack::PushL(s);
+    CActiveScheduler::Install(s);
+
+    // start autolock instead of lockapp . This is a backup solution to use in case that not all SysAp and Avkon changes are implemented
+    /* No need to check the task. A process should not run twice
+     TApaTaskList taskList( CCoeEnv::Static()->WsSession() );	// can also use CCoeEnv::Static()	CEikonEnv::Static()
+     const TUid KAutolockSrvAppUid = { 0x100059B5 };
+     TApaTask task( taskList.FindApp( KAutolockSrvAppUid ) );
+     if( !task.Exists())
+     */
+
+    RApaLsSession ls;
+    User::LeaveIfError(ls.Connect());
+    CleanupClosePushL(ls);
+
+		/************/
+    _LIT_SECURITY_POLICY_C1(KWritePolicy, ECapabilityWriteDeviceData);
+    TInt ret = RProperty::Define(KPSUidCoreApplicationUIs,
+            KCoreAppUIsAutolockStatus, RProperty::EInt, TSecurityPolicy(TSecurityPolicy::EAlwaysPass),
+            TSecurityPolicy(TSecurityPolicy::EAlwaysPass));
+
+    TInt autolockState;
+    RProperty::Get(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, autolockState);
+    if(autolockState==EAutolockStatusUninitialized)
+    	{
+    	autolockState = EAutolockOff;	// not-initialized means that the unlock-query hasn't been displayed. Therefore the device should not stay locked.
+    	}
+    ret = RProperty::Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus,	
+                   autolockState);	// this might re-set it. That's not bad. It will re-notify all listeners.
+    RProperty::Get(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, autolockState);
+    RDebug::Printf("%s %s (%u) autolockState=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, autolockState);
+		/************/
+
+    CApaCommandLine* commandLine = CApaCommandLine::NewLC();
+    commandLine->SetExecutableNameL(_L("autolock.exe"));
+    commandLine->SetCommandL(EApaCommandRun);
+    // Try to launch the application.        
+    TInt err = ls.StartApp(*commandLine); // this migh fail
+    RDebug::Printf("%s %s (%u) Start: autolock.exe err=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, err);
+
+    CleanupStack::PopAndDestroy(2); // commandLine, ls
+
+    // Initialisation complete, now signal the client
+    RProcess::Rendezvous( KErrNone);
+
+    // Ready to run
+    CActiveScheduler::Start();
+
+    // Cleanup the server and scheduler
+    CleanupStack::PopAndDestroy(2);
+    }
+
+// Server process entry-point
+TInt E32Main()
+    {
+    CTrapCleanup* cleanup = CTrapCleanup::New();
+    TInt r = KErrNoMemory;
+    if (cleanup)
+        {
+        TRAP(r, RunServerL());
+        delete cleanup;
+        }
+    RDebug::Printf("%s %s (%u) r=%x", __FILE__, __PRETTY_FUNCTION__,
+            __LINE__, r);
+    return r;
+    }
+
+// End of file
--- a/securitydialogs/lockapp/src/lockappapplication.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +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:  Application class that also creates the appserver
- *
-*/
-
-
-#include <eikstart.h>
-#include <eikenv.h>
-#include "lockappdocument.h"
-#include "lockappserver.h"
-#include "lockappapplication.h"
-
-// UID for the application, this should correspond to the uid defined in the mmp file
-static const TUid KUidLockAppApp =
-    {
-    0x10283322
-    };
-
-// ---------------------------------------------------------------------------
-// Create an application, and return a pointer to it
-// ---------------------------------------------------------------------------
-CApaApplication* NewApplication( )
-    {
-    return new CLockAppApplication;
-    }
-
-// ---------------------------------------------------------------------------
-// Main function of the application executable.
-// ---------------------------------------------------------------------------
-TInt E32Main( )
-    {
-    return EikStart::RunApplication( NewApplication );
-    }
-
-// ---------------------------------------------------------------------------
-// Returns the UID for the application
-// ---------------------------------------------------------------------------
-TUid CLockAppApplication::AppDllUid( ) const
-    {
-    // Return the UID for the LockApp application
-    return KUidLockAppApp;
-    }
-
-// ---------------------------------------------------------------------------
-// Creates a document object and passes ownership.
-// ---------------------------------------------------------------------------
-CApaDocument* CLockAppApplication::CreateDocumentL( )
-    {
-    // Create an LockApp document, and return a pointer to it
-    CApaDocument* document = CLockAppDocument::NewL( *this );
-    return document;
-    }
--- a/securitydialogs/lockapp/src/lockappappui.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,229 +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:  LockApp Application UI class
-*
-*/
-
-
-#include "lockappappui.h"
-#include "lockappstatecontrol.h"
-#include "lockappserver.h"
-#include "lockapptrace.h"
-#include <lockappclientserver.h>
-#include <aknglobalpopupprioritycontroller.h>
-#include <apgcli.h>
-
-#ifdef __SAP_TERMINAL_CONTROL_FW
-#include <SCPClient.h>
-#endif // __SAP_TERMINAL_CONTROL_FW
-
-// ---------------------------------------------------------------------------
-// Second phase constructor
-// ---------------------------------------------------------------------------
-void CLockAppAppUi::ConstructL( )
-    {
-    	#if defined(_DEBUG)
-    	INFO_4( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0x8 );
-    	#endif
-    	    
-   // default appui constructor has to be called
-    BaseConstructL( );    	    
-    	    
-    TInt use_old_autolock=1;
-    if(use_old_autolock)
-    	{
-			// start autolock instead of lockapp . This is a backup solution to use in case that not all SysAp and Avkon changes are implemented
-			#if defined(_DEBUG)
-	 	  INFO_4( "%s %s (%u) 1=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0x1 );
- 	  	#endif
-	    TApaTaskList taskList( iCoeEnv->WsSession() );
-	    TApaTask task( taskList.FindApp( _L("autolock.exe" )) );
-	    if ( !task.Exists() )
-	        {
-	        RApaLsSession ls;                   
-	        User::LeaveIfError(ls.Connect());   
-	        CleanupClosePushL(ls);         
-	        
-	        CApaCommandLine* commandLine = CApaCommandLine::NewLC();
-	        commandLine->SetExecutableNameL( _L("autolock.exe" ) );     
-	        commandLine->SetCommandL( EApaCommandRun );
-	        
-		    // Try to launch the application.        
-	        User::LeaveIfError(ls.StartApp(*commandLine));
-	        #if defined(_DEBUG)
-	    	  INFO_4( "%s %s (%u) autolock.exe created=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0x7 );
-	    	  #endif
-	        
-	        CleanupStack::PopAndDestroy(2); // commandLine, ls
-			}
-	    Exit();
-	  }
-
-    #if defined(_DEBUG)
-    INFO( "CLockAppAppUi::ConstructL started" );
-    #endif
-
-    // start the server with the specified name
-	iLockServer = CLockAppServer::NewL( KLockAppServerName );
-	
-    // status pane is should not be visible
-    StatusPane()->MakeVisible( EFalse );
-
-    // we need high priority even if lockapp is not in the foreground
-    iEikonEnv->WsSession().ComputeMode( RWsSession::EPriorityControlDisabled );
-    RThread().SetProcessPriority( EPriorityHigh );
-
-    /*
-     * LockApp is set as system application (Symbian terminology).
-     * This means it does not get closed when system is asked to close applications.
-     */
-    iEikonEnv->SetSystem( ETrue );
-
-#ifdef _GLOBAL_PRIORITY_SUPPORTED
-    // Enable global popup notes
-    AknGlobalPopupPriorityController::EnablePriorityControlL();
-    AknGlobalPopupPriorityController::AllowGlobalPopups( ETrue );
-#endif
-
-    // main control storing and controling phone keylock/devicelock status
-    iStateControl = CLockAppStateControl::NewL( );
-
-    // the main control is given high stack priority
-    // ECoeStackPriorityEnvironmentFilter-1 used to allow hw keys for keyfiler even if keypad is locked.
-    AddToStackL( iStateControl, ECoeStackPriorityEnvironmentFilter-1, ECoeStackFlagStandard );
-    #if defined(_DEBUG)
-    INFO( "CLockAppAppUi::ConstructL finished" );
-    #endif
-    }
-
-// ---------------------------------------------------------------------------
-// Default Constructor
-// ---------------------------------------------------------------------------
-CLockAppAppUi::CLockAppAppUi( )
-    {
-    // no implementation required
-    }
-
-// ---------------------------------------------------------------------------
-// Destructor
-// ---------------------------------------------------------------------------
-CLockAppAppUi::~CLockAppAppUi( )
-    {
-	if ( iLockServer )
-		{
-		delete iLockServer;
-		iLockServer = NULL;
-		}
-    if ( iStateControl )
-        {
-        // remove main control from stack
-        RemoveFromStack( iStateControl );
-        delete iStateControl;
-        iStateControl = NULL;
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Returns interface to LockAppServer sessions for changing lock states
-// ---------------------------------------------------------------------------
-MLockAppStateControl* CLockAppAppUi::StateControl( )
-    {
-    return iStateControl;
-    }
-
-#ifdef __SAP_TERMINAL_CONTROL_FW
-// ---------------------------------------------------------------
-// Handles the TARM command to unlock the phone from WindowServer.
-// ---------------------------------------------------------------
-MCoeMessageObserver::TMessageResponse CLockAppAppUi::HandleMessageL(
-        TUint32 aClientHandleOfTargetWindowGroup,
-        TUid aMessageUid,
-        const TDesC8& aMessageParameters )
-    {
-    MCoeMessageObserver::TMessageResponse messageResponse( EMessageHandled);
-    if ( aMessageUid.iUid == SCP_CMDUID_UNLOCK)
-        {
-        // For security reasons we must check from the SCP server
-        // did this command originate from it.
-        RSCPClient scpClient;
-        if ( scpClient.Connect() == KErrNone )
-            {
-            CleanupClosePushL( scpClient );
-            if ( scpClient.QueryAdminCmd( ESCPCommandUnlockPhone ) )
-                {
-                #if defined(_DEBUG)    
-                INFO( "CLockAppAppUi::HandleMessageL(): Admin command received, unlocking" );
-                #endif
-                iStateControl->DisableDevicelockL();
-                }
-            else
-                {
-                #if defined(_DEBUG)    
-                INFO( "CLockAppAppUi::HandleMessageL(): Unauthorized attempt to unlock" );
-                #endif
-                }
-            CleanupStack::PopAndDestroy(); // calls Close() on scpClient
-            }
-        else
-            {
-            #if defined(_DEBUG)    
-            INFO( "CLockAppAppUi::HandleMessageL(): Failed to connect to SCP, ignoring unlock-message." );
-            #endif
-            }
-        }
-    else // aMessageUid.iUid != SCP_CMDUID_UNLOCK
-        {
-        messageResponse = CAknAppUi::HandleMessageL(
-                aClientHandleOfTargetWindowGroup,
-                aMessageUid,
-                aMessageParameters);
-        }
-    return messageResponse;
-    }
-#endif // __SAP_TERMINAL_CONTROL_FW
-
-// ----------------------------------------------------------
-// Handle window-server events
-// ----------------------------------------------------------
-void CLockAppAppUi::HandleWsEventL( const TWsEvent& aEvent, CCoeControl* aDestination )
-    {
-    #if defined(_DEBUG)
-		INFO_4( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-		#endif
-    if ( aEvent.Type() == TRawEvent::EKeyDown )
-        {
-        #if defined(_DEBUG)
-        INFO_1("CLockAppAppUi::HandleWsEventL() - aEvent.Key()->iCode: %d", aEvent.Key()->iCode );
-        #endif
-        }
-
-    // call super-class
-    CAknAppUi::HandleWsEventL( aEvent, aDestination );
-    // propagate call
-    iStateControl->HandleWsEventL( aEvent, aDestination);
-    }
-
-// ---------------------------------------------------------------------------
-// From @c CAknAppUiBase. Overriden the parent method, because otherwise
-// the main lock state control would not receive the call, because is is not
-// window-owning control (=without window->not visible). The call is needed
-// because the main state control owns window-owning child controls.
-// ---------------------------------------------------------------------------
-void CLockAppAppUi::HandleResourceChangeL( TInt aType )
-    {
-    // call super-class
-    CAknAppUi::HandleResourceChangeL( aType );
-    // propagate call - since does not own window
-    iStateControl->HandleResourceChange( aType );
-    }
--- a/securitydialogs/lockapp/src/lockappbasecontrol.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,277 +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:  Base control for logical UI components
- *
-*/
-
-
-#include "lockappbasecontrol.h"
-#include "lockappkeycapturecontroller.h"
-#include "lockapputils.h"
-
-#include <eikenv.h>
-#include <eikbtgpc.h>
-#include <aknnotedialog.h>
-#include <AknSmallIndicator.h> // CAknSmallIndicator
-#include <AknUtils.h>
-
-// ---------------------------------------------------------------------------
-// Constructor.
-// ---------------------------------------------------------------------------
-CLockAppBaseControl::CLockAppBaseControl( MLockAppStateControl& aStateControl ) :
-    iStateControl(aStateControl), iWindowGroup( iEikonEnv->RootWin())
-    {
-	INFO_4( "%s %s (%u) 1=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 );
-    }
-
-// ---------------------------------------------------------------------------
-// Second phase constructor.
-// ---------------------------------------------------------------------------
-void CLockAppBaseControl::ConstructL( )
-    {
-	INFO_4( "%s %s (%u) 1=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 );
-    iKeyPattern = CLockAppKeyPattern::NewL( );
-    }
-
-// ---------------------------------------------------------------------------
-// Destructor.
-// ---------------------------------------------------------------------------
-CLockAppBaseControl::~CLockAppBaseControl( )
-    {
-    CancelNote( );
-    if ( iActive )
-        {
-        TRAP_IGNORE(HandleDeActivateEventL( NULL ));
-        }
-    delete iCba;
-    delete iKeyPattern;
-    }
-
-// ---------------------------------------------------------------------------
-// Setup key pattern matcher.
-// ---------------------------------------------------------------------------
-TBool CLockAppBaseControl::SetupKeyPatternsWithPolicyL( TLockPolicyType aType )
-    {
-    INFO_1( "CLockAppBaseControl::SetupKeyPatternsL( type=%d )", aType );
-    TBool ret(EFalse);
-    __ASSERT_DEBUG( iKeyPattern, DoPanic(ELockIllegalState));
-    if ( iKeyPattern )
-        {
-        CKeyLockPolicyApi* keylockPolicy = CKeyLockPolicyApi::NewL( aType );
-                
-        // if the keylockpolicy has keycombinations
-        if ( keylockPolicy->HasConfiguration( ) )
-            {
-            // TESTING1!
-            INFO( "CLockAppBaseControl::SetupKeyPatternsWithPolicyL - HasConfiguration!" );
-            
-            TUint32 index(0), k1(0), k2(0);
-            while ( keylockPolicy->GetKeyCombination( index, k1, k2 )== KErrNone )
-                {
-                // TESTING2!
-                INFO( "CLockAppBaseControl::SetupKeyPatternsWithPolicyL - key combination found!" );
-                
-                // add each combination to our pattern matcher
-                iKeyPattern->AddPattern( k1, k2 );
-                index++;
-                }
-                        
-            ret = ETrue;
-            INFO_1( "CLockAppBaseControl::SetupKeyPatternsL: added %d patterns", index );
-            }
-        delete keylockPolicy;
-        }
-    return ret;
-    }
-
-// ---------------------------------------------------------------------------
-// Show note
-// ---------------------------------------------------------------------------
-void CLockAppBaseControl::ShowNote( CLockAppLockedNote* aNote, const TInt aTimeout,
-        const CAknNoteDialog::TTone aTone )
-    {
-    if ( aNote )
-        {
-        // cancel the current note if any
-        if ( iCurrentNote != aNote )
-            {
-            CancelNote( );
-            iCurrentNote = aNote;
-            }
-        iCurrentNote->ShowNote( aTimeout, aTone );
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Cancel currently shown note
-// ---------------------------------------------------------------------------
-void CLockAppBaseControl::CancelNote( )
-    {
-    if ( iCurrentNote )
-        {
-        if ( iCurrentNote->IsVisible( ) )
-            {
-            iCurrentNote->CancelNote( );
-            }
-        iCurrentNote = NULL;
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Internal lock state has been changed.
-// ---------------------------------------------------------------------------
-void CLockAppBaseControl::HandleLockStatusChangedL( TLockStatus aStatus )
-    {
-    switch ( aStatus )
-        {
-        case ELockNotActive:
-            break;
-        case EKeyguardActive:
-            break;
-        case EDevicelockActive:
-            break;
-        default:
-            DoPanic( ELockPanicGeneral );
-            break;
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Handle activate event
-// ---------------------------------------------------------------------------
-void CLockAppBaseControl::HandleActivateEventL( TUint /*aEnvMask*/ )
-    {
-    __ASSERT_DEBUG( !iActive, DoPanic(ELockIllegalState));
-    if ( !iActive )
-        {
-        iActive = ETrue;
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Handle de-activate event
-// ---------------------------------------------------------------------------
-void CLockAppBaseControl::HandleDeActivateEventL( TUint /*aEnvMask*/ )
-    {
-    __ASSERT_DEBUG( iActive, DoPanic(ELockIllegalState));
-    if ( iActive )
-        {
-        iActive = EFalse;
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Capture/uncapture primary keys
-// ---------------------------------------------------------------------------
-void CLockAppBaseControl::CapturePrimaryKeys( const TBool aCapture )
-    {   
-    	INFO_4( "%s %s (%u) aCapture=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aCapture );
-    	INFO_4( "%s %s (%u) iKeyPattern=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iKeyPattern );
-    if ( iKeyPattern )
-        {
-        if ( aCapture )
-            {
-            // capture primary keys
-            TUint32 index( 0), primaryKey( 0), secondaryKey( 0);
-            while (iKeyPattern->GetPattern( index, primaryKey, secondaryKey )== KErrNone )
-                {
-                CLockAppKeyCaptureController::CaptureKey( primaryKey, 0, EKeyCaptureUpAndDownEvents );
-                index++;
-                }
-            }
-        else
-            {
-            // uncapture primary keys
-            TUint32 index( 0), primaryKey( 0), secondaryKey( 0);
-            while (iKeyPattern->GetPattern( index, primaryKey, secondaryKey )== KErrNone )
-                {
-                CLockAppKeyCaptureController::ReleaseKey( primaryKey );
-                index++;
-                }
-            }
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Bring keyguard cba forwards/backwards.
-// ---------------------------------------------------------------------------
-void CLockAppBaseControl::ShowCba( const TBool aShow )
-    {
-    if ( iCba )
-        {
-        RDrawableWindow* cbaWindow = iCba->ButtonGroup()->AsControl()->DrawableWindow( );
-        if ( aShow )
-            {
-            cbaWindow->SetNonFading( ETrue );
-            cbaWindow->SetOrdinalPosition( 0 );
-            iCba->MakeVisible( ETrue );
-            }
-        else
-            {
-            // hide the window
-            iCba->MakeVisible( EFalse );
-            }
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Method used for capturing/releasing pointer events when key lock is enabled.
-// Capturing is done using button/cba group window.
-// ---------------------------------------------------------------------------
-void CLockAppBaseControl::SetPointerEventCapture(const TBool aEnable )
-    {
-#ifdef RD_SCALABLE_UI_V2
-    if ( AknLayoutUtils::PenEnabled( )&& iCba )
-        {
-        // cba captures all pointer events
-        RDrawableWindow* cbaWindow = iCba->ButtonGroup()->AsControl()->DrawableWindow( );
-        if ( aEnable )
-            {
-            cbaWindow->SetPointerCapture( RWindowBase::TCaptureDragDrop );
-            }
-        else
-            {
-            cbaWindow->SetPointerCapture( RWindowBase::TCaptureDisabled );
-            }
-        cbaWindow->ClaimPointerGrab( aEnable );
-        }
-#endif // RD_SCALABLE_UI_V2
-    }
-
-// ---------------------------------------------------------------------------
-// Set Keyguard indicator on Idle.
-// ---------------------------------------------------------------------------
-void CLockAppBaseControl::SetKeyguardIndicatorStateL( const TBool aEnable )
-    {
-    CAknSmallIndicator* theIndicator = CAknSmallIndicator::NewLC( TUid::Uid( EAknIndicatorKeyguard ) );
-    if ( aEnable )
-        {
-        theIndicator->SetIndicatorStateL( EAknIndicatorStateOn );
-        }
-    else
-        {
-        theIndicator->SetIndicatorStateL( EAknIndicatorStateOff );
-        }
-    CleanupStack::PopAndDestroy( theIndicator );
-    }
-
-// ---------------------------------------------------------------------------
-// Handle environment changes (Screensaver, Telephony, etc.)
-// ---------------------------------------------------------------------------
-void CLockAppBaseControl::HandleEnvironmentChange( TUint /*aEnvMask*/, TUint /*aEventMask*/ )
-    {
-    // no implementation needed - virtual function
-    }
-
-// END OF FILE
--- a/securitydialogs/lockapp/src/lockappcenrepobserver.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,146 +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:  Central Repository key observer
- *
-*/
-
-
-#include <centralrepository.h>
-#include "lockappcenrepobserver.h"
-#include "lockapputils.h"
-
-// ---------------------------------------------------------------------------
-// Two-phased constructor.
-// ---------------------------------------------------------------------------
-CLockAppCenRepObserver* CLockAppCenRepObserver::NewL( MLockAppObserverInterface* aObserver,
-        TUid aCenRepUid, TUint32 aKeyId )
-    {
-    CLockAppCenRepObserver* self = new (ELeave) CLockAppCenRepObserver(aObserver, aCenRepUid, aKeyId);
-    CleanupStack::PushL( self );
-    self->ConstructL( );
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-// Destructor
-// ---------------------------------------------------------------------------
-CLockAppCenRepObserver::~CLockAppCenRepObserver( )
-    {
-    if ( iNotifyHandler )
-        {
-        iNotifyHandler->StopListening( );
-        delete iNotifyHandler;
-        iNotifyHandler = NULL;
-        }
-    if ( iRepository )
-        {
-        delete iRepository;
-        iRepository = NULL;
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// C++ default constructor
-// ---------------------------------------------------------------------------
-CLockAppCenRepObserver::CLockAppCenRepObserver( MLockAppObserverInterface* aObserver,
-        TUid aCenRepUid, TUint32 aKeyId ) :
-    iObserver(aObserver),
-    iCenRepUid(aCenRepUid),
-    iKeyId(aKeyId)
-    {
-    }
-
-// ---------------------------------------------------------------------------
-// Symbian OS default constructor
-// ---------------------------------------------------------------------------
-void CLockAppCenRepObserver::ConstructL( )
-    {
-    // init cenrep connection
-INFO_4( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-    iRepository = CRepository::NewL( iCenRepUid );
-    iNotifyHandler = CCenRepNotifyHandler::NewL( *this, *iRepository,
-            CCenRepNotifyHandler::EIntKey, iKeyId );
-    iNotifyHandler->StartListeningL( );
-    }
-
-// ---------------------------------------------------------------------------
-// Gets value of the default key from CenRep.
-// ---------------------------------------------------------------------------
-TInt CLockAppCenRepObserver::GetValue(TInt& aValue )
-    {
-    return iRepository->Get( iKeyId, aValue );
-    }
-
-// ---------------------------------------------------------------------------
-// Gets value of the key from CenRep.
-// ---------------------------------------------------------------------------
-TInt CLockAppCenRepObserver::GetKeyValue(TUint32 aKey, TInt& aValue )
-    {
-    	    INFO_4( "%s %s (%u) aKey=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aKey );
-
-    return iRepository->Get( aKey, aValue );
-    }
-
-// ---------------------------------------------------------------------------
-// Sets a value for the default key in CenRep.
-// ---------------------------------------------------------------------------
-TInt CLockAppCenRepObserver::SetValue(TInt aValue )
-    {
-    return iRepository->Set( iKeyId, aValue );
-    }
-
-// ---------------------------------------------------------------------------
-// Sets a value for the key in CenRep.
-// ---------------------------------------------------------------------------
-TInt CLockAppCenRepObserver::SetKeyValue(TUint32 aKey, TInt aValue )
-    {
-    return iRepository->Set( aKey, aValue );
-    }
-
-// ---------------------------------------------------------------------------
-// Handles changes. Called by CenRep.
-// ---------------------------------------------------------------------------
-void CLockAppCenRepObserver::HandleNotifyInt(TUint32 aKeyId, TInt aValue )
-    {
-INFO_4( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-    if ( aKeyId == iKeyId )
-        {
-        if ( iObserver )
-            {
-            iObserver->HandleCenRepNotify( iCenRepUid, iKeyId, aValue );
-            }
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Handles errors. Called by CenRep.
-// ---------------------------------------------------------------------------
-void CLockAppCenRepObserver::HandleNotifyError(TUint32 aId, TInt error, CCenRepNotifyHandler* /*aHandler*/)
-    {
-    ERROR_1(error, "CLockAppCenRepObserver::HandleNotifyError - %d", aId);
-    }
-
-// ---------------------------------------------------------------------------
-// Handles Repository wide reset caused generic notifications. Called by CenRep.
-// ---------------------------------------------------------------------------
-void CLockAppCenRepObserver::HandleNotifyGeneric(TUint32 aId )
-    {
-    if ( aId == NCentralRepositoryConstants::KInvalidNotificationId )
-        {
-        // TODO implement what to do in this case
-        }
-    }
-
-// END OF FILE
--- a/securitydialogs/lockapp/src/lockappdevicelockcontainer.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,300 +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:  Devicelock Background UI (window owning control)
- *
-*/
-
-
-// INCLUDE FILES
-#include "lockappdevicelockcontainer.h"
-#include "lockapputils.h"
-
-#include <eikenv.h>
-#include <lockapp.mbg>
-#include <avkon.hrh>
-#include <aknlayoutscalable_avkon.cdl.h>
-#include <aknlayoutscalable_apps.cdl.h>
-#include <AknsLayeredBackgroundControlContext.h>
-#include <AknsDrawUtils.h>
-#include <AknBitmapAnimation.h>
-#include <AknsUtils.h>
-#include <AknUtils.h>
-#include <aknappui.h>
-
-#include <layoutmetadata.cdl.h>
-#include <data_caging_path_literals.hrh>
-#include <eikdef.h>
-
-_LIT(LOCKBITMAPNAME, "AutoLock.mbm"); // TODO change filename
-
-// CONSTANTS
-
-#ifdef RD_FULLSCREEN_WALLPAPER
-enum TAutolockBgLayers
-    {
-    EAutolockBgLayerWallpaper = 0,
-    EAutolockBgLayerBackground = 1,
-    EAutolockBgLayersN = 2
-    };
-#else
-enum TAutolockBgLayers
-    {
-    EAutolockBgLayerBackground = 0,
-    EAutolockBgLayerWallpaper = 1,
-    EAutolockBgLayersN = 2
-    };
-#endif //RD_FULLSCREEN_WALLPAPER
-
-// ---------------------------------------------------------------------------
-// Standard Symbian OS construction sequence
-// ---------------------------------------------------------------------------
-CLockAppDevicelockContainer* CLockAppDevicelockContainer::NewL( RWindowGroup& aWg )
-    {
-    CLockAppDevicelockContainer* self = new (ELeave) CLockAppDevicelockContainer( );
-    CleanupStack::PushL( self );
-    self->ConstructL( aWg );
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// ---------------------------------------------------------
-// Symbian OS two phased constructor
-// ---------------------------------------------------------
-void CLockAppDevicelockContainer::ConstructL( RWindowGroup& aWg )
-    {
-    INFO( "CLockAppDevicelockContainer::ConstructL started" );
-
-    CreateWindowL( aWg );
-    MakeVisible( EFalse );
-
-    HBufC* bitMapPath = HBufC::NewLC( KMaxPath );
-    TPtr BitmapFile( bitMapPath->Des( ) );
-    BitmapFile.Append( _L("Z:") );
-    BitmapFile.Append( KDC_APP_BITMAP_DIR );
-    BitmapFile.Append( LOCKBITMAPNAME );
-
-    TRect mainPaneRect = GetMainPaneRect( );
-
-    iClock = NULL;
-    iEikBitmap = NULL;
-    AknsUtils::CreateIconL( AknsUtils::SkinInstance( ), KAknsIIDQgnGrafPhoneLocked, iBitmap, iMask,
-            BitmapFile, EMbmLockappQgn_graf_phone_locked, EMbmLockappQgn_graf_phone_locked_mask );
-
-#ifdef RD_FULLSCREEN_WALLPAPER
-    TSize screenSize = iCoeEnv->ScreenDevice()->SizeInPixels( );
-    TRect wallpaperRect( TPoint( 0, 0 ), screenSize);
-    iBgContext = CAknsLayeredBackgroundControlContext::NewL( KAknsIIDWallpaper, wallpaperRect,
-            ETrue, EAutolockBgLayersN );
-#else
-    // Create background control context for skins. Use parent absolute mode,
-    // as this is window owning control
-    iBgContext = CAknsLayeredBackgroundControlContext::NewL(
-            KAknsIIDQsnBgAreaMainIdle, mainPaneRect, ETrue, EAutolockBgLayersN );
-    iBgContext->SetLayerImage( EAutolockBgLayerWallpaper, KAknsIIDWallpaper );
-    iBgContext->SetLayerRect( EAutolockBgLayerWallpaper, mainPaneRect );
-#endif // RD_FULLSCREEN_WALLPAPER
-
-    SetRect( mainPaneRect );
-    CleanupStack::PopAndDestroy( bitMapPath ); //bitMapPath
-    INFO( "CLockAppDevicelockContainer::ConstructL completed" );
-    }
-
-// ---------------------------------------------------------
-// Destructor
-// ---------------------------------------------------------
-CLockAppDevicelockContainer::~CLockAppDevicelockContainer( )
-    {
-    delete iBgContext;
-    delete iBitmap;
-    delete iMask;
-    delete iClock;
-    }
-
-// ---------------------------------------------------------
-// Return the rectangle for this control
-// ---------------------------------------------------------
-TRect CLockAppDevicelockContainer::GetMainPaneRect( )
-    {
-    TRect screen( iAvkonAppUi->ApplicationRect());
-    TAknLayoutRect applicationWindow;
-    applicationWindow.LayoutRect( screen, AknLayoutScalable_Avkon::application_window( 0 ) );
-    TInt mainPaneVariety = ( Layout_Meta_Data::IsLandscapeOrientation() ? 4 : 3 );
-    TAknLayoutRect mainPane;
-    mainPane.LayoutRect( applicationWindow.Rect( ),
-            AknLayoutScalable_Avkon::main_pane( mainPaneVariety ) );
-    return mainPane.Rect( );
-    }
-
-// ---------------------------------------------------------
-// Called by framework when the view size is changed
-// ---------------------------------------------------------
-void CLockAppDevicelockContainer::SizeChanged()
-    {
-    INFO( "CLockAppDevicelockContainer::SizeChanged" );
-    TRect mainPaneRect( Rect( ));
-    TAknLayoutRect idleTradPane;
-    idleTradPane.LayoutRect( mainPaneRect, AknLayoutScalable_Avkon::main_idle_trad_pane( ) );
-
-    TInt variety = ( Layout_Meta_Data::IsLandscapeOrientation() ? 2 : 3 );
-
-    TAknLayoutRect idlePaneG2;
-    idlePaneG2.LayoutRect( idleTradPane.Rect( ),
-            AknLayoutScalable_Avkon::main_idle_pane_g2( variety ) );
-    AknIconUtils::SetSize( iBitmap, idlePaneG2.Rect().Size( ) );
-
-    TPoint parentPos( 0, 0);
-#ifdef RD_FULLSCREEN_WALLPAPER
-    TSize screenSize = iCoeEnv->ScreenDevice()->SizeInPixels( );
-    TRect wallpaperRect( TPoint( 0, 0 ), screenSize);
-    iBgContext->SetLayerRect( EAutolockBgLayerBackground, Rect( ) );
-    iBgContext->SetLayerRect( EAutolockBgLayerWallpaper, wallpaperRect );
-#else
-    iBgContext->SetLayerRect( EAutolockBgLayerBackground, Rect() );
-    iBgContext->SetLayerRect( EAutolockBgLayerWallpaper, Rect() );
-    //parent must be set when using parent absolute mode.
-    parentPos = PositionRelativeToScreen();
-#endif //RD_FULLSCREEN_WALLPAPER
-
-    iBgContext->SetParentPos( parentPos );
-
-    if ( !Layout_Meta_Data::IsLandscapeOrientation() )
-        {
-        // the screen is in portrait mode
-        if ( iClock )
-            {
-            // remove clock, if it exists
-            delete iClock;
-            iClock = NULL;
-            }
-        RRegion autolockRegion;
-#ifdef  RD_FULLSCREEN_WALLPAPER
-        autolockRegion.AddRect( wallpaperRect );
-#else
-        autolockRegion.AddRect( Rect() );
-#endif //RD_FULLSCREEN_WALLPAPER
-        Window().SetShape( autolockRegion );
-        autolockRegion.Close( );
-        }
-    else
-        {
-        // the screen is in landscape mode.
-        // get the correct area from layout utils.
-        TAknLayoutRect popupClockDigitalAnalogueWindowLayoutRect;
-        popupClockDigitalAnalogueWindowLayoutRect.LayoutRect( idleTradPane.Rect( ),
-                AknLayoutScalable_Avkon::popup_clock_digital_analogue_window( 3 ) );
-        TRect popupClockDigitalAnalogueWindowRect(popupClockDigitalAnalogueWindowLayoutRect.Rect( ));
-
-        // since the clock is not shown in app shell when the screen is in landscape,
-        // we'll show a clock here.
-        if ( !iClock )
-            {
-            TRAP_IGNORE({
-                        CAknSkinnableClock* clock = CAknSkinnableClock::NewL( this, ETrue, EFalse );
-                        CleanupStack::PushL( clock );
-                        clock->SetRect( popupClockDigitalAnalogueWindowRect );
-                        clock->ActivateL();
-                        CleanupStack::Pop( clock );
-                        iClock = clock;
-                        });
-            }
-        else
-            {
-            iClock->SetRect( popupClockDigitalAnalogueWindowRect );
-            }
-        RRegion autolockRegion;
-#ifdef RD_FULLSCREEN_WALLPAPER
-        autolockRegion.AddRect( wallpaperRect );
-#else
-        autolockRegion.AddRect( Rect() );
-#endif //RD_FULLSCREEN_WALLPAPER
-        autolockRegion.AddRect( iClock->Rect( ) );
-        Window().SetShape( autolockRegion );
-        autolockRegion.Close( );
-        }
-     }
-
-// ---------------------------------------------------------
-// CLockAppDevicelockContainer::CountComponentControls() const
-// ---------------------------------------------------------
-TInt CLockAppDevicelockContainer::CountComponentControls( ) const
-    {
-    TInt controlCount = 0;
-    if ( Layout_Meta_Data::IsLandscapeOrientation( ) )
-        {
-        if ( iClock )
-            {
-            controlCount++;
-            }
-        }
-    return controlCount;
-    }
-
-// ---------------------------------------------------------
-// CLockAppDevicelockContainer::ComponentControl(TInt aIndex) const
-// ---------------------------------------------------------
-CCoeControl* CLockAppDevicelockContainer::ComponentControl(TInt /*aIndex*/) const
-    {
-    return iClock;
-    }
-
-// ---------------------------------------------------------
-// CLockAppDevicelockContainer::Draw(const TRect& aRect) const
-// ---------------------------------------------------------
-void CLockAppDevicelockContainer::Draw(const TRect& aRect) const
-    {
-    CWindowGc& gc = SystemGc( );
-    gc.SetPenStyle( CGraphicsContext::ENullPen );
-    gc.SetBrushColor( KRgbWhite );
-    gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
-    MAknsSkinInstance* skin = AknsUtils::SkinInstance( );
-    MAknsControlContext* cc = AknsDrawUtils::ControlContext( this );
-    AknsDrawUtils::Background( skin, cc, this, gc, aRect );
-
-    if ( iBitmap )
-        {
-        // Draw "lock" icon centered to this control
-        TInt x = (Rect().Width( ) - iBitmap->SizeInPixels().iWidth) / 2;
-        TInt y = (Rect().Height( ) - iBitmap->SizeInPixels().iHeight) / 2;
-        if ( iMask )
-            {
-            gc.BitBltMasked( TPoint( x, y ), iBitmap, TRect( TPoint( 0, 0 ),
-                    iBitmap->SizeInPixels( ) ), iMask, ETrue );
-            }
-        else
-            {
-            gc.BitBlt( TPoint( x, y ), iBitmap );
-            }
-        }
-    }
-
-// ---------------------------------------------------------
-// CLockAppDevicelockContainer::HandleControlEventL( CCoeControl* aControl,TCoeEvent aEventType)
-// ---------------------------------------------------------
-void CLockAppDevicelockContainer::HandleControlEventL(CCoeControl* /*aControl*/, TCoeEvent /*aEventType*/)
-    {
-    }
-
-// ---------------------------------------------------------
-// CLockAppDevicelockContainer::MopSupplyObject
-// ---------------------------------------------------------
-TTypeUid::Ptr CLockAppDevicelockContainer::MopSupplyObject( TTypeUid aId )
-    {
-    if ( aId.iUid == MAknsControlContext::ETypeId )
-        {
-        return MAknsControlContext::SupplyMopObject( aId, iBgContext );
-        }
-    return CCoeControl::MopSupplyObject( aId );
-    }
-
-// End of File
--- a/securitydialogs/lockapp/src/lockappdevicelockcontrol.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1178 +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:  Devicelock UI
- *
-*/
-
-
-#include "lockappdevicelockcontrol.h"
-#include "lockappdevicelockcontainer.h"
-#include "lockappstatecontrolinterface.h"
-#include "lockapppubsubobserver.h"
-#include "lockappcenrepobserver.h"
-#include "lockapputils.h"
-#include "lockappwait.h"
-#include "lockappkeycapturecontroller.h"
-
-#include <lockapp.rsg> // general avkon resources
-#include <avkon.rsg> // general avkon resources
-#include <aknnotpi.rsg> // keyguard spesific resources
-#include <AknUtils.h>
-#include <akntitle.h> // CAknTitlePane
-#include <activitymanager.h>
-#include <e32property.h>
-#include <etelmm.h>
-#include <mmtsy_names.h>
-#include <featmgr.h>
-#include <secui.h>
-#include <secuisecurityhandler.h>
-
-#include <settingsinternalcrkeys.h>  // KSettingsAutolockStatus
-#include <coreapplicationuisdomainpskeys.h>
-#include <securityuisprivatepskeys.h>
-#include <startupdomainpskeys.h>
-#include <startupdomaincrkeys.h>
-#include <ctsydomainpskeys.h>
-
-#ifdef __SAP_TERMINAL_CONTROL_FW
-#include <SCPClient.h>
-#endif // __SAP_TERMINAL_CONTROL_FW
-
-const TInt KAutoDeviceLockOff( 60000 );
-const TInt KPhoneIndex( 0 );
-const TInt KTriesToConnectServer( 2 );
-const TInt KTimeBeforeRetryingServerConnection( 50000 );
-
-// ---------------------------------------------------------------------------
-// Standard Symbian OS construction sequence
-// ---------------------------------------------------------------------------
-CLockAppDevicelockControl* CLockAppDevicelockControl::NewL(MLockAppStateControl& aStateControl, RWindowGroup& aWg )
-    {
-    CLockAppDevicelockControl* self = new (ELeave) CLockAppDevicelockControl( aStateControl );
-    INFO_4( "%s %s (%u) self=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, self );
-
-    CleanupStack::PushL( self );
-    self->ConstructL( aWg );
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-// Constructor passes the reference to the main state control.
-// ---------------------------------------------------------------------------
-CLockAppDevicelockControl::CLockAppDevicelockControl(MLockAppStateControl& aStateControl) :
-    CLockAppBaseControl(aStateControl), iShowingSecCodeQuery(EFalse)
-    {
-    	INFO_4( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-
-    }
-
-// ---------------------------------------------------------------------------
-// Destructor.
-// ---------------------------------------------------------------------------
-CLockAppDevicelockControl::~CLockAppDevicelockControl( )
-    {
-    	INFO_4( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-
-    /*****************************************************
-    *    S60 Customer / ETel
-    *    S60  ETel API
-    *****************************************************/
-    /*****************************************************
-    *    S60 Customer / TSY
-    *    Needs customer TSY implementation
-    *****************************************************/
-    INFO_4( "%s %s (%u) iCustomPhoneInitialized=%x -> -1 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iCustomPhoneInitialized );
-    iCustomPhoneInitialized=-1;
-    if ( iCustomPhone.SubSessionHandle( ) )
-        {
-        iCustomPhone.Close( );
-        INFO_4( "%s %s (%u) iCustomPhoneInitialized=%x -> -2 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iCustomPhoneInitialized );
-        iCustomPhoneInitialized=-2;
-        }
-
-		INFO_4( "%s %s (%u) iPhoneInitialized=%x -> -1 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPhoneInitialized );
-		iPhoneInitialized=-1;
-    if ( iPhone.SubSessionHandle( ) )
-        {
-        iPhone.Close( );
-        INFO_4( "%s %s (%u) iPhoneInitialized=%x -> -2 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPhoneInitialized );
-				iPhoneInitialized=-2;
-        }
-
-    INFO_4( "%s %s (%u) iTelServerInitialized=%x -> -1 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iTelServerInitialized );
-    iTelServerInitialized=-1;
-    if ( iTelServer.Handle( ) )
-        {
-        iTelServer.UnloadPhoneModule( KMmTsyModuleName );
-        iTelServer.Close( );
-        INFO_4( "%s %s (%u) iTelServerInitialized=%x -> -2 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iTelServerInitialized );
-        iTelServerInitialized=-2;
-        }
-    if ( iActivityManager )
-        {
-        iActivityManager->Cancel( );
-        delete iActivityManager;
-        iActivityManager = NULL;
-        }
-    // CenRep observers
-    if ( iCRAutoLockTime )
-        {
-        delete iCRAutoLockTime;
-        iCRAutoLockTime = NULL;
-        }
-    if ( iCRAutoLockStatus )
-        {
-        delete iCRAutoLockStatus;
-        iCRAutoLockStatus = NULL;
-        }
-    // PuSub observers
-    if ( iPSAutolockState )
-        {
-        delete iPSAutolockState;
-        iPSAutolockState = NULL;
-        }
-    if ( iContainer )
-        {
-        delete iContainer;
-        iContainer = NULL;
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Devicelock UI constructor reserves localized resources, configures itself
-// using CenRep and FeatureManager and reserves child controls.
-// ---------------------------------------------------------------------------
-void CLockAppDevicelockControl::ConstructL( RWindowGroup& aWg )
-    {
-    INFO( "CLockAppDevicelockControl::ConstructL started" );
-    CLockAppBaseControl::ConstructL( );
-
-    // feature manager is used for determining if the phone is a slider
-    FeatureManager::InitializeLibL( );
-    iFeatureProtocolCdma = FeatureManager::FeatureSupported( KFeatureIdProtocolCdma );
-    INFO_1("CLockAppDevicelockControl::ConstructL - iFeatureProtocolCdma: %d", iFeatureProtocolCdma);
-    FeatureManager::UnInitializeLib( );
-
-    // Cba control
-    iCba = CEikButtonGroupContainer::NewL( CEikButtonGroupContainer::ECba,
-            CEikButtonGroupContainer::EHorizontal, this,
-            R_KEYLOCK_SOFTKEYS_UNLOCK_EMPTY );
-
-    TRect screenRect;
-    AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screenRect );
-    iCba->SetBoundingRect( screenRect );
-    iCba->MakeVisible( EFalse );
-
-    // Set up the status pane
-    CEikStatusPane* sp = iAvkonAppUi->StatusPane();
-    if ( sp )
-        {
-        // Switch the layout to show analog clock
-        TRAPD(err, sp->SwitchLayoutL( R_AVKON_STATUS_PANE_LAYOUT_IDLE ) )
-        ERROR(err, "CLockAppDevicelockControl::ConstructL - failed to switch status pane layout");
-        if ( sp->PaneCapabilities(TUid::Uid(EEikStatusPaneUidTitle)).IsPresent( ) )
-            {
-            // Get the title pane control from status pane
-            CAknTitlePane* titlePane = NULL;
-            TRAPD(err2, titlePane = static_cast<CAknTitlePane*>( sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle) ) ) )
-            ERROR(err2, "CLockAppDevicelockControl::ConstructL - failed to get status title pane");
-            if ( titlePane )
-                {
-                // Read localized "Locked" text from resource.
-                HBufC* lockedString = iCoeEnv->AllocReadResourceL( R_TITLE_PANE_LOCKED );
-                // Set as title pane text - titlepane takes ownership of the string
-                titlePane->SetText( lockedString );
-                }
-            }
-        }
-
-    INFO( "CLockAppDevicelockControl::ConstructL completed" );
-    }
-
-void CLockAppDevicelockControl::ConnectToPhoneL( RWindowGroup& aWg )
-		{
-    INFO( "CLockAppDevicelockControl::ConnectToPhoneL - connecting to etel server" );
-    // All server connections are tried to be made KTiesToConnectServer times because
-    // occasional fails on connections are possible at least on some servers
-    TInt err( KErrGeneral);
-    TInt thisTry( 0);
-    while ( ( err = iTelServer.Connect() ) != KErrNone && ( thisTry++ ) <= KTriesToConnectServer )
-        {
-        User::After( KTimeBeforeRetryingServerConnection );
-        }
-    ERROR(err, "CLockAppDevicelockControl::ConnectToPhoneL - connecting to etel server");
-    User::LeaveIfError( err );
-    INFO_4( "%s %s (%u) iTelServerInitialized=%x -> 2 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iTelServerInitialized );
-    iTelServerInitialized=2;
-
-
-    /*****************************************************
-    *    S60 Customer / ETel
-    *    S60  ETel API
-    *****************************************************/
-    /*****************************************************
-    *    S60 Customer / TSY
-    *    Needs customer TSY implementation
-    *****************************************************/
-    INFO( "CLockAppDevicelockControl::ConnectToPhoneL - loading TSY");
-    err = iTelServer.LoadPhoneModule( KMmTsyModuleName );
-    if ( err != KErrAlreadyExists )
-        {
-        // may return also KErrAlreadyExists if some other
-        // is already loaded the tsy module. And that is not an error.
-        ERROR(err, "CLockAppDevicelockControl::ConnectToPhoneL - loading TSY");
-        User::LeaveIfError( err );
-        }
-    INFO_4( "%s %s (%u) iTelServerInitialized=%x -> 3 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iTelServerInitialized );
-    iTelServerInitialized=3;
-
-    /*****************************************************
-    *    S60 Customer / ETel
-    *    S60  ETel API
-    *****************************************************/
-    INFO( "CLockAppDevicelockControl::ConnectToPhoneL - opening phone");
-    RTelServer::TPhoneInfo PhoneInfo;
-    User::LeaveIfError( iTelServer.SetExtendedErrorGranularity( RTelServer::EErrorExtended ) );
-    INFO_4( "%s %s (%u) iTelServerInitialized=%x -> 5 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iTelServerInitialized );
-    iTelServerInitialized=5;
-    User::LeaveIfError( iTelServer.GetPhoneInfo( KPhoneIndex, PhoneInfo ) );
-    INFO_4( "%s %s (%u) iTelServerInitialized=%x -> 6 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iTelServerInitialized );
-    iTelServerInitialized=6;
-    User::LeaveIfError( iPhone.Open( iTelServer, PhoneInfo.iName ) );
-		INFO_4( "%s %s (%u) iPhoneInitialized=%x -> 2 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPhoneInitialized );
-		iPhoneInitialized=2;
-    User::LeaveIfError( iCustomPhone.Open( iPhone ) );
-		INFO_4( "%s %s (%u) iCustomPhoneInitialized=%x -> 2 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iCustomPhoneInitialized );
-		iCustomPhoneInitialized=2;
-
-    INFO( "CLockAppDevicelockControl::ConnectToPhoneL - phone opened");
-
-
-    TBool systemLocked(EFalse);
-
-    // Set up CenRep observers
-    iCRAutoLockTime = CLockAppCenRepObserver::NewL(this, KCRUidSecuritySettings, KSettingsAutoLockTime);
-    iCRAutoLockStatus = CLockAppCenRepObserver::NewL(this, KCRUidSecuritySettings, KSettingsAutolockStatus);
-
-    #ifndef __WINS__
-
-    /*****************************************************
-    *    S60 Customer / ETel
-    *    S60 ETel API
-    *****************************************************/
-
-    RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockPhoneDevice;
-    RMobilePhone::TMobilePhoneLockInfoV1 lockInfo;
-    RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo);
-
-    TRequestStatus getLockInfoStatus;
-    iPhone.GetLockInfo( getLockInfoStatus, lockType, lockInfoPkg );
-		INFO_4( "%s %s (%u) iPhoneInitialized=%x -> 3 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPhoneInitialized );
-		iPhoneInitialized=3;
-    User::WaitForRequest( getLockInfoStatus );
-
-    TInt lockValue(0);
-    TInt cRresult = iCRAutoLockStatus->GetValue( lockValue );
-    INFO_2( "CLockAppDevicelockControl::ConnectToPhoneL - CR autolockstatus=%d , res=%d", lockValue, cRresult);
-    TBool hiddenReset = IsHiddenReset( );
-    INFO_1( "CLockAppDevicelockControl::ConnectToPhoneL - hiddenReset=%d", hiddenReset );
-    if ( lockInfo.iSetting == RMobilePhone::ELockSetDisabled )
-        {
-        INFO( "CLockAppDevicelockControl::ConnectToPhoneL - ELockSetDisabled");
-        iCRAutoLockTime->SetValue( 0 );
-        if ( iFeatureProtocolCdma )
-            {
-            iCRAutoLockTime->SetKeyValue( KSettingsLockOnPowerUp, 0 );
-            }
-        }
-    else
-        {
-        if ( iFeatureProtocolCdma || (hiddenReset && (lockValue == 1)) )
-            {
-            // In CDMA, the system can stay locked on after the boot-up sequence.
-            INFO( "CLockAppDevicelockControl::ConnectToPhoneL - Hidden reset when locked");
-            systemLocked = ETrue;
-            }
-        }
-    #endif //__WINS__
-
-    // Create devicelock UI container
-    INFO_1( "CLockAppDevicelockControl::ConnectToPhoneL - creating CLockAppDevicelockContainer=%d", 1 );
-    iContainer = CLockAppDevicelockContainer::NewL( aWg );
-    INFO_1( "CLockAppDevicelockControl::ConnectToPhoneL - creating CLockAppDevicelockContainer=%d done", 1 );
-
-    INFO_1( "CLockAppDevicelockControl::ConnectToPhoneL - creating DefinePubSubKeysL=%d", 1 );
-    DefinePubSubKeysL( );
-    INFO_1( "CLockAppDevicelockControl::ConnectToPhoneL - creating DefinePubSubKeysL=%d", 1 );
-
-    // The following sequence is used to validate the configuration on SCP server.
-    // This is needed on the first boot (initial or RFS) or if the C-drive
-    // has been formatted (3-button format) and Autolock is not active.
-#ifdef __SAP_TERMINAL_CONTROL_FW
-		// This seems to be defined always.
-    INFO( "CLockAppDevicelockControl::ConnectToPhoneL - Validate SCP Config" );
-    RSCPClient scpClient;
-    if ( scpClient.Connect() == KErrNone )
-        {
-        CleanupClosePushL( scpClient );
-        TInt confStatus = scpClient.CheckConfiguration( KSCPInitial );
-        if ( confStatus == KErrAccessDenied )
-            {
-#ifndef __WINS__
-            if ( ( lockInfo.iSetting == RMobilePhone::ELockSetDisabled ) )
-#else // __WINS__
-            if ( ETrue ) // DOS lock is never active in WINS
-#endif // __WINS__
-                {
-                // DOS lock is not active. Note that if DOS is locked, checking the code here will
-                // mess up the query sequence. On initial startup DOS is not locked.
-                TInt finalConfStatus = scpClient.CheckConfiguration( KSCPComplete );
-                if ( finalConfStatus == KErrAccessDenied )
-                    {
-#ifdef __WINS__
-                    ERROR(finalConfStatus, "CLockAppDevicelockControl::ConnectToPhoneL - DOS validation FAILED in WINS!");
-#else // !__WINS__
-                    // The SCP server is out of sync and Autolock is not active. (c-drive formatted)
-                    // We must ask the security code. ( Note that it is very rare that this is executed )
-                    INFO( "CLockAppDevicelockControl::ConnectToPhoneL - Lock setting disabled, calling setlocksetting");
-
-                    // Wait here until the startup is complete
-                    TInt tarmErr(KErrNone);
-                    while ( tarmErr == KErrNone )
-                        {
-                        TInt sysState;
-                        tarmErr = RProperty::Get(KPSUidStartup, KPSGlobalSystemState, sysState);
-                        if ((sysState == ESwStateNormalRfOn) ||
-                            (sysState == ESwStateNormalRfOff) ||
-                            (sysState == ESwStateNormalBTSap))
-                            {
-                            break;
-                            }
-                        User::After(500000); // half a second
-                        }
-
-                    // Just change the lock setting again to disabled to request the security code.
-                    // Set the TARM flag so SecUi knows it should display the "login" query.
-                    TInt tarmFlag;
-                    TInt tRet = RProperty::Get( KSCPSIDAutolock, SCP_TARM_ADMIN_FLAG_UID, tarmFlag );
-                    if ( tRet == KErrNone )
-                        {
-                        tarmFlag |= KSCPFlagResyncQuery;
-                        tRet = RProperty::Set( KSCPSIDAutolock, SCP_TARM_ADMIN_FLAG_UID, tarmFlag );
-                        }
-                    ERROR(tRet, "CLockAppDevicelockControl::ConnectToPhoneL - FAILED to set TARM Admin Flag" );
-
-                    TRequestStatus setLockSettingStatus;
-                    RMobilePhone::TMobilePhoneLockSetting lockChange = RMobilePhone::ELockSetDisabled;
-                    iPhone.SetLockSetting( setLockSettingStatus, lockType, lockChange );
-                    User::WaitForRequest( setLockSettingStatus );
-#endif // __WINS__
-                    }
-                }
-            }
-        CleanupStack::PopAndDestroy(); // calls Close() on scpClient
-        }
-#endif // __SAP_TERMINAL_CONTROL_FW
-
-    // Set up P&S observers
-    iPSAutolockState = CLockAppPubSubObserver::NewL( this, KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus );
-
-    if ( systemLocked )
-        {
-        INFO( "CLockAppDevicelockControl::ConnectToPhoneL - Lock system");
-        INFO_4( "%s %s (%u) 1=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 );
-        iStateControl.EnableDevicelockL( EDevicelockManual );
-        INFO( "CLockAppDevicelockControl::ConnectToPhoneL - Lock system. Done");
-        }
-
-    // Activity manager
-    iActivityManager = CUserActivityManager::NewL( CActive::EPriorityStandard );
-    StartActivityMonitoringL( );
-
-    // Setup key pattern matcher
-    if ( !SetupKeyPatternsWithPolicyL( EPolicyDevicelockQuery ) )
-        {
-        INFO( "CLockAppDevicelockControl::ConnectToPhoneL - No CenRep policy defined" );
-        iKeyPattern->AddPattern( EStdKeyDevice0, 0 ); // '0' = second key code doesnt matter
-        }
-#ifdef __WINS__
-    iKeyPattern->AddPattern( EStdKeyDevice0, 0 ); // LSK + *
-#endif
-
-    INFO( "CLockAppDevicelockControl::ConstructL completed" );
-    }
-
-// ---------------------------------------------------------------------------
-// Define internal P&S autolock status key
-// ---------------------------------------------------------------------------
-void CLockAppDevicelockControl::DefinePubSubKeysL()
-    {
-    INFO( "CLockAppDevicelockControl::DefinePubSubKeysL" );
-
-    // Create the write policy. Also processes with write device data can write the value.
-    TSecurityPolicy writePolicy( ECapabilityWriteDeviceData );
-    // Create the read policy. Also processes with read device data can read the value.
-    TSecurityPolicy readPolicy( ECapabilityReadDeviceData );
-
-    TInt ret = RProperty::Define( KPSUidSecurityUIs,
-            KSecurityUIsSecUIOriginatedQuery, RProperty::EInt, readPolicy, writePolicy );
-    ERROR(ret, "CLockAppDevicelockControl::DefinePubSubKeysL - FAILED to define the SECUI query Flag");
-
-    ret = RProperty::Define( KPSUidSecurityUIs,
-            KSecurityUIsQueryRequestCancel, RProperty::EInt, readPolicy, writePolicy );
-    ERROR(ret, "CLockAppDevicelockControl::DefinePubSubKeysL - FAILED to define the SECUI query request state Flag");
-
-    _LIT_SECURITY_POLICY_PASS(KReadPolicy);
-    _LIT_SECURITY_POLICY_C1(KWritePolicy, ECapabilityWriteDeviceData);
-    ret = RProperty::Define( KPSUidCoreApplicationUIs,
-            KCoreAppUIsAutolockStatus, RProperty::EInt, KReadPolicy, KWritePolicy);
-    RProperty::Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, EAutolockOff);
-    if (ret != KErrAlreadyExists)
-        {
-        ERROR(ret, "CLockAppDevicelockControl::DefinePubSubKeysL - FAILED to set autolock status");
-        User::LeaveIfError(ret);
-        }
-
-    #ifdef __SAP_TERMINAL_CONTROL_FW
-    // Define the TARM admin flag.
-    ret = RProperty::Define( KSCPSIDAutolock,
-            SCP_TARM_ADMIN_FLAG_UID, RProperty::EInt, readPolicy, writePolicy );
-    ERROR(ret, "CLockAppDevicelockControl::DefinePubSubKeysL - FAILED to define the TARM Admin Flag");
-    #endif // __SAP_TERMINAL_CONTROL_FW
-    }
-
-// ----------------------------------------------------------
-// Checks whether we are booting from a Hidden Reset
-// ----------------------------------------------------------
-TBool CLockAppDevicelockControl::IsHiddenReset( )
-    {
-    	    	INFO_4( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-
-    TBool ret( EFalse );
-    TInt startupReason( ENormalStartup );
-    TInt err( KErrNone);
-    err = RProperty::Get( KPSUidStartup, KPSStartupReason, startupReason );
-    ERROR(err, "CLockAppDevicelockControl::IsHiddenReset - error getting startup reason" );
-    ret = (startupReason != ENormalStartup);
-    INFO_1( "CLockAppDevicelockControl::IsHiddenReset = %d", ret );
-		#ifdef _DEBUG
-			// test to simulate HiddenReset
-			RFs fs;
-			_LIT(KTestHiddenReset,"f:\\TestHiddenReset.txt");
-			RFile file;
-			User::LeaveIfError(fs.Connect());
-			err=file.Open(fs, KTestHiddenReset, EFileStreamText|EFileRead|EFileShareReadersOnly);
-			if(err==KErrNone)
-				{
-				INFO_4( "%s %s (%u) ??? TestHiddenReset=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 );
-				ret = ETrue;
-				}
-			file.Close();
-			fs.Close();
-		#endif
-    return ret;
-    }
-
-// ----------------------------------------------------------
-// Checks whether PIN1/UPIN is blocked
-// ----------------------------------------------------------
-TBool CLockAppDevicelockControl::IsPinBlocked( )
-    {
-    INFO( "CLockAppDevicelockControl::IsPinBlocked" );
-    TBool ret( EFalse );
-    RMmCustomAPI::TSecurityCodeType secCodeType;
-#if defined(__PROTOCOL_WCDMA) || defined(__UPIN)
-    RMobilePhone::TMobilePhoneSecurityCode activePin;
-    iCustomPhone.GetActivePin( activePin );
-    if ( activePin == RMobilePhone::ESecurityUniversalPin )
-        secCodeType = RMmCustomAPI::ESecurityUniversalPin;
-    else
-        secCodeType = RMmCustomAPI::ESecurityCodePin1;
-#else
-    secCodeType = RMmCustomAPI::ESecurityCodePin1;
-#endif //(__PROTOCOL_WCDMA) || defined(__UPIN)
-    iCustomPhone.IsBlocked( secCodeType, ret );
-    INFO_1( "CLockAppDevicelockControl::IsPinBlocked = %d", ret );
-    return ret;
-    }
-
-// ----------------------------------------------------------
-// Try to get (and optionally unset) the TARM Admin Flag
-// ----------------------------------------------------------
-TBool CLockAppDevicelockControl::TarmAdminFlag( TBool unSetFlag )
-    {
-    INFO_1( "CLockAppDevicelockControl::TarmAdminFlag(unSet = %d)", unSetFlag );
-    TBool ret(EFalse);
-#ifdef __SAP_TERMINAL_CONTROL_FW
-    // Get the TARM admin flag value
-    TInt tarmFlag;
-    TInt err = RProperty::Get( KSCPSIDAutolock, SCP_TARM_ADMIN_FLAG_UID, tarmFlag );
-    if ( err != KErrNone )
-        {
-        ERROR(err, "CLockAppDevicelockControl::TarmAdminFlag - Failed to get TARM flag" );
-        }
-    else
-        {
-        INFO_1( "CLockAppDevicelockControl::TarmAdminFlag - TARM flag: %d", tarmFlag );
-        }
-
-    if ( tarmFlag & KSCPFlagAdminLock )
-        {
-        ret = ETrue;
-        // Unset the TARM admin flag if set
-        if ( unSetFlag )
-            {
-            tarmFlag &= ~KSCPFlagAdminLock;
-            err = RProperty::Set( KSCPSIDAutolock, SCP_TARM_ADMIN_FLAG_UID, tarmFlag );
-            ERROR(err, "CLockAppDevicelockControl::TarmAdminFlag - FAILED to unset TARM flag" );
-            }
-        }
-#endif // __SAP_TERMINAL_CONTROL_FW
-    INFO_1( "CLockAppDevicelockControl::TarmAdminFlag = %d", ret );
-    return ret;
-    }
-
-// ---------------------------------------------------------------------------
-// Check ETEL lock info and ask sec code if neccessary
-// ---------------------------------------------------------------------------
-TBool CLockAppDevicelockControl::ETelActivationAllowed( )
-    {
-    INFO( "CLockAppDevicelockControl::ETelActivationAllowed" );
-    TBool ret(EFalse);
-#ifdef __WINS__
-    ret = ETrue;
-#else //__WINS__
-
-    /*****************************************************
-    *    S60 Customer / ETel
-    *    S60  ETel API
-    *****************************************************/
-
-
-		INFO_4( "%s %s (%u) 111 value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-
-    // INFO_4( "%s %s (%u) iStateControl=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iStateControl );
-
-		INFO_4( "%s %s (%u) checking iPhoneInitialized=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-		INFO_4( "%s %s (%u) iPhoneInitialized=%x -> 4 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPhoneInitialized );
-		iPhoneInitialized=4;
-
-    RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockPhoneDevice;
-    RMobilePhone::TMobilePhoneLockInfoV1 lockInfo;
-    RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo);
-    RMobilePhone::TMobilePhoneLockSetting lockChange(RMobilePhone::ELockSetDisabled);
-
-		INFO_4( "%s %s (%u) before getLockInfoStatus=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-    TRequestStatus getLockInfoStatus;
-		INFO_4( "%s %s (%u) after getLockInfoStatus=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-		
-		INFO_4( "%s %s (%u) iPhoneInitialized=%x -> 5 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPhoneInitialized );
-		iPhoneInitialized=5;
-    iPhone.GetLockInfo( getLockInfoStatus, lockType, lockInfoPkg );
-		INFO_4( "%s %s (%u) iPhoneInitialized=%x -> 6 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPhoneInitialized );
-		iPhoneInitialized=6;
-    User::WaitForRequest( getLockInfoStatus );
-
-    INFO_1( "CLockAppDevicelockControl::ETelActivationAllowed - GetLockInfo status: %d ", getLockInfoStatus.Int() );
-    if ( getLockInfoStatus.Int( )== KErrNone )
-        {
-        if ( lockInfo.iSetting == RMobilePhone::ELockSetDisabled )
-            {
-            // ask code
-            INFO( "CLockAppDevicelockControl::ETelActivationAllowed - ETel ELockSetDisabled, Ask Code" );
-            // Raise a flag to indicate that the UPIN request coming from ETEL
-            // has originated from SecUi and not from Engine.
-            RProperty::Set( KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsSystemLockOriginated );
-            TRequestStatus setLockSettingStatus;
-            lockChange = RMobilePhone::ELockSetEnabled;
-            iPhone.SetLockSetting( setLockSettingStatus, lockType, lockChange );
-            User::WaitForRequest( setLockSettingStatus );
-            INFO_1( "CLockAppDevicelockControl::ETelActivationAllowed - SetLockSetting status: %d ", setLockSettingStatus.Int() );
-            // Lower the flag
-            RProperty::Set( KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsETelAPIOriginated );
-            if (setLockSettingStatus.Int() == KErrNone)
-                {
-                ret = ETrue;
-                }
-            }
-        else
-            {
-            INFO( "CLockAppDevicelockControl::ETelActivationAllowed - Lock System Ok" );
-            ret = ETrue;
-            }
-        }
-    else
-        {
-        INFO( "CLockAppDevicelockControl::ETelActivationAllowed - Error getting LockInfo - Ask code (SLS)" );
-        // Raise a flag to indicate that the UPIN request coming from ETEL
-        // has originated from SecUi and not from Engine.
-        RProperty::Set( KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsSystemLockOriginated );
-        TRequestStatus setLockSettingStatus;
-        lockChange = RMobilePhone::ELockSetEnabled;
-				INFO_4( "%s %s (%u) iPhoneInitialized=%x -> 8 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPhoneInitialized );
-				iPhoneInitialized=8;
-        iPhone.SetLockSetting( setLockSettingStatus, lockType, lockChange );
-				INFO_4( "%s %s (%u) iPhoneInitialized=%x -> 9 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPhoneInitialized );
-				iPhoneInitialized=9;
-        User::WaitForRequest(setLockSettingStatus);
-        INFO_1( "CLockAppDevicelockControl::ETelActivationAllowed - SetLockSetting status: %d ", setLockSettingStatus.Int() );
-        // Lower the flag
-        RProperty::Set( KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsETelAPIOriginated );
-        if (setLockSettingStatus.Int() == KErrNone)
-            {
-            ret = ETrue;
-            }
-        }
-#endif
-    INFO_1( "CLockAppDevicelockControl::ETelActivationAllowed = %d", ret );
-    return ret;
-    }
-
-// ---------------------------------------------------------------------------
-// Check weather its allowed to activate the control
-// ---------------------------------------------------------------------------
-TBool CLockAppDevicelockControl::ActivationAllowedL( TDevicelockReason aReason )
-    {
-    INFO_1( "CLockAppDevicelockControl::ActivationAllowedL aReason= %d", aReason );
-    
-    if (aReason==ETimerLocked)
-    	{
- 			 { // REQ 414-5466 Prevention of device lock in context of Hands Free Voice UI
-	     TInt vuiValue = 0;
-	     TUid KHFVuiModePSUid = { 0x102818E7 };
-	     enum THFVuiModePSKeys
-	         {
-	         EHFVuiPSModeId = 1000
-	         };
-	     TInt tRet = RProperty::Get(KHFVuiModePSUid, EHFVuiPSModeId, vuiValue);  // also 0 if can't get because permissions or because doesn't exists
-	     #if defined(_DEBUG)
-	         INFO_4( "%s %s (%u) getting KHFVuiModePSUid+EHFVuiPSModeId=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, tRet );
-	         INFO_4( "%s %s (%u) vuiValue=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, vuiValue );
-	     #endif
-	     if(vuiValue)
-	         {
-	         #if defined(_DEBUG)
-	         RDebug::Print(_L("(LOCKAPP)CLockAppDevicelockControl::ActivationAllowedL() Voice functions active. No locking possible."));
-	         #endif
-	         return EFalse;
-	         }
-	     }
-	     { // if another query is displayed, the future un-lock query will crash. Don't allow time-lock in this case.
-	     TInt secQueryStatus = ESecurityQueryUninitialized;
-	     TInt tRet = RProperty::Get(KPSUidStartup, KStartupSecurityCodeQueryStatus, secQueryStatus);  // also 0 if can't get because permissions or because doesn't exists
-	     #if defined(_DEBUG)
-	         INFO_4( "%s %s (%u) getting KPSUidStartup+KStartupSecurityCodeQueryStatus=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, tRet );
-	         INFO_4( "%s %s (%u) secQueryStatus=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, secQueryStatus );
-	     #endif
-	     if(secQueryStatus==ESecurityQueryActive)
-	         {
-	         #if defined(_DEBUG)
-	         RDebug::Print(_L("(LOCKAPP)CLockAppDevicelockControl::ActivationAllowedL() Asking some other security code. No locking possible."));
-	         #endif
-	         return EFalse;
-	         }
-	     }
-    	}
-    
-    TInt lightStatus=EForcedLightsUninitialized; 
-    RProperty::Get(KPSUidCoreApplicationUIs,KLightsVTForcedLightsOn,lightStatus ); 
-    //If display is forced on. don't lock 
-    if(lightStatus == EForcedLightsOn ) 
-        { 
-        #if defined(_DEBUG) 
-        RDebug::Print(_L("(LOCKAPP)CLockAppDevicelockControl::ActivationAllowedL() Display is forced on deivce not locked")); 
-        #endif 
-        return EFalse;
-        } 
-
-    // first check ETEL side - and ask sec code if needed
-    if ( !ETelActivationAllowed() )
-        {
-        return EFalse;
-        }
-
-    if ( IsPinBlocked( ) )
-        {
-        return EFalse;
-        }
-
-    TBool ret(EFalse);
-    TInt sysState(0);
-    RProperty::Get( KPSUidStartup, KPSGlobalSystemState, sysState );
-    //If NOT in CDMA the Autolock should come up only after the phone has booted up.
-    if ( iFeatureProtocolCdma || IsHiddenReset( ) )
-        {
-        if ( sysState == ESwStateNormalRfOn ||
-             sysState == ESwStateNormalRfOff ||
-             sysState == ESwStateCriticalPhaseOK )
-            {
-            INFO( "CLockAppDevicelockControl::ActivationAllowedL - Locked after Hidden Reset" );
-            ret = ETrue;
-            }
-        }
-    else
-        {
-        if ( sysState == ESwStateNormalRfOn || sysState == ESwStateNormalRfOff )
-            {
-            ret = ETrue;
-            }
-        }
-
-    if ( IsBitFieldSet( iStateControl.EnvironmentStatus( ), KLockAppEnvPhonecallOngoing ) && !TarmAdminFlag(EFalse) )
-        {
-        if ( aReason == EDevicelockRemote )
-            {
-            INFO( "CLockAppDevicelockControl::ActivationAllowedL - remote lock allowed" );
-            ret = ETrue;
-            }
-        }
-    return ret;
-    }
-
-// ---------------------------------------------------------------------------
-// Check weather its allowed to deactivate the control
-// ---------------------------------------------------------------------------
-TBool CLockAppDevicelockControl::DeActivationAllowedL()
-    {
-    if ( iShowingSecCodeQuery )
-        {
-        return ETrue;
-        }
-    else
-        {
-        return EFalse;
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Set the devicelocking reason
-// ---------------------------------------------------------------------------
-void CLockAppDevicelockControl::SetLockingReason( TDevicelockReason aReason )
-    {
-#ifndef RD_REMOTELOCK
-    iPSAutolockState->SetKeyValue( EAutolockOn );
-#else
-    switch ( aReason )
-        {
-        case EDevicelockManual:
-            iPSAutolockState->SetKeyValue( EManualLocked );
-            break;
-        case EDevicelockRemote:
-            iPSAutolockState->SetKeyValue( ERemoteLocked );
-            break;
-        case EDevicelockTimer:
-            iPSAutolockState->SetKeyValue( ETimerLocked );
-            break;
-        default:
-            DoPanic( ELockIllegalState );
-        }
-#endif // RD_REMOTELOCK
-    }
-
-// ---------------------------------------------------------------------------
-// Activate control
-// ---------------------------------------------------------------------------
-void CLockAppDevicelockControl::HandleActivateEventL( TUint aEnvMask )
-    {
-    INFO_1("CLockAppDevicelockControl::HandleActivateEventL - aEnvMask: %d", aEnvMask);
-    
-    CLockAppBaseControl::HandleActivateEventL( aEnvMask );
-
-    if ( IsBitFieldSet( aEnvMask, KLockAppEnvScreenSaverOn ) )
-        {
-        // if screensaver is on - capture primary keys
-        CapturePrimaryKeys( ETrue );
-        }
-    // capture keys
-    CLockAppKeyCaptureController::CaptureKey( EStdKeyApplication0, EKeyApplication0, EKeyCaptureAllEvents ); // App key
-    CLockAppKeyCaptureController::CaptureKey( EStdKeyDevice2, EKeyDevice2, EKeyCaptureAllEvents ); // Power key (for lights)
-    CLockAppKeyCaptureController::CaptureKey( EStdKeyDevice6, EKeyDevice6, EKeyCaptureAllEvents ); // Voice key (for lights)
-    CLockAppKeyCaptureController::CaptureKey( EStdKeyNo, EKeyNo, EKeyCaptureAllEvents ); // End key (for Rosetta lights)
-    CLockAppKeyCaptureController::CaptureKey( EStdKeyDeviceF, EKeyDeviceF, EKeyCaptureAllEvents ); // switch key (for touch devices)
-
-    SetPointerEventCapture( ETrue );
-    SetKeyguardIndicatorStateL( ETrue );
-    iContainer->MakeVisible( ETrue ); // maybe not needed - as its in different windowgroup
-    ShowCba( ETrue );
-    ShowStatusPane( ETrue );
-    // close task-list in case it is displayed : fast-swap window
-    iEikonEnv->DismissTaskList( );
-    iCRAutoLockStatus->SetValue( ETrue );
-    }
-
-// ---------------------------------------------------------------------------
-// DeActivate control
-// ---------------------------------------------------------------------------
-void CLockAppDevicelockControl::HandleDeActivateEventL( TUint aEnvMask )
-    {
-    INFO_1("CLockAppDevicelockControl::HandleDeActivateEventL - aEnvMask: %d", aEnvMask);
-    
-    CLockAppBaseControl::HandleDeActivateEventL( aEnvMask );
-
-    if ( IsBitFieldSet( aEnvMask, KLockAppEnvScreenSaverOn ) )
-        {
-        // if screensaver is on - uncapture primary keys
-        CapturePrimaryKeys( EFalse );
-        }
-
-    // uncapture keys
-    CLockAppKeyCaptureController::ReleaseKey( EStdKeyApplication0 );
-    CLockAppKeyCaptureController::ReleaseKey( EStdKeyDevice2 );
-    CLockAppKeyCaptureController::ReleaseKey( EStdKeyDevice6 );
-    CLockAppKeyCaptureController::ReleaseKey( EStdKeyNo );
-    CLockAppKeyCaptureController::ReleaseKey( EStdKeyDeviceF );
-    
-    SetPointerEventCapture( EFalse );
-    SetKeyguardIndicatorStateL( EFalse );
-    iContainer->MakeVisible( EFalse ); // maybe not needed - as its in different windowgroup
-    ShowCba( EFalse );
-    ShowStatusPane( EFalse );
-    iPSAutolockState->SetKeyValue( EAutolockOff );
-    iCRAutoLockStatus->SetValue( EFalse );
-    }
-
-// ---------------------------------------------------------------------------
-// Handle environment changes (Screensaver, Telephony, etc.)
-// ---------------------------------------------------------------------------
-void CLockAppDevicelockControl::HandleEnvironmentChange( TUint aEnvMask, TUint aEventMask )
-    {
-    INFO_4( "%s %s (%u) aEnvMask=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aEnvMask );
-    INFO_4( "%s %s (%u) aEventMask=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aEventMask );
-
-    if ( IsBitFieldSet( aEventMask, KLockAppEnvScreenSaverOn ) )
-        {
-        // screen saver state changed
-        CapturePrimaryKeys( IsBitFieldSet( aEnvMask, KLockAppEnvScreenSaverOn ) );
-        }
-    if ( IsBitFieldSet( aEventMask, KLockAppEnvFPS ) )
-        {
-        TInt lockValue=0;
-    		iPSAutolockState->GetKeyValue( lockValue );
-    		INFO_4( "%s %s (%u) lockValue=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, lockValue );
-    		if(lockValue>EAutolockOff)	// device is locked and query is not open
-    			{
-    			// indicate to TARM that it should not ask for password
-    			TInt secUiOriginatedQuery(ESecurityUIsSecUIOriginatedUninitialized);
-    			RProperty::Get(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, secUiOriginatedQuery);
-    			INFO_4( "%s %s (%u) secUiOriginatedQuery=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, secUiOriginatedQuery );
-    			RProperty::Set( KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsFpsOriginated );
-
-        	HandleUnlockCommandL( );
-    			RProperty::Set( KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, secUiOriginatedQuery );	// reset to initial
-        	}
-        else												// device needs to be locked. Same happens in keyguard control becasue probably this is never called
-        	iStateControl.EnableDevicelockL( EDevicelockManual );
-        }
-    if ( IsBitFieldSet( aEnvMask, KLockAppEnvGrip ) )
-    	{
-      INFO_4( "%s %s (%u) iShowingSecCodeQuery=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iShowingSecCodeQuery );
-	    if ( IsBitFieldSet( aEventMask, KLockAppEnvGrip ) )	//Grip opened
-	        {
-	        if(iShowingSecCodeQuery==EFalse)
-	        	{
-	        		TInt lockValue=0;
-	        		iPSAutolockState->GetKeyValue( lockValue );
-	        		INFO_4( "%s %s (%u) lockValue=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, lockValue );
-	        		if(lockValue>EAutolockOff)
-	        			{
-				        // ask unlock code by sending the menu key. This works on touch?
-			        	TApaTaskList tasklist( iEikonEnv->WsSession() );
-			        	#define KAknCapServerUid TUid::Uid( 0x10207218 )
-			        	TApaTask capserver = tasklist.FindApp( KAknCapServerUid );
-    						INFO_4( "%s %s (%u) KAknCapServerUid=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, KAknCapServerUid );
-			        	if( capserver.Exists() )
-			        	    {
-	        	        INFO_4( "%s %s (%u) capserver.Exists() EStdKeyDevice0=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, EStdKeyDevice0 );
-			        	    TKeyEvent key;
-			        	    key.iCode = EKeyDevice0;
-			        	    key.iModifiers = 0;
-			        	    key.iRepeats = 0;
-			        	    key.iScanCode = EStdKeyDevice0;
-			        	    capserver.SendKey( key );
-			        	    }
-			        	}
-			       }
-        	}
-			else
-					{
-					if(iShowingSecCodeQuery==EFalse)
-	        	{
-            //the device lock query is on top
-	        	//generate cancel key event
-	        	const TInt KCancelKeyCode( 165 );
-	        	INFO_4( "%s %s (%u) KCancelKeyCode=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, KCancelKeyCode );
-
-	        	TRawEvent rawEvent;
-	        	rawEvent.Set( TRawEvent::EKeyDown, KCancelKeyCode );
-	        	iEikonEnv->WsSession().SimulateRawEvent( rawEvent );        	
-						}
-					}
-			}
-    }
-
-// ---------------------------------------------------------------------------
-// Handle all Central Repository observer callbacks.
-// ---------------------------------------------------------------------------
-void CLockAppDevicelockControl::HandleCenRepNotify(TUid /*aCenRepUid*/, TUint32 aKeyId, TInt aValue )
-    {
-    INFO_4( "%s %s (%u) aKeyId=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aKeyId );
-    INFO_4( "%s %s (%u) aValue=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aValue );
-    switch ( aKeyId )
-        {
-        case KSettingsAutoLockTime:
-            {
-            INFO_1( "CLockAppDevicelockControl::HandleCenRepNotify - KSettingsAutoLockTime = %d", aValue );
-            ResetInactivityTimeout( );
-            }
-            break;
-        default:
-            break;
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Handle all Publish & Subscribe observer callbacks.
-// ---------------------------------------------------------------------------
-void CLockAppDevicelockControl::HandlePubSubNotify(TUid aPubSubUid, TUint aKeyId, TInt aValue )
-    {
-    INFO_4( "%s %s (%u) KPSUidCoreApplicationUIs=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, KPSUidCoreApplicationUIs );
-    INFO_4( "%s %s (%u) aKeyId=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aKeyId );
-    INFO_4( "%s %s (%u) aValue=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aValue );
-    if ( aPubSubUid == KPSUidCoreApplicationUIs )
-        {
-        switch ( aKeyId )
-            {
-            case KCoreAppUIsAutolockStatus:
-                {
-                INFO_1( "CLockAppDevicelockControl::HandlePubSubNotify - KCoreAppUIsAutolockStatus = %d", aValue );
-                // Autolock used to react to this PubSub key - but its unsafe and
-                // in future API will be used, and the key will be published by Lockapp
-                INFO_1( "CLockAppDevicelockControl::HandlePubSubNotify - nothing done. LockApp reacts only to API = %d", aValue );
-                }
-                break;
-            default:
-                break;
-            }
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Devicelock UI key events are handled trough here.
-// ---------------------------------------------------------------------------
-TKeyResponse CLockAppDevicelockControl::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType )
-    {
-    INFO_4( "%s (%u) aKeyEvent.iCode=%x aType=%x", __FILE__, __LINE__, aKeyEvent.iCode, aType );
-    INFO_4( "%s %s (%u) iActive=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iActive );
-    if ( iActive )
-        {
-    		if(AknLayoutUtils::PenEnabled())
-    			{
-    			if(aKeyEvent.iCode == EKeyDeviceF)	// any Type
-    				{
-    				HandleUnlockCommandL( );
-    				}
-    			}
-        if ( aType == EEventKeyDown )
-            {
-            if ( !iShowingSecCodeQuery )
-                {
-                switch ( iKeyPattern->HandleKeyEvent( aKeyEvent.iScanCode ) )
-                    {
-                    case EPatternPrimaryMatch:
-                        HandleUnlockCommandL( );
-                        break;
-                    default:
-                        break;
-                    }
-                }
-            }
-        }
-    return EKeyWasConsumed;
-    }
-
-// ---------------------------------------------------------------------------
-// Handle unlock command
-// ---------------------------------------------------------------------------
-void CLockAppDevicelockControl::HandleUnlockCommandL( )
-    {
-    INFO( "CLockAppDevicelockControl::HandleUnlockCommandL" );
-    // inform sysap to put lights on left soft key press
-    SendMessageToSysAp( EEikKeyLockLightsOnRequest );
-		INFO_4( "%s %s (%u) iPhoneInitialized=%x -> 10 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPhoneInitialized );
-		iPhoneInitialized=10;
-    CSecurityHandler* handler = new (ELeave) CSecurityHandler( iPhone );
-		INFO_4( "%s %s (%u) got handler=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 );
-    CleanupStack::PushL( handler );
-    TSecUi::InitializeLibL( );
-		INFO_4( "%s %s (%u) got TSecUi::InitializeLibL=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 );
-    iShowingSecCodeQuery = ETrue;
-    TRAPD(err, {
-								INFO_4( "%s %s (%u) before AskSecCodeInAutoLockL=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 );
-                TBool ret = handler->AskSecCodeInAutoLockL();
-								INFO_4( "%s %s (%u) after AskSecCodeInAutoLockL=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, ret );
-                INFO_1( "CLockAppDevicelockControl::HandleUnlockCommandL - AskSecCodeInAutoLockL = %d", ret );
-                if ( ret )
-                    {
-                    iStateControl.DisableDevicelockL();
-                    }
-                })
-    ERROR(err, "CLockAppDevicelockControl::HandleUnlockCommandL - AskSecCodeInAutoLockL");
-    iShowingSecCodeQuery = EFalse;
-    TSecUi::UnInitializeLib( );
-    CleanupStack::PopAndDestroy( handler );
-    }
-
-// ---------------------------------------------------------------------------
-// Get autolock timeout (in seconds)
-// ---------------------------------------------------------------------------
-TInt CLockAppDevicelockControl::GetAutoLockTimeout( )
-    {
-    TInt timeoutInMinutes = 0;
-    iCRAutoLockTime->GetValue( timeoutInMinutes );
-    return timeoutInMinutes * 60;
-    }
-
-// ----------------------------------------------------------
-// Starts monitoring user activity
-// ----------------------------------------------------------
-void CLockAppDevicelockControl::StartActivityMonitoringL( )
-    {
-    __ASSERT_DEBUG( iActivityManager, DoPanic(ELockIllegalState));
-    if ( iActivityManager && !iActivityManager->IsActive() )
-        {
-        TInt value = GetAutoLockTimeout( );
-        INFO_1( "CLockAppDevicelockControl::StartActivityMonitoringL - %d sec", value);
-        if ( value )
-            {
-            iActivityManager->Start( value,
-                    TCallBack( HandleInactiveEventL, this ),
-                    TCallBack( HandleActiveEventL, this ) );
-            }
-        else
-            {
-            iActivityManager->Start( KAutoDeviceLockOff,
-                    TCallBack(HandleInactiveEventL, this ),
-                    TCallBack(HandleActiveEventL, this ) );
-            }
-        }
-    }
-
-// ----------------------------------------------------------
-// Gets autolock period and starts monitoring user activity
-// ----------------------------------------------------------
-void CLockAppDevicelockControl::ResetInactivityTimeout( )
-    {
-    __ASSERT_DEBUG( iActivityManager, DoPanic(ELockIllegalState));
-    if ( iActivityManager )
-        {
-        TInt value = GetAutoLockTimeout( );
-        INFO_1( "CLockAppDevicelockControl::ResetInactivityTimeout - %d sec", value);
-        if ( value )
-            {
-            iActivityManager->SetInactivityTimeout( value );
-            }
-        else
-            {
-            iActivityManager->SetInactivityTimeout( KAutoDeviceLockOff );
-            }
-        }
-    }
-
-// ----------------------------------------------------------
-// Stop monitoring user activity.
-// ----------------------------------------------------------
-void CLockAppDevicelockControl::StopActivityMonitoring( )
-    {
-    __ASSERT_DEBUG( iActivityManager, DoPanic(ELockIllegalState));
-    if ( iActivityManager )
-        {
-        iActivityManager->Cancel( );
-        }
-    }
-
-// ----------------------------------------------------------
-// Handle Active event. Called by ActivityManager
-// ----------------------------------------------------------
-TInt CLockAppDevicelockControl::HandleActiveEventL(TAny* /*aPtr*/)
-    {
-    return KErrNone;
-    }
-
-// ----------------------------------------------------------
-// Handles InActive event. Called by ActivityManager
-// ----------------------------------------------------------
-TInt CLockAppDevicelockControl::HandleInactiveEventL(TAny* aPtr )
-    {
-    CLockAppDevicelockControl* devicelock = STATIC_CAST(CLockAppDevicelockControl*, aPtr);
-    if ( devicelock->GetAutoLockTimeout( ) )
-        {
-        devicelock->iStateControl.EnableDevicelockL( EDevicelockTimer );
-        }
-    return KErrNone;
-    }
-
-// ---------------------------------------------------------------------------
-// Set custom status pane visible
-// ---------------------------------------------------------------------------
-void CLockAppDevicelockControl::ShowStatusPane( const TBool aVisible )
-    {
-    CEikStatusPane* statuspane = iAvkonAppUi->StatusPane();
-    if ( statuspane )
-        {
-        statuspane->MakeVisible( aVisible );
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Handle UI commands received from the child controls
-// ---------------------------------------------------------------------------
-void CLockAppDevicelockControl::ProcessCommandL(TInt aCommandId)
-    {
-    INFO_1("CLockAppDevicelockControl::ProcessCommandL : %d ", aCommandId );
-    }
-
-TInt CLockAppDevicelockControl::CountComponentControls() const
-    {
-    return 2;
-    }
-
-CCoeControl* CLockAppDevicelockControl::ComponentControl(TInt aIndex ) const
-    {
-    switch ( aIndex )
-        {
-        case 0:
-            return iCba;
-        case 1:
-            return iContainer;
-        default:
-            return NULL;
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Notification if layout changes.
-// ---------------------------------------------------------------------------
-void CLockAppDevicelockControl::HandleResourceChange(TInt aType )
-    {
-    if ( aType == KEikDynamicLayoutVariantSwitch && iCba )
-        {
-        TRect screenRect;
-        AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screenRect );
-        iCba->SetBoundingRect( screenRect );
-        }
-    CCoeControl::HandleResourceChange( aType );
-    }
-
-// END OF FILE
--- a/securitydialogs/lockapp/src/lockappdocument.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +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:  LockApp application document class
- *
-*/
-
-
-#include "lockappappui.h"
-#include "lockappdocument.h"
-
-// ---------------------------------------------------------------------------
-// Standard Symbian OS construction sequence
-// ---------------------------------------------------------------------------
-CLockAppDocument* CLockAppDocument::NewL(CEikApplication& aApp)
-    {
-    CLockAppDocument* self = NewLC(aApp);
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-// Standard Symbian OS construction sequence
-// ---------------------------------------------------------------------------
-CLockAppDocument* CLockAppDocument::NewLC(CEikApplication& aApp)
-    {
-    CLockAppDocument* self = new (ELeave) CLockAppDocument(aApp);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    return self;
-    }
-
-CLockAppDocument::~CLockAppDocument()
-    {
-    // no implementation required
-    }
-
-// ---------------------------------------------------------------------------
-//  Create the application user interface, and return a pointer to it,
-//  The framework takes ownership of this object.
-// ---------------------------------------------------------------------------
-CEikAppUi* CLockAppDocument::CreateAppUiL()
-    {
-    CEikAppUi* appUi = new (ELeave) CLockAppAppUi;
-    return appUi;
-    }
-
-void CLockAppDocument::ConstructL()
-    {
-    // no implementation required
-    }
-
-CLockAppDocument::CLockAppDocument( CEikApplication& aApp ) :
-	CAknDocument(aApp)
-	{
-	// no implementation required
-	}
--- a/securitydialogs/lockapp/src/lockappecsdetector.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,159 +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:  Provides emergency call support for keyguard/devicelock
- *
-*/
-
-
-#include "lockappecsdetector.h"
-#include "lockappecsnote.h"
-#include "lockapputils.h"
-#include <aknappui.h>
-#include <avkon.rsg>
-
-// ---------------------------------------------------------------------------
-// Standard Symbian OS construction sequence
-// ---------------------------------------------------------------------------
-CLockAppEcsDetector* CLockAppEcsDetector::NewL( )
-    {
-    CLockAppEcsDetector* self = new (ELeave) CLockAppEcsDetector();
-    CleanupStack::PushL( self );
-    self->ConstructL( );
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-// Standard C++ constructor
-// ---------------------------------------------------------------------------
-CLockAppEcsDetector::CLockAppEcsDetector( )
-    {
-    }
-
-// ---------------------------------------------------------------------------
-// Constructs the emergency detector and the note.
-// ---------------------------------------------------------------------------
-void CLockAppEcsDetector::ConstructL( )
-    {
-    // emergency call support
-    iEcsDetector = CAknEcsDetector::NewL( );
-    iEcsDetector->SetObserver( this );
-
-    // emergency call note
-    iEcsNote = new (ELeave) CLockAppEcsNote();
-    iEcsNote->ConstructSleepingNoteL( R_AVKON_EMERGENCY_CALL_NOTE );
-    iEcsNote->ButtonGroupContainer().ButtonGroup()->AsControl()->DrawableWindow()->SetOrdinalPosition( 0, 2 );
-
-    // needs to be called for ecs detector to work/receive events.
-    iAvkonAppUi->EventMonitor()->Enable( ETrue );
-    }
-
-// ---------------------------------------------------------------------------
-// Destructor.
-// ---------------------------------------------------------------------------
-CLockAppEcsDetector::~CLockAppEcsDetector( )
-    {
-    delete iEcsDetector;
-    delete iEcsNote;
-    }
-
-// ---------------------------------------------------------------------------
-// Detector starts/stops listening to key events if keys are locked/unlocked.
-// The detector key event queue is always reseted when lock status is changed.
-// ---------------------------------------------------------------------------
-void CLockAppEcsDetector::HandleLockStatusChangedL( TLockStatus aLockStatus )
-    {
-    iEcsDetector->Reset( );
-    switch ( aLockStatus )
-        {
-        case ELockNotActive:
-            {
-            iEcsDetector->CloseEventSource( );
-            }
-            break;
-        case EKeyguardActive:
-        case EDevicelockActive:
-            {
-            iEcsDetector->ConnectToEventSource( );
-            }
-            break;
-        default:
-            DoPanic( ELockUnknownValue );
-            break;
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// The main state controller needs to know if emergency call note is
-// on the screen.
-// ---------------------------------------------------------------------------
-TBool CLockAppEcsDetector::EcsNoteOnScreen( ) const
-    {
-    return iEcsNote->iNoteOnScreen;
-    }
-
-// ---------------------------------------------------------------------------
-// From @c MAknEcsObserver.. Handles changes in emergency the emergency number
-// queue (i.e. if the user has dialed emergency numbers or not).
-// ---------------------------------------------------------------------------
-void CLockAppEcsDetector::HandleEcsEvent( CAknEcsDetector* aEcsDetector,
-        CAknEcsDetector::TState aState )
-    {
-    switch ( aState )
-        {
-        case CAknEcsDetector::ECompleteMatchThenSendKey:
-            // Do nothing since note will be removed on ECallAttempted event
-            break;
-            // user has successfully dialed emergency numbers
-        case CAknEcsDetector::ECompleteMatch:
-            iEcsNote->SetEmergencyNumber( aEcsDetector->CurrentMatch( ) );
-            // Tell sysAp to switch lights on
-            SendMessageToSysAp( EEikEcsQueryLights );
-            iEcsNote->ShowNote( );
-            break;
-        case CAknEcsDetector::EPartialMatch:
-            iEcsNote->SleepNote( );
-            break;
-        case CAknEcsDetector::ECallAttempted:
-            iEcsNote->SleepNote( );
-            break;
-        case CAknEcsDetector::EEmpty:
-            iEcsNote->SleepNote( );
-            break;
-        case CAknEcsDetector::ENoMatch:
-            iEcsNote->SleepNote( );
-            break;
-        default:
-            break;
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Tests the emergency note ui. Only used for testing purposes,
-// Created, because emergency detector does not work in emulator.
-// ---------------------------------------------------------------------------
-TInt CLockAppEcsDetector::TestEcsNote( )
-    {
-#ifdef _DEBUG
-    HandleEcsEvent( iEcsDetector, CAknEcsDetector::EEmpty );
-    HandleEcsEvent( iEcsDetector, CAknEcsDetector::ENoMatch );
-    HandleEcsEvent( iEcsDetector, CAknEcsDetector::EPartialMatch );
-    HandleEcsEvent( iEcsDetector, CAknEcsDetector::ECompleteMatch );
-    _LIT( NText, "112Test");
-    iEcsNote->SetEmergencyNumber( NText );
-    SendMessageToSysAp( EEikEcsQueryLights );
-    iEcsNote->ShowNote( );
-#endif
-    return KErrNone;
-    }
--- a/securitydialogs/lockapp/src/lockappecsnote.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,157 +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:  Emergency number dialog
- *
-*/
-
-
-#include "lockappecsnote.h"
-#include "lockapputils.h"
-#include <AknUtils.h>
-#include <aknlayoutscalable_avkon.cdl.h>
-#include <aknappui.h>
-#include <AknEcs.h> // for KAknEcsMaxMatchingLength
-
-#include <aknglobalpopupprioritycontroller.h>
-#include <GlobalWindowPriorities.h>
-
-// ---------------------------------------------------------------------------
-// Standard C++ constructor
-// ---------------------------------------------------------------------------
-CLockAppEcsNote::CLockAppEcsNote( ) :
-	iNoteOnScreen(EFalse)
-	{
-	// no implementation required
-	}
-
-// ---------------------------------------------------------------------------
-// Destructor.
-// ---------------------------------------------------------------------------
-CLockAppEcsNote::~CLockAppEcsNote( )
-    {
-#ifdef _GLOBAL_PRIORITY_SUPPORTED
-    AknGlobalPopupPriorityController::RemovePopupPriority(*this);
-#endif
-    }
-
-// ---------------------------------------------------------------------------
-// Emergency note is a sleeping note
-// ---------------------------------------------------------------------------
-void CLockAppEcsNote::ConstructSleepingNoteL(TInt aResourceId )
-    {
-    CAknNoteDialog::ConstructSleepingDialogL( aResourceId );
-#ifdef _GLOBAL_PRIORITY_SUPPORTED
-    // global ui component order is handled trhoug global popup priority controller
-    AknGlobalPopupPriorityController::SetPopupPriorityL( *this, KGlobalWindowPriority_KeyLock );
-#endif
-    }
-
-// ---------------------------------------------------------------------------
-// Show note with time out.
-// ---------------------------------------------------------------------------
-TInt CLockAppEcsNote::ShowNote( )
-    {
-    ReportUserActivity( );
-    iTimeoutInMicroseconds = CAknNoteDialog::EUndefinedTimeout;
-    iTone = CAknNoteDialog::ENoTone;
-    TInt error = KErrNone;
-    if ( !iNoteOnScreen )
-        {
-        error = RouseSleepingDialog( );
-        }
-    iNoteOnScreen = ETrue;
-    // return value not used
-    return error;
-    }
-
-// ---------------------------------------------------------------------------
-// Hide note from screen.
-// ---------------------------------------------------------------------------
-void CLockAppEcsNote::SleepNote( )
-    {
-    if ( iNoteOnScreen )
-        {
-        ExitSleepingDialog( ); // Causes flicker to other notes if called when note is not on screen
-        }
-    iNoteOnScreen = EFalse;
-    }
-
-// ---------------------------------------------------------------------------
-// Emergency dialog consumes all key events it receives.
-// ---------------------------------------------------------------------------
-TKeyResponse CLockAppEcsNote::OfferKeyEventL(const TKeyEvent& /*aKeyEvent*/, TEventCode /*aType*/)
-    {
-    return EKeyWasConsumed;
-    }
-
-// ---------------------------------------------------------------------------
-// Format the emergency number for the dialog text.
-// ---------------------------------------------------------------------------
-void CLockAppEcsNote::SetEmergencyNumber( const TDesC& aMatchedNumber )
-    {
-    TRect mainPaneRect;
-    AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPaneRect );
-    TAknLayoutRect popupNoteWindow;
-    AknLayoutUtils::TAknCbaLocation cbaLocation( AknLayoutUtils::CbaLocation( ));
-    TInt variety( 0);
-    if ( cbaLocation == AknLayoutUtils::EAknCbaLocationRight )
-        {
-        variety = 5;
-        }
-    else
-        if ( cbaLocation == AknLayoutUtils::EAknCbaLocationLeft )
-            {
-            variety = 8;
-            }
-        else
-            {
-            variety = 2;
-            }
-
-    popupNoteWindow.LayoutRect( mainPaneRect, AknLayoutScalable_Avkon::popup_note_window( variety ) );
-    TAknLayoutText textRect;
-    textRect.LayoutText( popupNoteWindow.Rect( ), AknLayoutScalable_Avkon::popup_note_window_t5(2).LayoutLine( ) );
-
-    // Size of a temporary buffer that contains new lines, spaces and
-    // emergency number for a note.
-    TBuf16<KAknEcsMaxMatchingLength+80> number;
-    number.Append( '\n' );
-    number.Append( '\n' );
-
-    TInt spaceCharWidthInPixels = textRect.Font()->CharWidthInPixels( ' ' );
-    if ( spaceCharWidthInPixels < 1 )
-        {
-        // Avoid divide by zero situation even the space char would have zero length.
-        spaceCharWidthInPixels = 1;
-        }
-
-    TInt length = (textRect.TextRect().Width() - textRect.Font()->TextWidthInPixels(aMatchedNumber))/ spaceCharWidthInPixels;
-
-    const TInt matchedNumberLength = aMatchedNumber.Length( );
-    const TInt numberLength = number.Length( );
-    const TInt numberMaxLength = number.MaxLength( );
-
-    if ( numberLength + length + matchedNumberLength > numberMaxLength )
-        {
-        // To make sure that buffer overflow does not happen.
-        length = numberMaxLength - numberLength - matchedNumberLength;
-        }
-    for (int i = 0; i < length; i++ )
-        {
-        number.Append( ' ' );
-        }
-
-    number.Append( aMatchedNumber );
-    TRAP_IGNORE(SetTextL(number));
-    }
--- a/securitydialogs/lockapp/src/lockappidlecontrol.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,223 +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:  Idle (unlocked) UI
- *
-*/
-
-
-#include "lockappidlecontrol.h"
-#include "lockappstatecontrolinterface.h"
-#include "lockapputils.h"
-#include "lockapplockednote.h" // keyguard notes
-#include "lockappkeycapturecontroller.h"
-
-#include <avkon.rsg> // general avkon resources
-
-#include <aknnotpi.rsg> // keyguard spesific resources
-
-#include <featmgr.h> // feature manager
-
-// from keyguard ui spesification, 6 sec.
-const TInt KAknOfferKeyguardTimeout = 6000000;
-
-// Asterisk key code for the keylock
-const TUint KStdKeyAsterisk = 42;
-//const TUint KAknChineseAsterisk = 0xFF0A;
-
-// ---------------------------------------------------------------------------
-// Standard Symbian OS construction sequence
-// ---------------------------------------------------------------------------
-CLockAppIdleControl* CLockAppIdleControl::NewL(MLockAppStateControl& aStateControl )
-    {
-    CLockAppIdleControl* self = new (ELeave) CLockAppIdleControl( aStateControl );
-    CleanupStack::PushL( self );
-    self->ConstructL( );
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-// Constructor passes the reference of the main state control.
-// ---------------------------------------------------------------------------
-CLockAppIdleControl::CLockAppIdleControl( MLockAppStateControl& aStateControl ) :
-    CLockAppBaseControl( aStateControl )
-    {
-    }
-
-// ---------------------------------------------------------------------------
-// Destructor.
-// ---------------------------------------------------------------------------
-CLockAppIdleControl::~CLockAppIdleControl( )
-    {
-    delete iOfferLockNote;
-    }
-
-// ---------------------------------------------------------------------------
-// Idle UI constructor reserves localized resources, configures itself
-// using CenRep and FeatureManager and reserves child controls.
-// ---------------------------------------------------------------------------
-void CLockAppIdleControl::ConstructL( )
-    {
-    INFO( "CLockAppIdleControl::ConstructL started" );
-    CLockAppBaseControl::ConstructL( );
-
-    iOfferLockNote = new (ELeave) CLockAppLockedNote(this);
-    iOfferLockNote->ConstructSleepingNoteL( R_KEYLOCK_OFFER_LOCK_NOTE );
-    iOfferLockNote->ButtonGroupContainer().ButtonGroup()->AsControl()->DrawableWindow()->SetOrdinalPosition( 0, 2 );
-    
-    // Setup key pattern matcher
-    if ( !SetupKeyPatternsWithPolicyL( EPolicyActivateKeyguard ) )
-        {
-        INFO( "CLockAppIdleControl::ConstructL - No CenRep policy defined" );
-        iKeyPattern->AddPattern( EStdKeyDevice0, KStdKeyAsterisk ); // LSK + *
-        }
-#ifdef __WINS__
-    iKeyPattern->AddPattern( EStdKeyDevice0, EStdKeyNkpAsterisk ); // LSK + *
-#endif
-                                                                                                                                                                                                           
-    INFO( "CLockAppIdleControl::ConstructL completed" );
-    }
-
-// ---------------------------------------------------------------------------
-// Offers keylock.
-// ---------------------------------------------------------------------------
-void CLockAppIdleControl::OfferKeyLock( )
-    {
-    ShowNote( iOfferLockNote, (CAknNoteDialog::TTimeout)KAknOfferKeyguardTimeout, CAknNoteDialog::ENoTone );
-    }
-
-// ---------------------------------------------------------------------------
-// Cancels offering keylock.
-// ---------------------------------------------------------------------------
-void CLockAppIdleControl::CancelOfferKeyLock( )
-    {
-    CancelNote( );
-    }
-
-// ---------------------------------------------------------------------------
-// Activate control
-// ---------------------------------------------------------------------------
-void CLockAppIdleControl::HandleActivateEventL( TUint aEnvMask )
-    {  
-		RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-    CLockAppBaseControl::HandleActivateEventL( aEnvMask );
-    }
-
-// ---------------------------------------------------------------------------
-// DeActivate control
-// ---------------------------------------------------------------------------
-void CLockAppIdleControl::HandleDeActivateEventL( TUint aEnvMask )
-    {
-    CLockAppBaseControl::HandleDeActivateEventL( aEnvMask );
-    CancelOfferKeyLock( );
-    }
-
-// ---------------------------------------------------------------------------
-// Idle UI key events are handled trough here.
-// ---------------------------------------------------------------------------
-TKeyResponse CLockAppIdleControl::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode /*aType*/ )
-    {
-		RDebug::Printf( "%s %s (%u) aKeyEvent.iCode=%x 1=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aKeyEvent.iCode, 1 );
-    TKeyResponse keyResponse = EKeyWasNotConsumed;
-    if ( iActive )
-        {
-        if ( iOfferLockNote->IsVisible( ) )
-            {
-            // if keylock has been offered
-            switch ( aKeyEvent.iCode )
-                {
-                case EKeyOK:
-                    iStateControl.EnableKeyguardL( ETrue );
-                    keyResponse = EKeyWasConsumed;
-                    break;
-                case EKeyLeftArrow:
-                case EKeyRightArrow:
-                case EKeyUpArrow:
-                case EKeyDownArrow:
-                case EKeyApplication:
-                    keyResponse = EKeyWasConsumed;
-                    break;
-                default:
-                    break;
-                }
-            }
-        else
-            {
-            // keys pressed normally in idle - however keys are not captured
-            // this is where locking policy could be monitored to check keyguard activation
-            /*if ( aType == EEventKeyDown )
-                {
-                switch ( iKeyPattern->HandleKeyEvent( aKeyEvent.iScanCode ) )
-                    {
-                    case EPatternNoMatch:
-                    case EPatternPrimaryMatch:
-                        break;
-                    case EPatternSecondaryMatch:
-                        iStateControl.EnableKeyguardL( ETrue );
-                        keyResponse = EKeyWasConsumed;
-                        break;
-                    default:
-                        break;
-                    }
-                }
-            */
-            }
-        }
-    return keyResponse;
-    }
-
-// ---------------------------------------------------------------------------
-// Handle UI commands received from the child controls
-// ---------------------------------------------------------------------------
-void CLockAppIdleControl::ProcessCommandL(TInt aCommandId )
-    {
-    // handle command
-		RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-    switch ( aCommandId )
-        {
-        case EAknSoftkeyLock:
-            {
-            // user has accepted offer keyguard enquiry - lock keys
-            iStateControl.EnableKeyguardL( ETrue );
-            }
-            break;
-        case EAknSoftkeyExit:
-        case KNoteCmdFocusLost:
-            {
-            // user has declined offer keyguard enquiry -  cancel offer
-            CancelOfferKeyLock( );
-            }
-            break;
-        default:
-            break;
-        }
-    }
-
-TInt CLockAppIdleControl::CountComponentControls( ) const
-    {
-    return 0;
-    }
-
-CCoeControl* CLockAppIdleControl::ComponentControl(TInt /*aIndex*/) const
-    {
-    return NULL;
-    }
-
-// ---------------------------------------------------------------------------
-// Notification if layout changes.
-// ---------------------------------------------------------------------------
-void CLockAppIdleControl::HandleResourceChange(TInt aType )
-    {
-    CCoeControl::HandleResourceChange( aType );
-    }
--- a/securitydialogs/lockapp/src/lockappkeycapturecontroller.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,224 +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:  Key capture utility
- *
-*/
-
-
-// INCLUDE FILES
-#include "lockappkeycapturecontroller.h"
-#include <w32std.h>
-
-// ================= STATIC MEMBERS =========================
-
-CLockAppKeyCaptureController* CLockAppKeyCaptureController::instance = NULL;
-
-
-// ================= STATIC FUNCTIONS =======================
-
-// ---------------------------------------------------------
-// Initializes the key capture utility by creating an instance of it
-// ---------------------------------------------------------
-CLockAppKeyCaptureController* CLockAppKeyCaptureController::InitL( RWindowGroup& aWindowGroup )
-    {
-    if ( !instance )
-        {
-        instance = new ( ELeave ) CLockAppKeyCaptureController( aWindowGroup );
-        }
-    return instance;
-    }
-
-// ---------------------------------------------------------
-// Destroys the key capture utility's instance
-// ---------------------------------------------------------
-void CLockAppKeyCaptureController::Destroy( )
-    {
-    if ( instance )
-        {
-        delete instance;
-        instance = NULL;
-        }
-    }
-
-// ---------------------------------------------------------
-// Capture a key
-// ---------------------------------------------------------
-void CLockAppKeyCaptureController::CaptureKey( TUint32 aKey, TUint32 aKeyCode, TPhoneKeyCaptureType aType )
-    {
-    	RDebug::Printf( "%s %s (%u) aKey=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aKey );
-    	RDebug::Printf( "%s %s (%u) aKeyCode=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aKeyCode );
-    	RDebug::Printf( "%s %s (%u) aType=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aType );
-
-    if ( instance )
-        {
-        instance->StartCapturingKey( aKey, aKeyCode, aType );
-        }
-    }
-
-// ---------------------------------------------------------
-// Release a key (previously captured)
-// ---------------------------------------------------------
-void CLockAppKeyCaptureController::ReleaseKey( TUint32 aKey )
-    {
-    	RDebug::Printf( "%s %s (%u) aKey=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aKey );
-
-    if ( instance )
-        {
-        instance->StopCapturingKey( aKey );
-        }
-    }
-
-// ================= INSTANCE FUNCTIONS ============================
-
-// ---------------------------------------------------------
-// Private default constructor
-// ---------------------------------------------------------
-CLockAppKeyCaptureController::CLockAppKeyCaptureController( RWindowGroup& aWindowGroup ) :
-    iWindowGroup( aWindowGroup)
-    {
-    }
-
-// ---------------------------------------------------------
-// Private destructor
-// ---------------------------------------------------------
-CLockAppKeyCaptureController::~CLockAppKeyCaptureController( )
-    {
-    	RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-
-    // should we have any captured keys, stop capturing now
-    TInt capturedKeyCount = iCapturedKeys.Count( );
-    for (TInt i = 0; i < capturedKeyCount; i++ )
-        {
-        StopKeyCapture( iCapturedKeys[i] );
-        }
-    iCapturedKeys.Close( );
-    }
-
-// ---------------------------------------------------------
-// Starts capturing a key
-// ---------------------------------------------------------
-void CLockAppKeyCaptureController::StartCapturingKey( TUint32 aKey, TUint32 aKeyCode, TPhoneKeyCaptureType aType )
-    {
-    TInt32 handle = KErrNotFound;
-		RDebug::Printf( "%s %s (%u) aKey=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aKey );
-		RDebug::Printf( "%s %s (%u) aKeyCode=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aKeyCode );
-		RDebug::Printf( "%s %s (%u) aType=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aType );
-
-    if ( !IsKeyCaptured( aKey ) )
-        {
-        TPhoneKeyCapture keyCapture;
-        keyCapture.iKey = (TStdScanCode) aKey;
-        keyCapture.iKeyCode = (TKeyCode) aKeyCode;
-        keyCapture.iHandle = 0; // set as initial value
-        keyCapture.iHandleForUpAndDown = 0; // set as initial value
-
-        switch( aType )
-            {
-            case EKeyCaptureEvent:
-                keyCapture.iType = EKeyCaptureEvent;
-                keyCapture.iHandle = iWindowGroup.CaptureKey( keyCapture.iKeyCode, 0, 0 );
-                handle = keyCapture.iHandle;
-                break;
-            case EKeyCaptureUpAndDownEvents:
-                keyCapture.iType = EKeyCaptureUpAndDownEvents;
-                keyCapture.iHandleForUpAndDown = iWindowGroup.CaptureKeyUpAndDowns( keyCapture.iKey, 0, 0 );
-                handle = keyCapture.iHandleForUpAndDown;
-                break;
-            default: // EKeyCaptureAllEvents
-                {
-                keyCapture.iType = EKeyCaptureAllEvents;
-                keyCapture.iHandle = iWindowGroup.CaptureKey( keyCapture.iKeyCode, 0, 0 );
-                if ( keyCapture.iHandle >= 0 )
-                    {
-                    keyCapture.iHandleForUpAndDown = iWindowGroup.CaptureKeyUpAndDowns( keyCapture.iKey, 0, 0 );
-                    if ( keyCapture.iHandleForUpAndDown < 0 )
-                        {
-                        iWindowGroup.CancelCaptureKey( keyCapture.iHandle );
-                        }
-                    handle = keyCapture.iHandleForUpAndDown;
-                    }
-                break;
-                }
-            }
-
-        RDebug::Printf( "CLockAppKeyCaptureController::StartCapturingKey - handle: 0x%08x", handle );
-
-        if ( handle >= 0 )
-            {
-            if ( iCapturedKeys.Append( keyCapture )!= KErrNone )
-                {
-                StopKeyCapture( keyCapture );
-                }
-            }
-        }
-    }
-
-// ---------------------------------------------------------
-// Stops capturing a key
-// ---------------------------------------------------------
-void CLockAppKeyCaptureController::StopCapturingKey( TUint32 aKey )
-    {
-		RDebug::Printf( "%s %s (%u) aKey=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aKey );
-    const TInt capturedKeyCount = iCapturedKeys.Count( );
-    TBool foundKey = EFalse;
-    for (TInt i = 0; ( i < capturedKeyCount ) && !foundKey; i++ )
-        {
-        if ( iCapturedKeys[i].iKey == aKey )
-            {
-            foundKey = ETrue;
-            StopKeyCapture( iCapturedKeys[i] );
-            iCapturedKeys.Remove( i );
-            }
-        }
-    }
-
-// ---------------------------------------------------------
-// May be used to ask whether a key has been set to be captured
-// ---------------------------------------------------------
-TBool CLockAppKeyCaptureController::IsKeyCaptured( TUint32 aKey ) const
-    {
-		RDebug::Printf( "%s %s (%u) aKey=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aKey );
-    const TInt capturedKeyCount = iCapturedKeys.Count( );
-    TBool isCaptured = EFalse;
-    for (TInt i = 0; ( i < capturedKeyCount ) && !isCaptured; i++ )
-        {
-        isCaptured = iCapturedKeys[i].iKey == aKey;
-        }
-    return isCaptured;
-    }
-
-// ---------------------------------------------------------
-// Stops capturing a key
-// ---------------------------------------------------------
-void CLockAppKeyCaptureController::StopKeyCapture( TPhoneKeyCapture aKeyCapture )
-    {
-		RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-    switch ( aKeyCapture.iType )
-        {
-        case EKeyCaptureEvent:
-            iWindowGroup.CancelCaptureKey( aKeyCapture.iHandle );
-            break;
-        case EKeyCaptureUpAndDownEvents:
-            iWindowGroup.CancelCaptureKeyUpAndDowns( aKeyCapture.iHandleForUpAndDown );
-            break;
-        default: // EPhoneKeyCaptureAllEvents
-            {
-            iWindowGroup.CancelCaptureKey( aKeyCapture.iHandle );
-            iWindowGroup.CancelCaptureKeyUpAndDowns( aKeyCapture.iHandleForUpAndDown );
-            break;
-            }
-        }
-    }
-
-// end of file
--- a/securitydialogs/lockapp/src/lockappkeyguardcontrol.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,695 +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:  Keyguard UI
- *
-*/
-
-
-#include "lockappkeyguardcontrol.h"
-#include "lockappstatecontrolinterface.h"
-#include "lockappcenrepobserver.h"
-#include "lockapppubsubobserver.h"
-#include "lockapputils.h"
-#include "lockapplockednote.h" // keyguard notes
-#include "lockappkeycapturecontroller.h"
-
-#include <avkon.rsg> // general avkon resources
-#include <aknnotpi.rsg> // keyguard spesific resources
-#include <AknUtils.h>
-#include <activitymanager.h>
-// this is not needed
-// #include <SecondaryDisplay/AknSecondaryDisplayDefs.h> // publishing keyguard notes to secondary display
-#include <featmgr.h> // feature manager
-#include <eikcba.h> // keyguard soft buttons
-#include <eikspane.h>
-
-#include "AutolockPrivateCRKeys.h"
-#include <settingsinternalcrkeys.h>
-#include <ScreensaverInternalPSKeys.h>
-#include <hwrmdomainpskeys.h>
-#include <activeidle2domainpskeys.h>
-//#include <CoreApplicationUIsPrivateCRKeys.h> TODO remove
-#include <coreapplicationuisdomainpskeys.h>
-#include <ctsydomainpskeys.h>
-#include <startupdomainpskeys.h>
-
-// Asterisk key's scan code for the keylock
-const TUint KStdKeyAsterisk = 42;
-//const TUint KAknChineseAsterisk = 0xFF0A;
-
-// timeout defined in keyguard ui specification custom value
-// since avkon note TTimeout values don't support 1 second timeout
-const TInt KKeyLockCustomShortTimeout = 1000000;
-
-// Auto Keyguard Off value
-const TInt KAutoKeyguardOff( 60000 );
-
-// Flip open value
-const TInt KFlipOpen = 1;
-
-// Screensaver started fron idle status value
-const TInt KSsStartedFromIdle = 1;
-
-// ---------------------------------------------------------------------------
-// Standard Symbian OS construction sequence
-// ---------------------------------------------------------------------------
-CLockAppKeyguardControl* CLockAppKeyguardControl::NewL(MLockAppStateControl& aStateControl )
-    {
-    CLockAppKeyguardControl* self = new (ELeave) CLockAppKeyguardControl( aStateControl );
-    CleanupStack::PushL( self );
-    self->ConstructL( );
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-// Notes, cba and localized resources are freed in Keyguard UI destruction.
-// ---------------------------------------------------------------------------
-CLockAppKeyguardControl::~CLockAppKeyguardControl( )
-    {
-#ifdef RD_AUTO_KEYGUARD
-    if ( iActivityManager )
-        {
-        iActivityManager->Cancel( );
-        delete iActivityManager;
-        iActivityManager = NULL;
-        }
-    // CenRep observers
-    if ( iCRAutoKeyguardTime )
-        {
-        delete iCRAutoKeyguardTime;
-        iCRAutoKeyguardTime = NULL;
-        }
-#endif //RD_AUTO_KEYGUARD
-    if ( iCRPersistentKeyguardStatus )
-        {
-        delete iCRPersistentKeyguardStatus;
-        iCRPersistentKeyguardStatus = NULL;
-        }
-    if ( iPSStartupObserver )
-        {
-        delete iPSStartupObserver;
-        iPSStartupObserver = NULL;
-        }
-    // child notes
-    delete iConfirmationNote;
-    delete iLockedNote;
-    delete iKeypadUnlockedNote;
-    delete iKeypadLockedNote;
-    }
-
-// ---------------------------------------------------------------------------
-// Constructor passes the reference to the main state control.
-// ---------------------------------------------------------------------------
-CLockAppKeyguardControl::CLockAppKeyguardControl(MLockAppStateControl& aStateControl ) :
-    CLockAppBaseControl(aStateControl)
-    {
-    }
-
-// ---------------------------------------------------------------------------
-// Keyguard UI constructor reserves localized resources, configures itself
-// using CenRep and FeatureManager and reserves child controls.
-// ---------------------------------------------------------------------------
-void CLockAppKeyguardControl::ConstructL( )
-    {
-    INFO( "CLockAppKeyguardControl::ConstructL started" );
-    CLockAppBaseControl::ConstructL( );
-
-    // feature manager is used for determining if the phone is a slider
-    TBool aFeatureKeypadNoSlider(ETrue);
-    FeatureManager::InitializeLibL( );
-    aFeatureKeypadNoSlider = FeatureManager::FeatureSupported( KFeatureIdKeypadNoSlider );
-    INFO_1("CLockAppKeyguardControl::ConstructL - aFeatureKeypadNoSlider: %d", aFeatureKeypadNoSlider);
-    FeatureManager::UnInitializeLib( );
-
-    // keyguard hardware switch support
-    CRepository* repository = CRepository::NewLC( KCRUidLockConf );
-    TInt hardwareSupport(0);
-    repository->Get( KKeyguardHardwareConf, hardwareSupport );
-    CleanupStack::PopAndDestroy( repository );
-    iHardwareSupport = TLockHardware( hardwareSupport );
-    iHardwareSupport = TLockHardware( 0 );
-
-    TBool touchEnabled( AknLayoutUtils::PenEnabled() );
-    
-    // Cba control
-    iCba = CEikButtonGroupContainer::NewL( CEikButtonGroupContainer::ECba,
-                                           CEikButtonGroupContainer::EHorizontal,
-                                           this,
-                                           touchEnabled ? R_AVKON_SOFTKEYS_EMPTY :
-                                           R_KEYLOCK_SOFTKEYS_UNLOCK_EMPTY );
-    TRect screenRect;
-    AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screenRect );
-    iCba->SetBoundingRect( screenRect );
-    iCba->MakeVisible( EFalse );
-
-    // Construct Keyguard Notes
-    iKeypadLockedNote = new (ELeave) CLockAppLockedNote();
-    iKeypadLockedNote->ConstructSleepingNoteL( touchEnabled ? R_KEYLOCK_NOTE_DISPLAY_LOCK_ON_TOUCH :
-                                               R_KEYLOCK_NOTE_LOCK_ON );
-    iKeypadLockedNote->ButtonGroupContainer().ButtonGroup()->AsControl()->DrawableWindow()->SetOrdinalPosition( 0, 2 );
-		// this is not needed
-    // iKeypadLockedNote->PublishDialogL( EAknKeysLockedNote );
-
-    iKeypadUnlockedNote = new (ELeave) CLockAppLockedNote();
-    iKeypadUnlockedNote->ConstructSleepingNoteL( touchEnabled ? R_KEYLOCK_NOTE_DISPLAY_LOCK_OFF_TOUCH :
-                                                 R_KEYLOCK_NOTE_LOCK_OFF );
-    iKeypadUnlockedNote->ButtonGroupContainer().ButtonGroup()->AsControl()->DrawableWindow()->SetOrdinalPosition( 0, 2 );
-		// this is not needed
-    // iKeypadUnlockedNote->PublishDialogL( EAknKeysReleasedNote );
-
-    iLockedNote = new (ELeave) CLockAppLockedNote();
-    if ( touchEnabled )
-        {
-        iLockedNote->ConstructSleepingNoteL( R_KEYLOCK_NOTE_DISPLAY_LOCKED_TOUCH );
-        }
-    else
-        {
-        switch ( iHardwareSupport )
-            {
-            case EKeyguardOnePositionSwitch:
-            case EKeyguardTwoPositionSwitch:
-                {
-                iLockedNote->ConstructSleepingNoteL( R_KEYLOCK_NOTE_KEYLOCKED_SWITCH );
-                break;
-                }
-            case EKeyguardDefaultHardware:
-            default:
-                {
-                iLockedNote->ConstructSleepingNoteL( R_KEYLOCK_NOTE_KEYLOCKED );
-                break;
-                }
-            }
-        }
-    iLockedNote->ButtonGroupContainer().ButtonGroup()->AsControl()->DrawableWindow()->SetOrdinalPosition( 0, 2 );
-
-    // These are created only if touch is not enabled, since
-    // currently in touch devices the keylock state is controlled
-    // with switch.
-    if ( !touchEnabled )
-        {
-        //Note showing "Now Press *" - when user has pressed "Unlock" in locked state.
-        if ( aFeatureKeypadNoSlider )
-            {
-            // for normal phones
-            iConfirmationNote = new (ELeave) CLockAppLockedNote();
-            iConfirmationNote->ConstructSleepingNoteL( R_KEYLOCK_NOTE_UNLOCK_ASTERISK );
-            }
-        else
-            {
-            // for special slider phones
-            iConfirmationNote = new (ELeave) CLockAppLockedNote();
-            iConfirmationNote->ConstructSleepingNoteL( R_KEYLOCK_NOTE_UNLOCK_CONFIRM );
-            }
-        iConfirmationNote->ButtonGroupContainer().ButtonGroup()->AsControl()->DrawableWindow()->SetOrdinalPosition( 0, 2 );
-        
-        }
-    
-    
-    // CenRep observers
-    // TODO create private CR key for storing persistent keyguard state (currently in Sysap)
-    // iCRPersistentKeyguardStatus = CLockAppCenRepObserver::NewL ( this, KCRUidCoreApplicationUIsSysAp, KSysApKeyguardActive );
-
-#ifdef RD_AUTO_KEYGUARD
-    iCRAutoKeyguardTime = CLockAppCenRepObserver::NewL ( this, KCRUidSecuritySettings, KSettingsAutomaticKeyguardTime );
-    // Activity manager
-    iActivityManager = CUserActivityManager::NewL( CActive::EPriorityStandard );
-    StartActivityMonitoringL( );
-#endif //RD_AUTO_KEYGUARD
-
-    // PubSub observers
-    iPSStartupObserver = CLockAppPubSubObserver::NewL( this, KPSUidStartup, KPSGlobalSystemState );
-
-    // Setup key pattern matcher
-    if ( !SetupKeyPatternsWithPolicyL( EPolicyDeactivateKeyguard ) )
-        {
-        INFO( "CLockAppKeyguardControl::ConstructL - No CenRep policy defined" );
-        if ( aFeatureKeypadNoSlider )
-            {
-            iKeyPattern->AddPattern( EStdKeyDevice0, KStdKeyAsterisk ); // LSK + *
-            }
-        else
-            {
-            iKeyPattern->AddPattern( EStdKeyDevice0, EStdKeyDevice1 ); // LSK + RSK
-            }
-        }
-#ifdef __WINS__
-    // In Emulator add the LSK+* pattern also.
-    iKeyPattern->AddPattern( EStdKeyDevice0, EStdKeyNkpAsterisk ); // LSK + *
-#endif
-
-    INFO( "CLockAppKeyguardControl::ConstructL completed" );
-    }
-
-// ---------------------------------------------------------------------------
-// Check weather its allowed to automatically lock the keys
-// ---------------------------------------------------------------------------
-TBool CLockAppKeyguardControl::AutoActivationAllowedL( )
-    {
-#ifdef RD_AUTO_KEYGUARD
-    TInt value = 0;
-    TBool flipOpen(EFalse);
-    RProperty::Get( KPSUidHWRM, KHWRMFlipStatus, value );
-    flipOpen = (value = KFlipOpen);
-    INFO_1("CLockAppKeyguardControl::AutoActivationAllowedL - flipOpen: %d", flipOpen);
-    if ( flipOpen )
-        {
-        CRepository* repository = CRepository::NewL( KCRUidAutolockConf );
-        repository->Get( KAutoKeyLockConf, value );
-        delete repository;
-        if ( value & KAutoKeylockFeatureIdFlipOpenDisabled )
-            {
-            INFO( "CLockAppKeyguardControl::AutoActivationAllowedL : False because flipOpenDisabled" );
-            return EFalse;
-            }
-        }
-
-    TInt lightStatus=EForcedLightsUninitialized; 
-    RProperty::Get(KPSUidCoreApplicationUIs,KLightsVTForcedLightsOn,lightStatus ); 
-    INFO_1("CLockAppKeyguardControl::AutoActivationAllowedL - lightStatus: %d", lightStatus);
-    if ( lightStatus == EForcedLightsOn )
-	{
-	INFO( "CLockAppKeyguardControl::AutoActivationAllowedL : False because EForcedLightsOn" );
-	return EFalse;
-	}
-
-    TBool keysLocked(EFalse);
-    TBool idle(EFalse);
-    TBool ongoingCall(EFalse);
-    TBool screenSaverOn(EFalse);
-    TBool screenSaverStertedFromIdle(EFalse);
-
-    keysLocked = (iStateControl.LockStatus() != ELockNotActive);
-    INFO_1("CLockAppKeyguardControl::AutoActivationAllowedL - keysLocked: %d", keysLocked);
-    value = 0;
-    RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallState, value );
-    ongoingCall = (value > EPSCTsyCallStateNone);
-    INFO_2("CLockAppKeyguardControl::AutoActivationAllowedL - ongoingCall: %d %d", value, ongoingCall);
-    value = 0;
-    RProperty::Get( KPSUidAiInformation, KActiveIdleState, value );
-    idle = (value == EPSAiForeground);
-    INFO_2("CLockAppKeyguardControl::AutoActivationAllowedL - idle: %d %d", value, idle);
-    value = 0;
-    RProperty::Get( KPSUidScreenSaver, KScreenSaverOn, value );
-    screenSaverOn = (value > 0);
-    INFO_2("CLockAppKeyguardControl::AutoActivationAllowedL - screenSaverOn: %d %d", value, screenSaverOn);
-    value = 0;
-    RProperty::Get( KPSUidScreenSaver, KScreenSaverActivatedFromIdle, value );
-    screenSaverStertedFromIdle = (value == KSsStartedFromIdle);
-    INFO_2("CLockAppKeyguardControl::AutoActivationAllowedL - screenSaverStertedFromIdle: %d %d", value, screenSaverStertedFromIdle);
-
-    // If a call is ongoing or idle doesnt have foreground and
-    // screensaver is not started from idle -> dont lock keys
-    if ( keysLocked || ongoingCall || (!idle && !(screenSaverOn && screenSaverStertedFromIdle)) )
-        {
-        INFO("CLockAppKeyguardControl::AutoActivationAllowedL : False");
-        return EFalse;
-        }
-#endif //RD_AUTO_KEYGUARD
-    INFO("CLockAppKeyguardControl::AutoActivationAllowedL : True");
-    return ETrue;
-    }
-
-// ---------------------------------------------------------------------------
-// Check weather its allowed to activate the control
-// ---------------------------------------------------------------------------
-TBool CLockAppKeyguardControl::ActivationAllowedL( )
-    {
-    return ETrue;
-    }
-
-// ---------------------------------------------------------------------------
-// Check weather its allowed to deactivate the control
-// ---------------------------------------------------------------------------
-TBool CLockAppKeyguardControl::DeActivationAllowedL( )
-    {
-    return ETrue;
-    }
-
-// ---------------------------------------------------------------------------
-// Activate control
-// ---------------------------------------------------------------------------
-void CLockAppKeyguardControl::HandleActivateEventL( TUint aEnvMask )
-    {    
-    INFO_1("CLockAppKeyguardControl::HandleActivateEventL - aEnvMask: %x", aEnvMask);
-    
-    CLockAppBaseControl::HandleActivateEventL( aEnvMask );
-
-    if ( IsBitFieldSet( aEnvMask, KLockAppEnvScreenSaverOn ) )
-        {
-        // if screensaver is on - capture primary keys
-        CapturePrimaryKeys( ETrue );
-        }
-
-    // capture keys
-    CLockAppKeyCaptureController::CaptureKey( EStdKeyApplication0, EKeyApplication0, EKeyCaptureAllEvents ); // App key
-    CLockAppKeyCaptureController::CaptureKey( EStdKeyDevice2, EKeyDevice2, EKeyCaptureAllEvents ); // Power key (for lights)
-    CLockAppKeyCaptureController::CaptureKey( EStdKeyDevice6, EKeyDevice6, EKeyCaptureAllEvents ); // Voice key (for lights)
-    CLockAppKeyCaptureController::CaptureKey( EStdKeyNo, EKeyNo, EKeyCaptureAllEvents ); // End key (for Rosetta lights)
-
-    SetPointerEventCapture( ETrue );
-    SetKeyguardIndicatorStateL( ETrue );
-    ShowCba( ETrue );
-    // close task-list in case it is displayed : fast-swap window
-    iEikonEnv->DismissTaskList( );
-    if ( iCba )
-        {
-        TBool areWeInIdleState = CEikStatusPaneBase::Current()->PaneCapabilities(TUid::Uid(EEikStatusPaneUidClock)).IsInCurrentLayout( );
-        if ( areWeInIdleState )
-            {
-            (static_cast<CEikCba*>(iCba->ButtonGroup()))->SetSkinBackgroundId( KAknsIIDQsnBgAreaControlIdle );
-            }
-        else
-            {
-            (static_cast<CEikCba*>(iCba->ButtonGroup()))->SetSkinBackgroundId( KAknsIIDQsnBgAreaControl );
-            }
-        }
-
-    if ( iCRPersistentKeyguardStatus )
-        {
-        iCRPersistentKeyguardStatus->SetValue( 1 );
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// DeActivate control
-// ---------------------------------------------------------------------------
-void CLockAppKeyguardControl::HandleDeActivateEventL( TUint aEnvMask )
-    {
-    INFO_1("CLockAppKeyguardControl::HandleDeActivateEventL - aEnvMask: 0x%x", aEnvMask);
-    
-    CLockAppBaseControl::HandleDeActivateEventL( aEnvMask );
-
-    if ( IsBitFieldSet( aEnvMask, KLockAppEnvScreenSaverOn ) )
-        {
-        // if screensaver is on - uncapture primary keys
-        CapturePrimaryKeys( EFalse );
-        }
-
-    // phonecall or not - uncapture keys anyway
-    CLockAppKeyCaptureController::ReleaseKey( EStdKeyApplication0 );
-    CLockAppKeyCaptureController::ReleaseKey( EStdKeyDevice2 );
-    CLockAppKeyCaptureController::ReleaseKey( EStdKeyDevice6 );
-    CLockAppKeyCaptureController::ReleaseKey( EStdKeyNo );
-
-    SetPointerEventCapture( EFalse );
-    SetKeyguardIndicatorStateL( EFalse );
-    ShowCba( EFalse );
-
-    if ( iCRPersistentKeyguardStatus )
-        {
-        iCRPersistentKeyguardStatus->SetValue( 0 );
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Handle environment changes (Screensaver, Telephony, etc.)
-// ---------------------------------------------------------------------------
-void CLockAppKeyguardControl::HandleEnvironmentChange( TUint aEnvMask, TUint aEventMask )
-    {
-    if ( IsBitFieldSet( aEventMask, KLockAppEnvScreenSaverOn ) )
-        {
-        // screen saver state changed
-        CapturePrimaryKeys( IsBitFieldSet( aEnvMask, KLockAppEnvScreenSaverOn ) );
-        }
-    if ( IsBitFieldSet( aEventMask, KLockAppEnvFPS ) )
-        {
-    		// iStateControl.DisableKeyguardL( ETrue );
-    		// iStateControl.LockStatus() != ELockNotActive		// no need to check, because keyguard will catch fingerprint only if not locked
-    		iStateControl.EnableDevicelockL( EDevicelockManual );
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Inform the user that keys are locked (i.e. "Please press LSK+'*' to unlock).
-// ---------------------------------------------------------------------------
-void CLockAppKeyguardControl::DisplayLockedNote( )
-    {
-    ShowNote( iLockedNote, CAknNoteDialog::ELongTimeout, CAknNoteDialog::ENoTone );
-    }
-
-// ---------------------------------------------------------------------------
-// Handle all Central Repository observer callbacks.
-// ---------------------------------------------------------------------------
-void CLockAppKeyguardControl::HandleCenRepNotify(TUid aCenRepUid, TUint32 aKeyId, TInt aValue )
-    {
-    if ( aCenRepUid == KCRUidSecuritySettings )
-        {
-        switch ( aKeyId )
-            {
-            case KSettingsAutomaticKeyguardTime:
-                {
-                INFO_1( "CLockAppKeyguardControl::HandleCenRepNotify - KSettingsAutomaticKeyguardTime = %d", aValue );
-                ResetInactivityTimeout( );
-                }
-                break;
-            default:
-                break;
-            }
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Handle all Publish & Subscribe observer callbacks.
-// ---------------------------------------------------------------------------
-void CLockAppKeyguardControl::HandlePubSubNotify(TUid aPubSubUid, TUint aKeyId, TInt aValue )
-    {
-    if ( aPubSubUid == KPSUidStartup )
-        {
-        switch ( aKeyId )
-            {
-            case KPSGlobalSystemState:
-                {
-                // In case of unexpected reset (e.g. hidden boot) the keylock must be enabled silently.
-                if ( !iAlreadyNormalState && (aValue == ESwStateNormalRfOn || aValue == ESwStateNormalRfOff) )
-                    {
-                    iAlreadyNormalState = ETrue;
-                    TInt keylockWasEnabled = 0;
-                    if ( iCRPersistentKeyguardStatus )
-                        {
-                        iCRPersistentKeyguardStatus->GetValue( keylockWasEnabled );
-                        if ( keylockWasEnabled )
-                            {
-                            TRAPD(err, iStateControl.EnableKeyguardL( EFalse ));
-                            ERROR(err, "CLockAppKeyguardControl::HandlePubSubNotify - EnableKeyguardL");
-                            }
-                        }
-                    }
-                }
-                break;
-            default:
-                break;
-            }
-        }
-    INFO_3( "CLockAppKeyguardControl::HandlePubSubNotify %x %x = %x", aPubSubUid.iUid, aKeyId, aValue );
-    }
-
-// ---------------------------------------------------------------------------
-// Show that keys are locked.
-// ---------------------------------------------------------------------------
-void CLockAppKeyguardControl::DisplayKeysLockedNote( )
-    {
-    ShowNote( iKeypadLockedNote, KKeyLockCustomShortTimeout, CAknNoteDialog::ENoTone );
-    }
-
-// ---------------------------------------------------------------------------
-// Show that keys are unlocked.
-// ---------------------------------------------------------------------------
-void CLockAppKeyguardControl::DisplayKeysActiveNote( )
-    {
-    ShowNote( iKeypadUnlockedNote, KKeyLockCustomShortTimeout, CAknNoteDialog::ENoTone );
-    }
-
-// ---------------------------------------------------------------------------
-// Show confirmation note when user has pressed "Unlock".
-// ---------------------------------------------------------------------------
-void CLockAppKeyguardControl::DisplayConfirmationNote( )
-    {
-    ShowNote( iConfirmationNote, CAknNoteDialog::EShortTimeout, CAknNoteDialog::EConfirmationTone );
-    // inform sysap to put lights on left soft key press
-    SendMessageToSysAp( EEikKeyLockLightsOnRequest );
-    }
-
-// ---------------------------------------------------------------------------
-// Keyguard UI key events are handled trough here.
-// ---------------------------------------------------------------------------
-TKeyResponse CLockAppKeyguardControl::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType )
-    {
-    
-    INFO_4( "%s %s (%u) iActive=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iActive );
-    INFO_4( "%s (%u) aKeyEvent.iCode=%x aType=%x", __FILE__, __LINE__, aKeyEvent.iCode, aType );
-    
-    if ( iActive )
-        {
-        		if(AknLayoutUtils::PenEnabled())
-        			{
-        			if(aKeyEvent.iCode == EKeyDeviceF)	// any Type
-        				{
-        				iStateControl.DisableKeyguardL( ETrue );
-        				}
-        			}
-        if ( aType == EEventKeyDown )
-            {
-            switch ( iKeyPattern->HandleKeyEvent( aKeyEvent.iScanCode ) )
-                {
-                case EPatternNoMatch:
-                    DisplayLockedNote( );
-                    break;
-                case EPatternPrimaryMatch:
-                    DisplayConfirmationNote( );
-                    break;
-                case EPatternSecondaryMatch:
-                    iStateControl.DisableKeyguardL( ETrue );
-                    break;
-                default:
-        						INFO_4( "%s %s (%u) default=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 );
-                    break;
-                }
-            }
-        }
-    return EKeyWasConsumed;
-    }
-
-// ---------------------------------------------------------------------------
-// Get autokeyguard timeout (in seconds)
-// @return 0 means Off
-// ---------------------------------------------------------------------------
-TInt CLockAppKeyguardControl::GetAutoKeyguardTimeout( )
-    {
-    TInt timeoutInSeconds( 0 );
-#ifdef RD_AUTO_KEYGUARD
-    iCRAutoKeyguardTime->GetValue( timeoutInSeconds );
-#endif //RD_AUTO_KEYGUARD
-    return timeoutInSeconds;
-    }
-
-// ----------------------------------------------------------
-// Starts monitoring user activity
-// ----------------------------------------------------------
-void CLockAppKeyguardControl::StartActivityMonitoringL( )
-    {
-#ifdef RD_AUTO_KEYGUARD
-    __ASSERT_DEBUG( iActivityManager, DoPanic(ELockIllegalState));
-    if ( iActivityManager && !iActivityManager->IsActive() )
-        {
-        TInt value = GetAutoKeyguardTimeout( );
-        INFO_1( "CLockAppKeyguardControl::StartActivityMonitoringL - %d sec", value);
-        if ( value )
-            {
-            iActivityManager->Start( value,
-                    TCallBack( HandleInactiveEventL, this ),
-                    TCallBack( HandleActiveEventL, this ) );
-            }
-        else
-            {
-            iActivityManager->Start( KAutoKeyguardOff,
-                    TCallBack( HandleInactiveEventL, this ),
-                    TCallBack( HandleActiveEventL, this ) );
-            }
-        }
-#endif //RD_AUTO_KEYGUARD
-    }
-
-// ----------------------------------------------------------
-// Gets keyguard period and starts monitoring user activity
-// ----------------------------------------------------------
-void CLockAppKeyguardControl::ResetInactivityTimeout( )
-    {
-#ifdef RD_AUTO_KEYGUARD
-    __ASSERT_DEBUG( iActivityManager, DoPanic(ELockIllegalState));
-    if ( iActivityManager )
-        {
-        TInt value = GetAutoKeyguardTimeout( );
-        INFO_1( "CLockAppKeyguardControl::ResetInactivityTimeout - %d sec", value);
-        if ( value )
-            {
-            iActivityManager->SetInactivityTimeout( value );
-            }
-        else
-            {
-            iActivityManager->SetInactivityTimeout( KAutoKeyguardOff );
-            }
-        }
-#endif //RD_AUTO_KEYGUARD
-    }
-
-// ----------------------------------------------------------
-// Stop monitoring user activity.
-// ----------------------------------------------------------
-void CLockAppKeyguardControl::StopActivityMonitoring( )
-    {
-#ifdef RD_AUTO_KEYGUARD
-    if ( iActivityManager )
-        {
-        iActivityManager->Cancel( );
-        }
-#endif //RD_AUTO_KEYGUARD
-    }
-
-// ----------------------------------------------------------
-// Handle Active event. Called by ActivityManager
-// ----------------------------------------------------------
-TInt CLockAppKeyguardControl::HandleActiveEventL(TAny* /*aPtr*/)
-    {
-    return KErrNone;
-    }
-
-// ----------------------------------------------------------
-// Handles InActive event. Called by ActivityManager
-// ----------------------------------------------------------
-TInt CLockAppKeyguardControl::HandleInactiveEventL(TAny* aPtr )
-    {
-#ifdef RD_AUTO_KEYGUARD
-    CLockAppKeyguardControl* keyguard = STATIC_CAST(CLockAppKeyguardControl*, aPtr);
-    if ( keyguard->GetAutoKeyguardTimeout( ) && keyguard->AutoActivationAllowedL( ) )
-        {
-        keyguard->iStateControl.EnableKeyguardL( EFalse );
-        }
-#endif //RD_AUTO_KEYGUARD
-    return KErrNone;
-    }
-
-// ---------------------------------------------------------------------------
-// Handle UI commands received from the child controls
-// ---------------------------------------------------------------------------
-void CLockAppKeyguardControl::ProcessCommandL( TInt aCommandId )
-    {
-    INFO_1("CLockAppKeyguardControl::ProcessCommandL : %d ", aCommandId );
-    }
-
-TInt CLockAppKeyguardControl::CountComponentControls( ) const
-    {
-    return 1;
-    }
-
-CCoeControl* CLockAppKeyguardControl::ComponentControl(TInt /*aIndex*/) const
-    {
-    return iCba;
-    }
-
-// ---------------------------------------------------------------------------
-// Notification if layout changes.
-// ---------------------------------------------------------------------------
-void CLockAppKeyguardControl::HandleResourceChange(TInt aType )
-    {
-    if ( aType == KEikDynamicLayoutVariantSwitch && iCba )
-        {
-        TRect screenRect;
-        AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screenRect );
-        iCba->SetBoundingRect( screenRect );
-        }
-    CCoeControl::HandleResourceChange( aType );
-    }
-
-// END OF FILE
--- a/securitydialogs/lockapp/src/lockappkeypattern.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,281 +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:  Key pattern matching component.
- *
-*/
-
-
-#include "lockapptrace.h"
-#include "lockappkeypattern.h"
-
-const TInt KDefaultTimeout = 2000000;
-
-// ---------------------------------------------------------------------------
-// Standard two-phased construction
-// ---------------------------------------------------------------------------
-CLockAppKeyPattern* CLockAppKeyPattern::NewL( )
-    {
-    CLockAppKeyPattern *self = new ( ELeave ) CLockAppKeyPattern();
-    CleanupStack::PushL( self );
-    self->ConstructL( );
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-// Default C++ constructor
-// ---------------------------------------------------------------------------
-CLockAppKeyPattern::CLockAppKeyPattern( ) :
-    iKeyTimeOut( KDefaultTimeout ),
-    iState( EPatternNoMatch ),
-    iEnabled ( ETrue ),
-    iHasPatterns( EFalse )
-    {
-    // no implementation required
-    }
-
-// ---------------------------------------------------------------------------
-// Key pattern construction
-// ---------------------------------------------------------------------------
-void CLockAppKeyPattern::ConstructL( )
-    {
-    iKeyTimer = CPeriodic::NewL( CActive::EPriorityUserInput );
-    }
-
-// ---------------------------------------------------------------------------
-// Destructor
-// ---------------------------------------------------------------------------
-CLockAppKeyPattern::~CLockAppKeyPattern( )
-    {
-    ClearPatterns( );
-    // timer between key presses is cancelled
-    if ( iKeyTimer )
-        {
-        iKeyTimer->Cancel( );
-        delete iKeyTimer;
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Gets the enabled state.
-// ---------------------------------------------------------------------------
-TBool CLockAppKeyPattern::IsEnabled( )
-    {
-    return iEnabled;
-    }
-
-// ---------------------------------------------------------------------------
-// Sets the enabled state.
-// ---------------------------------------------------------------------------
-void CLockAppKeyPattern::SetEnabled(TBool aEnabled )
-    {
-    iEnabled = aEnabled;
-    }
-
-// ---------------------------------------------------------------------------
-// Gets the primary key timeout.
-// ---------------------------------------------------------------------------
-TUint CLockAppKeyPattern::GetKeyTimeOut( )
-    {
-    return iKeyTimeOut;
-    }
-
-// ---------------------------------------------------------------------------
-// Sets the primary key timeout.
-// ---------------------------------------------------------------------------
-void CLockAppKeyPattern::SetKeyTimeOut(TUint aTimeOut )
-    {
-    iKeyTimeOut = aTimeOut;
-    }
-
-// ---------------------------------------------------------------------------
-// Add new key combination
-// ---------------------------------------------------------------------------
-TInt CLockAppKeyPattern::AddPattern( TUint32 aPrimaryKey, TUint32 aSecondaryKey )
-    {
-    TInt err(KErrNone);
-    iPrimaryKeys.Append( aPrimaryKey );
-    iSecondaryKeys.Append( aSecondaryKey );
-    iHasPatterns = ETrue;
-    return err;
-    }
-
-// ---------------------------------------------------------------------------
-// Get key combination
-// ---------------------------------------------------------------------------
-TInt CLockAppKeyPattern::GetPattern(TInt aIndex, TUint32& aPrimaryKey, TUint32& aSecondaryKey )
-    {
-    TInt err( KErrNone);
-    if ( iHasPatterns && aIndex < iPrimaryKeys.Count( )&& aIndex < iSecondaryKeys.Count( ) )
-        {
-        aPrimaryKey = iPrimaryKeys[aIndex];
-        aSecondaryKey = iSecondaryKeys[aIndex];
-        }
-    else
-        {
-        err = KErrNotFound;
-        }
-    return err;
-    }
-
-// ---------------------------------------------------------------------------
-// Returns true if the key pattern matcher has been initialized
-// ---------------------------------------------------------------------------
-TBool CLockAppKeyPattern::HasPatterns( )
-    {
-    return (iHasPatterns && iPrimaryKeys.Count() > 0 && iSecondaryKeys.Count() > 0);
-    }
-
-// ---------------------------------------------------------------------------
-// Clear all key combinations
-// ---------------------------------------------------------------------------
-TInt CLockAppKeyPattern::ClearPatterns( )
-    {
-    TInt err( KErrNone);
-    if ( iHasPatterns )
-        {
-        iPrimaryKeys.Reset( );
-        iSecondaryKeys.Reset( );
-        iWaitingKeys.Reset( );
-        iHasPatterns = EFalse;
-        // cancel the timer
-        iKeyTimer->Cancel( );
-        }
-    return err;
-    }
-
-// ---------------------------------------------------------------------------
-// Receives keys and checks whether they match any primary+secondary key combination
-// ---------------------------------------------------------------------------
-TPatternState CLockAppKeyPattern::HandleKeyEvent( TUint32 aKey )
-    {  
-    if ( iEnabled )
-        {
-        if ( iHasPatterns )
-            {
-            switch (iState)
-                {
-                case EPatternNoMatch:
-                case EPatternSecondaryMatch:
-                    {
-                    if ( iPrimaryKeys.Find( aKey ) != KErrNotFound )
-                        {
-                        HandlePrimaryKeyEvent( aKey );
-                        }
-                    else
-                        {
-                        HandleOtherKeyEvent();
-                        }
-                    }
-                    break;
-                case EPatternPrimaryMatch:
-                    {
-                    if ( iWaitingKeys.Find( aKey ) != KErrNotFound )
-                        {
-                        HandleSecondaryKeyEvent();
-                        }
-                    else
-                        {
-                        if ( iPrimaryKeys.Find( aKey ) != KErrNotFound )
-                            {
-                            HandlePrimaryKeyEvent( aKey );
-                            }
-                        else
-                            {
-                            HandleOtherKeyEvent();
-                            }
-                        }
-                    }
-                    break;
-                default:
-                    break;
-                }
-            }
-        else
-            {
-            return EPatternNotInitialized;
-            }
-        }
-    else
-        {
-        return EPatternNotEnabled;
-        }
-
-    return iState;
-    }
-
-// ---------------------------------------------------------------------------
-// Handles primary key events
-// ---------------------------------------------------------------------------
-void CLockAppKeyPattern::HandlePrimaryKeyEvent( TUint32 aKey )
-    {
-    // cancel the timer
-    iKeyTimer->Cancel( );
-    // clear the waiting keys
-    iWaitingKeys.Reset( );
-    // add those secondary keys to the waiting keys, which have the same primary key
-    for (TInt i( 0); i < iPrimaryKeys.Count( ); i++ )
-        {
-        if ( iPrimaryKeys[i] == aKey && i < iSecondaryKeys.Count( ) )
-            {
-            iWaitingKeys.Append( iSecondaryKeys[i] );
-            }
-        }
-
-    // start timer for primary key timeout
-    iKeyTimer->Start( iKeyTimeOut, iKeyTimeOut, TCallBack( HandleKeyTimerTimeout, this ) );
-
-    // set the state
-    iState = EPatternPrimaryMatch;
-    }
-
-// ---------------------------------------------------------------------------
-// Handles secondary key events
-// ---------------------------------------------------------------------------
-void CLockAppKeyPattern::HandleSecondaryKeyEvent( )
-    {
-    // cancel the timer
-    iKeyTimer->Cancel( );
-    // clear the waiting keys
-    iWaitingKeys.Reset( );
-    // set the state
-    iState = EPatternSecondaryMatch;
-    }
-
-// ---------------------------------------------------------------------------
-// Handles other key events
-// ---------------------------------------------------------------------------
-void CLockAppKeyPattern::HandleOtherKeyEvent( )
-    {
-    // cancel the timer
-    iKeyTimer->Cancel( );
-    // clear the waiting keys
-    iWaitingKeys.Reset( );
-    // set the state
-    iState = EPatternNoMatch;
-    }
-
-// ---------------------------------------------------------------------------
-// A call back to the key pattern timer, the allowed time window for pressing
-// the secondary key to get a match has passed.
-// ---------------------------------------------------------------------------
-TInt CLockAppKeyPattern::HandleKeyTimerTimeout( TAny* aSelf )
-    {
-    CLockAppKeyPattern* self = reinterpret_cast< CLockAppKeyPattern* >( aSelf );
-    // reset the state
-    self->HandleOtherKeyEvent( );
-    return KErrNone;
-    }
-
-// End of file
--- a/securitydialogs/lockapp/src/lockapplockednote.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +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:  Sleeping note with timeout and a reference flag that informs
- *                the parent when the note is visible
- *
-*/
-
-
-#include "lockapplockednote.h"
-
-// ---------------------------------------------------------------------------
-// Construction passes the parent implementing command observer interface
-// and a reference to variable that is true if note with timeout is shown,
-// false if not
-// ---------------------------------------------------------------------------
-CLockAppLockedNote::CLockAppLockedNote( MEikCommandObserver* aCommandObserver ) :
-	CLockAppSleepingNote(aCommandObserver)
-	{
-	// no implementation required
-	}
-
-// ---------------------------------------------------------------------------
-// In destruction set reference value (is note shown) to not true.
-// ---------------------------------------------------------------------------
-CLockAppLockedNote::~CLockAppLockedNote( )
-	{
-	}
-
-// ---------------------------------------------------------------------------
-// Method to cancel note from screen.
-// ---------------------------------------------------------------------------
-void CLockAppLockedNote::CancelNote( )
-	{
-	ExitSleepingDialog( );
-	}
-
-// ---------------------------------------------------------------------------
-// Inform the command observer (parent) about the focus lost event.
-// ---------------------------------------------------------------------------
-void CLockAppLockedNote::FocusChanged( TDrawNow /*aDrawNow*/)
-	{
-	if ( !IsFocused( ) && iCommandObserver )
-		{
-		TRAP_IGNORE(iCommandObserver->ProcessCommandL(KNoteCmdFocusLost))
-		}
-	}
--- a/securitydialogs/lockapp/src/lockappobserverlist.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,126 +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:  Lock App internal state control
- *
-*/
-
-
-#include "lockappstatecontrol.h"
-#include "lockappstatepublisher.h"
-#include "lockappkeyguardcontrol.h"
-#include "lockapputils.h"
-#include "lockappecsdetector.h"
-
-const TInt KLockAppObserverListGranularity = 4;
-
-// ---------------------------------------------------------------------------
-// Standard C++ constructor
-// ---------------------------------------------------------------------------
-CLockAppObserverList::CLockAppObserverList( )
-    {
-    // no implementation required
-    }
-
-// ---------------------------------------------------------------------------
-// Destroys the observer list and all existing observers.
-// ---------------------------------------------------------------------------
-CLockAppObserverList::~CLockAppObserverList( )
-    {
-    if ( iObserverList )
-        {
-        TInt count = iObserverList->Count( );
-        for (TInt index=0; index<count; index++ )
-            {
-            delete (*iObserverList)[index];
-            }
-        iObserverList->Reset( );
-        delete iObserverList;
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Adds lock state observer to the observer list.
-// ---------------------------------------------------------------------------
-void CLockAppObserverList::AddObserverL( MLockAppStateObserver* aObserver )
-    {
-    if ( aObserver )
-        {
-        TBool found(EFalse);
-        // check that the observer has not been added before
-        TInt count = iObserverList->Count( );
-        for ( TInt index=0; index<count; index++ )
-            {
-            if ( ((*iObserverList)[index]) == aObserver )
-                {
-                found = ETrue;
-                }
-            }
-        if ( !found )
-            {
-            iObserverList->AppendL( aObserver );
-            }
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Removes lock state observer from the observer list.
-// ---------------------------------------------------------------------------
-void CLockAppObserverList::RemoveObserver( MLockAppStateObserver* aObserver )
-    {
-    if ( aObserver )
-        {
-        TInt count = iObserverList->Count( );
-        for ( TInt index=0; index<count; index++ )
-            {
-            if ( ((*iObserverList)[index]) == aObserver )
-                {
-                iObserverList->Remove( index );
-                return;
-                }
-            }
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Constructs the observer list.
-// ---------------------------------------------------------------------------
-void CLockAppObserverList::BaseConstructL( )
-    {
-    // create observer list
-    iObserverList = new (ELeave) RPointerArray<MLockAppStateObserver>(KLockAppObserverListGranularity);
-    }
-
-// ---------------------------------------------------------------------------
-// Not implemented, meant for derived classes
-// ---------------------------------------------------------------------------
-void CLockAppObserverList::HandleLockStatusChangedL( TLockStatus /*aLockStatus*/)
-    {
-    }
-
-// ---------------------------------------------------------------------------
-// Informs observers that the lock state has changed.
-// ---------------------------------------------------------------------------
-void CLockAppObserverList::PostStatusChangeL( TLockStatus aStatusChange )
-    {
-    // first inform the main control
-    HandleLockStatusChangedL( aStatusChange );
-
-    // for child observers
-    TInt count = iObserverList->Count( );
-    for ( TInt index=count-1; index>=0; index-- )
-        {
-        //TRAP_IGNORE
-        ((*iObserverList)[index])->HandleLockStatusChangedL( aStatusChange );
-        }
-    }
--- a/securitydialogs/lockapp/src/lockapppubsubobserver.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,146 +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:  Publish & Subscribe key observer
- *
-*/
-
-
-#include "lockapppubsubobserver.h"
-#include "lockapputils.h"
-
-// ---------------------------------------------------------------------------
-// Two-phased constructor.
-// ---------------------------------------------------------------------------
-CLockAppPubSubObserver* CLockAppPubSubObserver::NewL(MLockAppObserverInterface* aObserver,
-        TUid aPubSubUid, TUint32 aKeyId )
-    {
-    CLockAppPubSubObserver* self = new (ELeave) CLockAppPubSubObserver(aObserver, aPubSubUid, aKeyId);
-    CleanupStack::PushL( self );
-    self->ConstructL( );
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-// C++ default constructor
-// ---------------------------------------------------------------------------
-CLockAppPubSubObserver::CLockAppPubSubObserver(MLockAppObserverInterface* aObserver,
-        TUid aPubSubUid, TUint32 aKeyId ) :
-    CActive( 0 ),
-    iObserver( aObserver ),
-    iPubSubUid( aPubSubUid ),
-    iKeyId( aKeyId ),
-    iValue( NULL )
-    {
-    }
-
-// ---------------------------------------------------------------------------
-// Destructor
-// ---------------------------------------------------------------------------
-CLockAppPubSubObserver::~CLockAppPubSubObserver( )
-    {
-    Cancel( );
-    iProperty.Close( );
-    }
-
-// ---------------------------------------------------------------------------
-// Symbian OS default constructor
-// ---------------------------------------------------------------------------
-void CLockAppPubSubObserver::ConstructL( )
-    {
-    // Add this active object to the scheduler.
-    CActiveScheduler::Add( this );
-    TInt err = iProperty.Attach( iPubSubUid, iKeyId );
-    ERROR_2(err, "CLockAppPubSubObserver::ConstructL - Property(%d,%d) attach", iPubSubUid, iKeyId);
-    User::LeaveIfError( err );
-    Start( );
-    }
-
-// ---------------------------------------------------------------------------
-// Starts listening
-// ---------------------------------------------------------------------------
-TInt CLockAppPubSubObserver::Start( )
-    {
-    if ( !IsActive( ) )
-        {
-        iStatus = KRequestPending;
-        iProperty.Subscribe( iStatus );
-        SetActive( );
-        return KErrNone;
-        }
-    else
-        {
-        return KErrInUse;
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Stops listening
-// ---------------------------------------------------------------------------
-void CLockAppPubSubObserver::Stop( )
-    {
-    if ( IsActive( ) )
-        {
-        Cancel( );
-        iProperty.Cancel( );
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Gets value of the key from P&S.
-// ---------------------------------------------------------------------------
-TInt CLockAppPubSubObserver::GetKeyValue(TInt& aValue )
-    {
-    RDebug::Printf( "%s %s (%u) 1=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 );
-    return iProperty.Get( aValue );
-    }
-
-// ---------------------------------------------------------------------------
-// Sets a value for the key in P&S.
-// ---------------------------------------------------------------------------
-TInt CLockAppPubSubObserver::SetKeyValue(TInt aValue )
-    {
-    RDebug::Printf( "%s %s (%u) aValue=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aValue );
-    return iProperty.Set( aValue );
-    }
-
-// ---------------------------------------------------------------------------
-// CLockAppPubSubObserver::RunL()
-// ---------------------------------------------------------------------------
-void CLockAppPubSubObserver::RunL( )
-    {
-    TInt value( NULL);
-    iProperty.Get( value );
-    if ( iValue != value )
-        {
-        // on value change
-        iValue = value;
-        if ( iObserver )
-            {
-            iObserver->HandlePubSubNotify( iPubSubUid, iKeyId, iValue );
-            }
-        }
-    // re-subscribe to events
-    Start( );
-    }
-
-// ---------------------------------------------------------------------------
-// Cancels event listening
-// ---------------------------------------------------------------------------
-void CLockAppPubSubObserver::DoCancel( )
-    {
-    iProperty.Cancel( );
-    }
-
-// End of file
--- a/securitydialogs/lockapp/src/lockappserver.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +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:  Server implementation that responds to client API in lockclient
- *
-*/
-
-
-#include "lockappserver.h"
-#include "lockappsession.h"
-#include <lockappclientserver.h>
-#include <coemain.h>
-
-// ---------------------------------------------------------------------------
-// Two-phased constructor.
-// ---------------------------------------------------------------------------
-CLockAppServer* CLockAppServer::NewL( const TDesC& aFixedServerName )
-	{
-
-	CLockAppServer* self = new (ELeave) CLockAppServer();
-	CleanupStack::PushL( self );
-	self->SetPriority( EActivePriorityIpcEventsHigh );
-	self->ConstructL( aFixedServerName );
-	CleanupStack::Pop( self );
-	return self;
-	}
-
-// ---------------------------------------------------------------------------
-// Constructor.
-// ---------------------------------------------------------------------------
-CLockAppServer::CLockAppServer( )
-	{
-
-	// no implementation required
-	}
-
-// ---------------------------------------------------------------------------
-// From @c CApaAppServer. Creates LockApp Session, only one type of
-// service is supported by the server.
-// ---------------------------------------------------------------------------
-CApaAppServiceBase* CLockAppServer::CreateServiceL( TUid aServiceType ) const
-	{
-
-	// only one service is offered through server
-	if ( aServiceType == KLockAppServiceUid )
-		{
-		return new (ELeave) CLockAppSession();
-		}
-	else
-		{
-		return CApaAppServer::CreateServiceL( aServiceType );
-		}
-	}
-
-// ---------------------------------------------------------------------------
-// From @c CApaAppServer. Creates a new client session, version
-// numbering not supported.
-// ---------------------------------------------------------------------------
-CSession2* CLockAppServer::NewSessionL( const TVersion&, const RMessage2& ) const
-	{
-
-	return new (ELeave) CLockAppSession();
-	}
--- a/securitydialogs/lockapp/src/lockappsession.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,236 +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:  LockApp server session requested by lockclient
- *
-*/
-
-
-#include "lockapptrace.h"
-#include "lockappsession.h"
-#include "lockappappui.h"
-#include "lockappstatecontrolinterface.h"
-#include "lockapputils.h"
-#include <lockappclientserver.h>
-
-// ---------------------------------------------------------------------------
-// Default Constructor.
-// ---------------------------------------------------------------------------
-CLockAppSession::CLockAppSession( )
-    {
-
-    // no implementation required
-    }
-
-// ---------------------------------------------------------------------------
-// Default Destructor.
-// ---------------------------------------------------------------------------
-CLockAppSession::~CLockAppSession( )
-    {
-    // no implementation required
-    }
-
-// ---------------------------------------------------------------------------
-// From @c CApaAppServiceBase. Handles possible error in the lock app session
-// Method is empty.
-// ---------------------------------------------------------------------------
-void CLockAppSession::ServiceError( const RMessage2& aMessage, TInt aError )
-    {
-
-    if ( aError == KErrNotReady )
-        {
-        // initialization not yet ready
-        aMessage.Complete( KErrNotReady );
-        ERROR( aError, "LockApp initialization not yet ready, KErrNotReady" );
-        }
-    else
-        {
-        ERROR_1( aError, "Service request has caused a leave, message: %d", aMessage.Function());
-        CApaAppServiceBase::ServiceError( aMessage, aError );
-#ifdef _DEBUG
-        if ( aMessage.Function( )== ELockAppTestDestruct )
-            {
-            User::Leave( KErrGeneral );
-            }
-#endif
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// From @c CApaAppServiceBase. Handles a client request. Leaving is handled by
-// CLockAppSession::ServiceError() which reports the error code to the client
-// ---------------------------------------------------------------------------
-void CLockAppSession::ServiceL(const RMessage2& aMessage )
-    {  
-		RThread clientThread;
-		TInt err=aMessage.Client(clientThread);
-		// RDebug::Print( _L("called by %S"), &(clientThread.FullName()) );
-		// RDebug::Print( clientThread.FullName() );
-
-    TInt response = KErrNone;
-    // log the message
-    // whole provided server API is implemented here
-
-    switch ( aMessage.Function( ) )
-        {
-        case ELockAppEnableKeyguard:
-            // enable with or without note (depends on first parameter)
-            response = DoEnableKeyguardL( aMessage.Int0() );
-            break;
-        case ELockAppDisableKeyguard:
-            // disable with or without note (depends on first parameter)
-            response = DoDisableKeyguardL( aMessage.Int0() );
-            break;
-        case ELockAppEnableDevicelock:
-            // check that client has needed capabilities to enable devicelock
-            if ( aMessage.HasCapability( ECapabilityWriteDeviceData ) )
-                {
-                // first parameter contains the reason
-                response = DoEnableDevicelockL( (TDevicelockReason) aMessage.Int0() );
-                }
-            else
-                {
-                response = KErrPermissionDenied;
-                }
-            break;
-        case ELockAppDisableDevicelock:
-            // check that client has needed capabilities to disable devicelock
-            if ( aMessage.HasCapability( ECapabilityWriteDeviceData ) )
-                {
-                response = DoDisableDevicelockL( );
-                }
-            else
-                {
-                response = KErrPermissionDenied;
-                }
-            break;
-        case ELockAppOfferKeyguard:
-            // offer to lock keyguard
-            response = DoOfferKeyguardL( );
-            break;
-        case ELockAppOfferDevicelock:
-            // TODO implement this someday if needed
-            response = KErrNotSupported;
-            break;
-        case ELockAppShowKeysLockedNote:
-            response = DoShowKeysLockedNoteL( );
-            break;
-#ifdef _DEBUG
-        case ELockAppTestDestruct:
-            // test for leave
-            User::Leave( KErrGeneral );
-            break;
-        case ELockAppTestInternal:
-            // test internal functions (which cannot be tested trough client API)
-            response = StateControlL()->ExecuteInternalTest( );
-            break;
-#endif
-        default:
-            // illegal message call, panic the client process
-            PanicClient( aMessage, ELockPanicIllegalMessage );
-            return;
-        }
-
-    INFO_2( "CLockAppSession received service message: %d. Result: %d", aMessage.Function(), response );
-    aMessage.Complete( response );
-    }
-
-// ---------------------------------------------------------------------------
-// Request lockapp to enable keyguard on device (might not be approved, e.g.
-// devicelock activated).
-// ---------------------------------------------------------------------------
-TInt CLockAppSession::DoEnableKeyguardL( TBool aShowNote )
-    {
-    // calls the main control
-
-    return StateControlL()->EnableKeyguardL( aShowNote );
-    }
-
-// ---------------------------------------------------------------------------
-// Request lockapp to disable keyguard on device (might not be approved, e.g.
-// already disabled).
-// ---------------------------------------------------------------------------
-TInt CLockAppSession::DoDisableKeyguardL( TBool aShowNote )
-    {
-    // calls the main control
-
-    return StateControlL()->DisableKeyguardL( aShowNote );
-    }
-
-// ---------------------------------------------------------------------------
-// Request lockapp to enable devicelock on device (might not be approved).
-// ---------------------------------------------------------------------------
-TInt CLockAppSession::DoEnableDevicelockL( TDevicelockReason aReason )
-    {
-    // calls the main control
-
-    return StateControlL()->EnableDevicelockL( aReason );
-    }
-
-// ---------------------------------------------------------------------------
-// Request lockapp to disable devicelock on device (might not be approved).
-// ---------------------------------------------------------------------------
-TInt CLockAppSession::DoDisableDevicelockL( )
-    {
-    // TODO Investigate if this should be allowed in API or not
-    // calls the main control
-    // StateControlL()->DisableDevicelockL( );
-    return KErrPermissionDenied;
-    }
-
-// ---------------------------------------------------------------------------
-// Request to offer keyguard on device (might not be approved, e.g.
-// already locked).
-// ---------------------------------------------------------------------------
-TInt CLockAppSession::DoOfferKeyguardL( )
-    {
-    // calls the main control
-    return StateControlL()->OfferKeyguard( );
-    }
-
-// ---------------------------------------------------------------------------
-// Request to show keys locked note, only works if keyguard is enabled
-// ---------------------------------------------------------------------------
-TInt CLockAppSession::DoShowKeysLockedNoteL( )
-    {
-    // calls the main control
-
-    return StateControlL()->ShowKeysLockedNote( );
-    }
-
-// ---------------------------------------------------------------------------
-// Return the main state control to the server session.
-// Application appui and the main state control might not be constructed yet.
-// ---------------------------------------------------------------------------
-MLockAppStateControl* CLockAppSession::StateControlL( )
-    {
-
-    // other parts of lockapp construction may not be finished
-    if ( !iStateControl )
-        {
-        CLockAppAppUi* appUi = (CLockAppAppUi*) CEikonEnv::Static()->EikAppUi();
-        if ( appUi )
-            {
-            iStateControl = appUi->StateControl( );
-            if ( !iStateControl )
-                {
-                User::Leave( KErrNotReady );
-                }
-            }
-        else
-            {
-            User::Leave( KErrNotReady );
-            }
-        }
-    return iStateControl;
-    }
--- a/securitydialogs/lockapp/src/lockappsleepingnote.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,128 +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:  Sleeping note with timeout
- *
-*/
-
-
-#include "lockappsleepingnote.h"
-#include <avkon.rsg> // avkon animation resources
-#include <aknnotpi.rsg> // keyguard note resources
-#include <aknnotecontrol.h> // access to note control
-#include "lockapputils.h"
-#include <GlobalWindowPriorities.h>
-
-// ---------------------------------------------------------------------------
-// Pointer to parent (implements MEikCommandObserver) is given in construction.
-// ---------------------------------------------------------------------------
-CLockAppSleepingNote::CLockAppSleepingNote( MEikCommandObserver* aCommandObserver ) :
-	iCommandObserver(aCommandObserver)
-	{
-	}
-
-// ---------------------------------------------------------------------------
-// Note construction on startup.
-// Sleeping note owns a timer that controls the note timeout.
-// ---------------------------------------------------------------------------
-void CLockAppSleepingNote::ConstructSleepingNoteL( TInt aResourceId )
-	{
-	iResourceId = aResourceId;
-	CAknNoteDialog::ConstructSleepingDialogL( aResourceId );
-	// Construct now rather than in PreLayoutDynInit
-	}
-
-// ---------------------------------------------------------------------------
-// In destruction set reference value (is note shown) to not true.
-// ---------------------------------------------------------------------------
-CLockAppSleepingNote::~CLockAppSleepingNote( )
-	{
-	}
-
-// ---------------------------------------------------------------------------
-// Show note with timeout.
-// ---------------------------------------------------------------------------
-TInt CLockAppSleepingNote::ShowNote( const TInt aTimeout, const TTone aTone )
-	{
-	ReportUserActivity( );
-	iTimeoutInMicroseconds = aTimeout;
-	iTone = aTone;
-	return RouseSleepingDialog( );
-	}
-
-// ---------------------------------------------------------------------------
-// Key events are handled here.
-// ---------------------------------------------------------------------------
-TKeyResponse CLockAppSleepingNote::OfferKeyEventL( const TKeyEvent& /*aKeyEvent*/, TEventCode /*aType*/)
-	{
-	//return CAknNoteDialog::OfferKeyEventL( aKeyEvent, aType );
-	return EKeyWasConsumed;
-	}
-
-// ---------------------------------------------------------------------------
-// Always called when note exists, the reason (command) for exit
-// is delivered to parent.
-// ---------------------------------------------------------------------------
-TBool CLockAppSleepingNote::OkToExitL( TInt aCommand )
-	{
-	if ( iCommandObserver )
-		{
-		iCommandObserver->ProcessCommandL( aCommand );
-		}
-	return ETrue;
-	}
-
-// ---------------------------------------------------------------------------
-// Always called when note exists, the reason (command) for exit
-// is delivered to parent.
-// ---------------------------------------------------------------------------
-void CLockAppSleepingNote::HandleResourceChange( TInt aType )
-	{
-	if ( aType == KAknsMessageSkinChange )
-		{
-		TInt animationRes(0);
-		switch ( iResourceId )
-			{
-			case R_KEYLOCK_NOTE_KEYLOCKED:
-				animationRes = R_QGN_NOTE_INFO_ANIM;
-				break;
-			case R_KEYLOCK_NOTE_UNLOCK_CONFIRM:
-				animationRes = R_QGN_NOTE_QUERY_ANIM;
-				break;
-			case R_KEYLOCK_NOTE_UNLOCK_ASTERISK:
-				animationRes = R_QGN_NOTE_INFO_ANIM;
-				break;
-			case R_KEYLOCK_NOTE_LOCK_ON:
-				animationRes = R_QGN_NOTE_KEYGUARD_LOCKED_ANIM;
-				break;
-			case R_KEYLOCK_NOTE_LOCK_OFF:
-				animationRes = R_QGN_NOTE_KEYGUARD_OPEN_ANIM;
-				break;
-			case R_KEYLOCK_OFFER_LOCK_NOTE:
-				animationRes = R_QGN_NOTE_QUERY_ANIM;
-				break;
-			default:
-				break;
-			} // end of switch
-
-		if ( animationRes )
-			{
-			CAknNoteControl* ctrl = NoteControl( );
-			if ( ctrl )
-				{
-				TRAP_IGNORE(ctrl->SetAnimationL( animationRes ));
-				}
-			}
-		}
-	CAknNoteDialog::HandleResourceChange( aType );
-	}
--- a/securitydialogs/lockapp/src/lockappstatecontrol.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,945 +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:  Controls lock states (unlocked, keylock, devicelock)
- *
-*/
-
-
-#include "lockappstatecontrol.h"
-
-// child controls
-#include "lockappidlecontrol.h"
-#include "lockappkeyguardcontrol.h"
-#include "lockappdevicelockcontrol.h"
-
-#include "lockapppubsubobserver.h"
-#include "lockappcenrepobserver.h"
-
-#include "lockappkeycapturecontroller.h"
-#include "lockappstatepublisher.h"
-#include "lockappecsdetector.h"
-#include "lockapputils.h"
-#include <featmgr.h>
-
-#include <settingsinternalcrkeys.h>
-#include <ScreensaverInternalPSKeys.h>
-#include <ctsydomainpskeys.h>
-#include <activeidle2domainpskeys.h>
-
-#include "GlobalWindowPriorities.h"
-
-#include <avkon.rsg> // general avkon resources
-#include <aknnotpi.rsg> // keyguard spesific resources
-#include <aknsoundsystem.h>
-#include <AknIncallBubbleNotify.h> // incall bubble
-#include <bautils.h> // BaflUtils
-#include <apgwgnam.h>
-
-#include <keylockpolicyapi.h>
-
-#include <hwrmdomainpskeys.h>
-    TUid KUidFpsCategory = {0x1020507E};
-const		TInt KFpsAuthenticationKey = 1;
-
-// used avkon dialog resources
-_LIT(KRESOURCEFILE, "z:\\resource\\aknnotpi.rsc");
-
-// Visibility gate WG priority's relative offset from ECoeWinPriorityAlwaysAtFront
-// Now equals -1000 to be an absolute 0.
-const TInt KGlobalWindowPriority_LockVisibilityGate = -1000;
-
-// ---------------------------------------------------------------------------
-// Standard Symbian OS construction sequence
-// ---------------------------------------------------------------------------
-CLockAppStateControl* CLockAppStateControl::NewL( )
-    {
-    CLockAppStateControl* self = new (ELeave) CLockAppStateControl();
-    CleanupStack::PushL( self );
-    self->ConstructL( );
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-// Destruction releases key captures.
-// ---------------------------------------------------------------------------
-CLockAppStateControl::~CLockAppStateControl( )
-    {
-    // localized resources are freed
-    if ( iResourceFileOffset )
-        {
-        // We implicitely trust that eikon env exists (though in practice it does not make the
-        // difference as this destructor is really never called...)
-        iEikonEnv->DeleteResourceFile(iResourceFileOffset);
-        }
-
-    // PuSub observers
-    if ( iPSScreenSaverObserver )
-        {
-        delete iPSScreenSaverObserver;
-        iPSScreenSaverObserver = NULL;
-        }
-
-    if ( iPSTelephonyObserver )
-        {
-        delete iPSTelephonyObserver;
-        iPSTelephonyObserver = NULL;
-        }
-
-    if ( iPSGripObserver )
-        {
-        delete iPSGripObserver;
-        iPSGripObserver = NULL;
-        }
-
-    if ( iPSFPSObserver )
-        {
-        delete iPSFPSObserver;
-        iPSFPSObserver = NULL;
-        }
-
-    CLockAppKeyCaptureController::Destroy( );
-
-    if ( iIncallBubble )
-        {
-        delete iIncallBubble;
-        iIncallBubble = NULL;
-        }
-
-    if ( iSoundsMuted )
-        {
-        MuteSounds( EFalse );
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// The uninitialized status is ELockNoteActive.
-// ---------------------------------------------------------------------------
-CLockAppStateControl::CLockAppStateControl( ) :
-    iLockStatus( ELockNotActive),
-    iWGEventGate( iEikonEnv->RootWin()),
-    iEnvState( 0 )
-    {
-    // no implementation required
-    }
-
-// ---------------------------------------------------------------------------
-// All lock state observers are created here.
-// ---------------------------------------------------------------------------
-void CLockAppStateControl::ConstructL( )
-    {
-    INFO( "CLockAppStateControl::ConstructL started" );
-
-    // creates observer list
-    BaseConstructL( );
-
-    // localized resources are loaded
-    TFileName resourceFile;
-    resourceFile.Append( KRESOURCEFILE );
-    BaflUtils::NearestLanguageFile( iEikonEnv->FsSession(), resourceFile );
-    iResourceFileOffset = iEikonEnv->AddResourceFileL(resourceFile);
-
-    // fetch power key configuration from feature manager
-    FeatureManager::InitializeLibL( );
-    iFeatureNoPowerkey = FeatureManager::FeatureSupported( KFeatureIdNoPowerkey );
-    FeatureManager::UnInitializeLib( );
-
-    // allow autoforwarding for the application (stacked bringforwards)
-    iEikonEnv->SetAutoForwarding( ETrue );
-
-    CLockAppKeyCaptureController::InitL( iEikonEnv->RootWin() );
-
-    // Create second windowgroup for visibility gate
-    CreateVisibilityGateWgL( );
-
-    INFO_1( "CLockAppStateControl - EventGate WgID = %d", iWGEventGate.WindowGroupId() );
-    INFO_1( "CLockAppStateControl - VisibilityGate WgID = %d", iWGVisibilityGate.WindowGroupId() );
-
-    //
-    // Construct Controls
-    //
-    iIdle = CLockAppIdleControl::NewL( *this );
-    AddObserverL( iIdle ); // ownership is transfered
-
-    iCurrentControl = iIdle;
-    iCurrentControl->HandleActivateEventL( iEnvState );
-
-    iKeyguard = CLockAppKeyguardControl::NewL( *this );
-    AddObserverL( iKeyguard ); // ownership is transfered
-    
-    RDebug::Printf( "%s %s (%u) iDevicelock=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iDevicelock );
-    iDevicelock = CLockAppDevicelockControl::NewL( *this, iWGVisibilityGate ); 
-    RDebug::Printf( "%s %s (%u) iDevicelock=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iDevicelock );
-    iDevicelock->ConnectToPhoneL( iWGVisibilityGate );
-    RDebug::Printf( "%s %s (%u) iDevicelock=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iDevicelock );
-    AddObserverL( iDevicelock ); // ownership is transfered
-
-    // Emergency support
-    iLockEcsDetector = CLockAppEcsDetector::NewL( );
-    AddObserverL( iLockEcsDetector ); // ownership is transfered
-
-    // Lock state publisher
-    CLockAppStatePublisher* lockPublisher = CLockAppStatePublisher::NewL( );
-    AddObserverL( lockPublisher ); // ownership is transfered
-
-    // PubSub observers
-    iPSScreenSaverObserver = CLockAppPubSubObserver::NewL( this, KPSUidScreenSaver, KScreenSaverOn );
-    iPSTelephonyObserver = CLockAppPubSubObserver::NewL( this, KPSUidCtsyCallInformation, KCTsyCallState );
-    iPSGripObserver = CLockAppPubSubObserver::NewL( this, KPSUidHWRM, KHWRMGripStatus );
-
-    iPSFPSObserver = CLockAppPubSubObserver::NewL( this, KUidFpsCategory, KFpsAuthenticationKey );
-
-    // Call bubble
-    iIncallBubble = CAknIncallBubble::NewL( );
-
-    ActivateL( );
-
-    INFO( "CLockAppStateControl::ConstructL completed" );
-    }
-
-// ---------------------------------------------------------------------------
-// Create visibility gate window group
-// ---------------------------------------------------------------------------
-void CLockAppStateControl::CreateVisibilityGateWgL( )
-    {
-    INFO( "CLockAppStateControl - CreateVisibilityGateL" );
-
-    iWGVisibilityGate = RWindowGroup( iCoeEnv->WsSession( ) );
-    User::LeaveIfError( iWGVisibilityGate.Construct( (TUint32) &iWGVisibilityGate ) );
-
-    /* hide this window group from the app switcher */
-    iWGVisibilityGate.SetOrdinalPosition( 0, ECoeWinPriorityNeverAtFront );
-    iWGVisibilityGate.EnableReceiptOfFocus( EFalse );
-
-    /*CApaWindowGroupName* wn = CApaWindowGroupName::NewLC( ws );
-    wn->SetHidden( ETrue );
-    wn->SetWindowGroupName( iWGVisibilityGate );
-    CleanupStack::PopAndDestroy( wn );*/
-    }
-
-// ---------------------------------------------------------------------------
-// This method should be called to enable keyguard.
-// ---------------------------------------------------------------------------
-TInt CLockAppStateControl::EnableKeyguardL( TBool aWithNote )
-    {
-    INFO_1( "CLockAppStateControl::EnableKeyguardL aWithNote= %d", aWithNote );
-    TInt err = CheckIfLegal( ELockAppEnableKeyguard );
-    if ( err == KErrNone && !iKeyguard->ActivationAllowedL( ) )
-        {
-        err = KErrPermissionDenied;
-        }
-    if ( err == KErrNone )
-        {
-        PostStatusChangeL( EKeyguardActive );
-        __ASSERT_DEBUG( iLockStatus == EKeyguardActive, DoPanic(ELockIllegalState));
-        INFO( "CLockAppStateControl - Keyguard Enabled" );
-        if ( aWithNote )
-            {
-            iKeyguard->DisplayKeysLockedNote( );
-            }
-        }
-    return err;
-    }
-
-// ---------------------------------------------------------------------------
-// This method should be called to disable keyguard.
-// ---------------------------------------------------------------------------
-TInt CLockAppStateControl::DisableKeyguardL( TBool aWithNote )
-    {
-    INFO_1( "CLockAppStateControl::DisableKeyguardL aWithNote= %d", aWithNote );
-    TInt err = CheckIfLegal( ELockAppDisableKeyguard );
-    if ( err == KErrNone && !iKeyguard->DeActivationAllowedL( ) )
-        {
-        err = KErrPermissionDenied;
-        }
-    if ( err == KErrNone )
-        {
-        PostStatusChangeL( ELockNotActive );
-        __ASSERT_DEBUG( iLockStatus == ELockNotActive, DoPanic(ELockIllegalState));
-        INFO( "CLockAppStateControl - Keyguard Disabled" );
-        if ( aWithNote )
-            {
-            iKeyguard->DisplayKeysActiveNote( );
-            }
-        }
-    return err;
-    }
-
-// ---------------------------------------------------------------------------
-// This method should be called to enable device lock.
-// ---------------------------------------------------------------------------
-TInt CLockAppStateControl::EnableDevicelockL( TDevicelockReason aReason )
-    {
-    INFO_1( "CLockAppStateControl::EnableDevicelockL aReason= %d", aReason );
-    RDebug::Printf( "%s %s (%u) iDevicelock=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iDevicelock );
-    TInt err = CheckIfLegal( ELockAppEnableDevicelock );
-    if ( err == KErrNone && !iDevicelock->ActivationAllowedL( aReason ) )
-        {
-        err = KErrPermissionDenied;
-        }
-    if ( err == KErrNone )
-        {
-        PostStatusChangeL( EDevicelockActive );
-        __ASSERT_DEBUG( iLockStatus == EDevicelockActive, DoPanic(ELockIllegalState));
-        iDevicelock->SetLockingReason( aReason );
-        INFO( "CLockAppStateControl - Devicelock Enabled" );
-        }
-    return err;
-    }
-
-// ---------------------------------------------------------------------------
-// This method should be called to disable device lock.
-// ---------------------------------------------------------------------------
-TInt CLockAppStateControl::DisableDevicelockL( )
-    {
-    INFO_1( "CLockAppStateControl::DisableDevicelockL 1= %d", 1 );
-    TInt err = CheckIfLegal( ELockAppDisableDevicelock );
-    if ( err == KErrNone && !iDevicelock->DeActivationAllowedL( ) )
-        {
-        err = KErrPermissionDenied;
-        }
-    if ( err == KErrNone )
-        {
-        PostStatusChangeL( ELockNotActive );
-        __ASSERT_DEBUG( iLockStatus == ELockNotActive, DoPanic(ELockIllegalState));
-        INFO( "CLockAppStateControl - Devicelock Disabled" );
-        }
-    return err;
-    }
-
-// ---------------------------------------------------------------------------
-// Checks if offer keyguard is allowed and if it is, offers to lock keyguard.
-// ---------------------------------------------------------------------------
-TInt CLockAppStateControl::OfferKeyguard( )
-    {
-    INFO_1( "CLockAppStateControl::OfferKeyguard 1= %d", 1 );
-    TInt err = CheckIfLegal( ELockAppOfferKeyguard );
-    if ( err == KErrNone )
-        {
-        __ASSERT_DEBUG( iLockStatus == ELockNotActive, DoPanic(ELockIllegalState));
-        INFO( "CLockAppStateControl - OfferKeyguard" );
-        iIdle->OfferKeyLock( );
-        }
-    return err;
-    }
-
-// ---------------------------------------------------------------------------
-// Shows keys locked note if keyguard is enabled.
-// ---------------------------------------------------------------------------
-TInt CLockAppStateControl::ShowKeysLockedNote( )
-    {
-    INFO_1( "CLockAppStateControl::ShowKeysLockedNote 1= %d", 1 );
-    TInt err = CheckIfLegal( ELockAppShowKeysLockedNote );
-    if ( err == KErrNone )
-        {
-        __ASSERT_DEBUG( iLockStatus == EKeyguardActive, DoPanic(ELockIllegalState));
-        INFO( "CLockAppStateControl - ShowKeysLockedNote" );
-        iKeyguard->DisplayLockedNote( );
-        }
-    return err;
-    }
-
-// ---------------------------------------------------------------------------
-// A method for returning the lock status.
-// ---------------------------------------------------------------------------
-TLockStatus CLockAppStateControl::LockStatus( ) const
-    {
-    INFO_1( "CLockAppStateControl::LockStatus iLockStatus= %d", iLockStatus );
-    return iLockStatus;
-    }
-
-// ---------------------------------------------------------------------------
-// A method for returning the environment status bitmask.
-// ---------------------------------------------------------------------------
-TUint CLockAppStateControl::EnvironmentStatus( ) const
-    {
-    return iEnvState;
-    }
-
-// ---------------------------------------------------------------------------
-// A method for executing different internal tests.
-// ---------------------------------------------------------------------------
-TInt CLockAppStateControl::ExecuteInternalTest( )
-    {
-#ifdef _DEBUG
-    return iLockEcsDetector->TestEcsNote( );
-#else
-    return KErrNone;
-#endif
-    }
-
-// ---------------------------------------------------------------------------
-// Number of owned UI controls (idle, keyguard, devicelock)
-// ---------------------------------------------------------------------------
-TInt CLockAppStateControl::CountComponentControls( ) const
-    {
-    return 3;
-    }
-
-// ---------------------------------------------------------------------------
-// Owned UI controls (idle, keyguard, devicelock)
-// ---------------------------------------------------------------------------
-CCoeControl* CLockAppStateControl::ComponentControl( TInt aIndex ) const
-    {
-    RDebug::Printf( "%s %s (%u) aIndex=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aIndex );
-    switch ( aIndex )
-        {
-        case 0:
-            return iIdle;
-        case 1:
-            return iKeyguard;
-        case 2:
-     		    RDebug::Printf( "%s %s (%u) iDevicelock=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iDevicelock );
-            return iDevicelock;
-        default:
-            return NULL;
-        }
-    }
-
-// ----------------------------------------------------------
-// Handle window-server events
-// ----------------------------------------------------------
-void CLockAppStateControl::HandleWsEventL( const TWsEvent& aEvent, CCoeControl* /*aDestination*/)
-    {
-    TInt type = aEvent.Type( );
-    	RDebug::Printf( "%s %s (%u) type=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, type );
-    switch ( type )
-        {
-        case KAknFullOrPartialForegroundLost: // partial or full fg lost
-        case KAknFullOrPartialForegroundGained: // partial or full fg gained
-            {
-    				RDebug::Printf( "%s %s (%u) type=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, type );
-            RWsSession& ws = iCoeEnv->WsSession( );
-            TFileName windowName;
-            TInt fwgid = ws.GetFocusWindowGroup( );
-            ws.GetWindowGroupNameFromIdentifier( fwgid, windowName );
-            INFO_3( "CLockAppStateControl::HandleWsEventL type: %d - FocusWg: %d %S", type, fwgid, &windowName);
-            }
-            break;
-        case EEventKeyUp:
-        case EEventKey:
-        case EEventKeyDown:
-        		{
-        		RDebug::Printf( "%s %s (%u) EEventKey*=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, EEventKeyDown );
-        		TKeyEvent* aKeyEvent = aEvent.Key();
-        		TKeyResponse response = OfferKeyEventL( *aKeyEvent, (TEventCode)type );
-        		}
-            break;
-        default:
-            break;
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// From @c CAknAppUiBase. Overriden the parent method, because otherwise
-// the main lock state control would not receive the call, because is is not
-// window-owning control (=without window->not visible). The call is needed
-// because the main state control owns window-owning child controls.
-// ---------------------------------------------------------------------------
-void CLockAppStateControl::HandleResourceChange( TInt aType )
-    {
-    // these would not normally get handleresource call since they do not own window
-		RDebug::Printf( "%s %s (%u) aType=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aType );
-	if(iIdle)
-		iIdle->HandleResourceChange( aType );
-	if(iKeyguard)
-		iKeyguard->HandleResourceChange( aType );
-	if(iDevicelock)
-		iDevicelock->HandleResourceChange( aType );
-    // call parent
-    CCoeControl::HandleResourceChange( aType );
-    }
-
-// ---------------------------------------------------------------------------
-// Update the environment state variable with the event.
-// ---------------------------------------------------------------------------
-TBool CLockAppStateControl::HandleEnvironmentChange( TUint aEventMask, TBool aEnable )
-    {
-    // check if there will be a change
-
-    if ( IsBitFieldSet( iEnvState, aEventMask ) != aEnable )
-        {
-        // set the bit-field
-        SetBitField( iEnvState, aEventMask, aEnable );
-        // notify current control
-        __ASSERT_DEBUG( iCurrentControl, DoPanic(ELockIllegalState));
-        iCurrentControl->HandleEnvironmentChange( iEnvState, aEventMask );
-        // return true because the environment changed
-        return ETrue;
-        }
-    return EFalse;
-    }
-
-// ---------------------------------------------------------------------------
-// Handle all Central Repository observer callbacks.
-// ---------------------------------------------------------------------------
-void CLockAppStateControl::HandleCenRepNotify(TUid aCenRepUid, TUint32 aKeyId, TInt aValue )
-    {
-    	RDebug::Printf( "%s %s (%u) ???? Nothing done for aKeyId=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aKeyId );
-
-    INFO_3( "CLockAppStateControl::HandleCenRepNotify %d %d = %d", aCenRepUid.iUid, aKeyId, aValue );
-    }
-
-// ---------------------------------------------------------------------------
-// Handle all Publish & Subscribe observer callbacks.
-// ---------------------------------------------------------------------------
-void CLockAppStateControl::HandlePubSubNotify(TUid aPubSubUid, TUint aKeyId, TInt aValue )
-    {
-    INFO_3( "CLockAppStateControl::HandlePubSubNotify %x %x = %d", aPubSubUid.iUid, aKeyId, aValue );
-    INFO_3( "CLockAppStateControl::HandlePubSubNotify KPSUidScreenSaver=%x KPSUidCtsyCallInformation=%x KPSUidAiInformation=%x", KPSUidScreenSaver, KPSUidCtsyCallInformation, KPSUidAiInformation );
-    INFO_3( "CLockAppStateControl::HandlePubSubNotify KPSUidHWRM=%x KHWRMGripStatus=%x KPSUidAiInformation=%x", KPSUidHWRM, KHWRMGripStatus, KPSUidAiInformation );
-    if ( aPubSubUid == KPSUidScreenSaver )
-        {
-        switch ( aKeyId )
-            {
-            case KScreenSaverOn:
-                {
-                INFO_1("CLockAppStateControl::ScreenSaver - %d", (aValue > 0));
-                HandleEnvironmentChange( KLockAppEnvScreenSaverOn, (aValue > 0) );
-                }
-                break;
-            default:
-                break;
-            }
-        }
-    else if ( aPubSubUid == KPSUidCtsyCallInformation )
-        {
-        switch ( aKeyId )
-            {
-            case KCTsyCallState:
-                {
-                PrintCallState( aValue );
-                HandleEnvironmentChange( KLockAppEnvPhonecallOngoing, (aValue > EPSCTsyCallStateNone) );
-                }
-                break;
-            default:
-                break;
-            }
-        }
-    else if ( aPubSubUid == KPSUidAiInformation )	// ActiveIdle
-            {
-            switch ( aKeyId )
-                {
-                case KActiveIdleState:
-                    {
-                    INFO_1("CLockAppStateControl::ActiveIdle - %d", (aValue == EPSAiForeground));
-                    HandleEnvironmentChange( KLockAppEnvIdleOnForeground, (aValue == EPSAiForeground) );
-                    }
-                    break;
-                default:
-                    break;
-                }
-            }
-    else if ( aPubSubUid == KPSUidHWRM )
-        {
-        switch ( aKeyId )
-            {
-            case KHWRMGripStatus:
-                {
-                INFO_1("CLockAppStateControl::Grip - %d", aValue );
-                HandleEnvironmentChange( KLockAppEnvGrip, (aValue == EPSHWRMGripOpen) );
-                }
-                break;
-            default:
-                break;
-            }
-        }
-    else if ( aPubSubUid == KUidFpsCategory )
-        {
-        switch ( aKeyId )
-            {
-            case KFpsAuthenticationKey:
-                {
-                INFO_1("CLockAppStateControl::Grip - %d", aValue );
-                #define EAuthenticationSuccess 1
-                HandleEnvironmentChange( KLockAppEnvFPS, (aValue == EAuthenticationSuccess) );
-                }
-                break;
-            default:
-                break;
-            }
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// All keyevents should go trough here.
-// ---------------------------------------------------------------------------
-TKeyResponse CLockAppStateControl::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType )
-    {
-    	RDebug::Printf( "%s %s (%u) iDevicelock=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iDevicelock );
-    	RDebug::Printf( "%s %s (%u) aKeyEvent.iCode=%x aType=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aKeyEvent.iCode, aType );
-    TKeyResponse keyResponse = PreCheckKeyEvents( aKeyEvent, aType );
-    if ( keyResponse == EKeyWasNotConsumed )
-        {
-        if ( aKeyEvent.iRepeats == 0 )
-            {
-            // handle only without the repeats
-            INFO_3("KeyEvent %d, %d, %d", aType, aKeyEvent.iCode, aKeyEvent.iScanCode );
-            __ASSERT_DEBUG( iCurrentControl, DoPanic(ELockIllegalState));
-            keyResponse = iCurrentControl->OfferKeyEventL( aKeyEvent, aType );
-            }
-        else
-            {
-            // set consumed which are repeated
-            keyResponse = EKeyWasConsumed;
-            }
-        }
-
-    return keyResponse;
-    }
-
-// ---------------------------------------------------------------------------
-// From @c CLockAppObserverList. The main state control is the first
-// to handle the lock state changes, locks/unlocks the phone depending
-// on the state change.
-// ---------------------------------------------------------------------------
-void CLockAppStateControl::HandleLockStatusChangedL( TLockStatus aLockStatus )
-    {    
-    __ASSERT_DEBUG( iCurrentControl, DoPanic(ELockIllegalState));
-    INFO_1("CLockAppStateControl::HandleLockStatusChangedL - %d", aLockStatus);
-    iCurrentControl->HandleDeActivateEventL( iEnvState );
-
-    switch ( aLockStatus )
-        {
-        case ELockNotActive:
-            {
-            iCurrentControl = iIdle;
-            MuteSounds( EFalse );
-            BringForward( EFalse );
-            }
-            break;
-        case EKeyguardActive:
-            {
-            iCurrentControl = iKeyguard;
-            MuteSounds( ETrue );
-            BringForward( ETrue );
-            }
-            break;
-        case EDevicelockActive:
-            {
-       	    RDebug::Printf( "%s %s (%u) iDevicelock=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iDevicelock );
-            iCurrentControl = iDevicelock;
-            MuteSounds( ETrue );
-            BringForward( ETrue );
-            }
-            break;
-        default:
-        		INFO_1("CLockAppStateControl::HandleLockStatusChangedL - ???? aLockStatus=%d", aLockStatus);
-            DoPanic( ELockUnknownValue );
-            break;
-        }
-
-    __ASSERT_DEBUG( iCurrentControl, DoPanic(ELockIllegalState));
-    iCurrentControl->HandleActivateEventL( iEnvState );
-
-    // finally we update the value (only place were changing the status is allowed)
-    iLockStatus = aLockStatus;
-    }
-
-// ---------------------------------------------------------------------------
-// Check if requested transition is valid.
-// ---------------------------------------------------------------------------
-TInt CLockAppStateControl::CheckIfLegal( TLockAppMessageReason aReason )
-    {
-    INFO_1("CLockAppStateControl::CheckIfLegal aReason=%d", aReason);
-    INFO_1("CLockAppStateControl::CheckIfLegal iLockStatus=%d", iLockStatus);
-    switch ( aReason )
-        {
-        case ELockAppEnableKeyguard:
-            {
-           	RDebug::Printf( "%s %s (%u) ELockAppEnableKeyguard iLockStatus=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iLockStatus );
-            switch ( iLockStatus )
-                {
-                case ELockNotActive:
-                    if ( !CKeyLockPolicyApi::KeyguardAllowed() )
-                        return KErrPermissionDenied;
-                    else
-                        return KErrNone;
-                case EKeyguardActive:
-                    return KErrAlreadyExists;
-                case EDevicelockActive:
-                    return KErrPermissionDenied;
-                }
-            }
-            break;
-        case ELockAppDisableKeyguard:
-            {
-           	RDebug::Printf( "%s %s (%u) ELockAppDisableKeyguard iLockStatus=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iLockStatus );
-            switch ( iLockStatus )
-                {
-                case ELockNotActive:
-                    return KErrAlreadyExists;
-                case EKeyguardActive:
-                    return KErrNone;
-                case EDevicelockActive:
-                    return KErrPermissionDenied;
-                }
-            }
-            break;
-        case ELockAppEnableDevicelock:
-            {
-           	RDebug::Printf( "%s %s (%u) ELockAppEnableDevicelock iLockStatus=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iLockStatus );
-            switch ( iLockStatus )
-                {
-                case ELockNotActive:
-                    return KErrNone;
-                case EKeyguardActive:
-                    return KErrNone;
-                case EDevicelockActive:
-                    return KErrAlreadyExists;
-                }
-            }
-            break;
-        case ELockAppDisableDevicelock:
-            {
-           	RDebug::Printf( "%s %s (%u) ELockAppDisableDevicelock iLockStatus=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iLockStatus );
-            switch ( iLockStatus )
-                {
-                case ELockNotActive:
-                    return KErrAlreadyExists;
-                case EKeyguardActive:
-                    return KErrPermissionDenied;
-                case EDevicelockActive:
-                    return KErrNone;
-                }
-            }
-            break;
-        case ELockAppOfferKeyguard:
-            {
-           	RDebug::Printf( "%s %s (%u) ELockAppOfferKeyguard iLockStatus=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iLockStatus );
-            switch ( iLockStatus )
-                {
-                case ELockNotActive:
-                    return KErrNone;
-                case EKeyguardActive:
-                    return KErrPermissionDenied;
-                case EDevicelockActive:
-                    return KErrPermissionDenied;
-                }
-            }
-            break;
-        case ELockAppShowKeysLockedNote:
-            {
-           	RDebug::Printf( "%s %s (%u) ELockAppShowKeysLockedNote iLockStatus=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iLockStatus );
-            switch ( iLockStatus )
-                {
-                case ELockNotActive:
-                    return KErrPermissionDenied;
-                case EKeyguardActive:
-                    return KErrNone;
-                case EDevicelockActive:
-                    return KErrPermissionDenied;
-                }
-            }
-            break;
-        }
-    return KErrPermissionDenied;
-    }
-
-// ---------------------------------------------------------------------------
-// Prescreen key events for special cases before giving them to child controls
-// ---------------------------------------------------------------------------
-TKeyResponse CLockAppStateControl::PreCheckKeyEvents(const TKeyEvent& aKeyEvent, TEventCode aType )
-    {
-    	RDebug::Printf( "%s %s (%u) aKeyEvent.iCode=%x aType=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aKeyEvent.iCode, aType );
-    TKeyResponse keyResponse = EKeyWasNotConsumed;
-    // power key always turns the lights on
-    CheckForPowerKeyLights( aKeyEvent, aType );
-    if ( iLockEcsDetector->EcsNoteOnScreen( ) )
-        {
-        // the key events are fully handled by the emergency
-        // detector when emergency note is shown
-        keyResponse = EKeyWasConsumed;
-        }
-    else
-        {
-        if ( CheckForPhoneKeys( aKeyEvent, aType ) )
-            {
-            keyResponse = EKeyWasConsumed;
-            }
-        else if ( aKeyEvent.iCode == EKeyLeftShift || aKeyEvent.iCode == EKeyRightShift )
-            {
-            // eat these modifier events as they just cause problems elsewhere
-            keyResponse = EKeyWasConsumed;
-            }
-        }
-    return keyResponse;
-    }
-
-// ---------------------------------------------------------------------------
-// Checks if power key has been pressed and inform the sysap accordingly.
-// ---------------------------------------------------------------------------
-void CLockAppStateControl::CheckForPowerKeyLights( const TKeyEvent& aKeyEvent, TEventCode aType )
-    {
-    // only handle power key when keys are locked
-    	RDebug::Printf( "%s %s (%u) aKeyEvent.iCode=%x aType=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aKeyEvent.iCode, aType );
-    	RDebug::Printf( "%s %s (%u) iLockStatus=%x ELockNotActive=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iLockStatus, ELockNotActive );
-    if ( iLockStatus != ELockNotActive )
-        {
-    		RDebug::Printf( "%s %s (%u) iFeatureNoPowerkey=%x EStdKeyDevice2=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iFeatureNoPowerkey, EStdKeyDevice2 );
-        if ( (aType == EEventKey && aKeyEvent.iRepeats == 0) || (aType == EEventKeyDown && aKeyEvent.iScanCode == EStdKeyDevice2) ) // Power key
-            {
-            // If power key pressed, tell SysAp about if
-            if ( (aKeyEvent.iScanCode == EStdKeyDevice2 && aType == EEventKeyDown) || (iFeatureNoPowerkey && aKeyEvent.iCode == EKeyNo) )
-                {
-                // normal power key event
-                RDebug::Printf( "%s %s (%u) EEikKeyLockPowerKeyPressed=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iFeatureNoPowerkey );
-                SendMessageToSysAp( EEikKeyLockPowerKeyPressed );
-                if ( iFeatureNoPowerkey )
-                    {
-                		RDebug::Printf( "%s %s (%u) EEikKeyLockLightsOnRequest=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, EEikKeyLockLightsOnRequest );
-                    // end key as power key needs additional info (ugly solution)
-                    SendMessageToSysAp( EEikKeyLockLightsOnRequest );
-                    }
-                }
-            }
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Checks if green or red key has been pressed and forward it to phone
-// in case there is a phone call ongoing.
-// ---------------------------------------------------------------------------
-TBool CLockAppStateControl::CheckForPhoneKeys( const TKeyEvent& aKeyEvent, TEventCode aType )
-    {
-    	RDebug::Printf( "%s %s (%u) aKeyEvent.iCode=%x aType=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aKeyEvent.iCode, aType );
-#ifndef RD_GLOBALWG_PRIORITY_CHANGE
-    // only handle phone keys when locked and phonecall ongoing
-    	RDebug::Printf( "%s %s (%u) iLockStatus=%x ELockNotActive=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iLockStatus, ELockNotActive );
-    if ( iLockStatus != ELockNotActive )
-        {
-        if ( aKeyEvent.iScanCode == EStdKeyYes || aKeyEvent.iScanCode == EStdKeyNo )
-            {
-            if ( IsBitFieldSet( iEnvState, KLockAppEnvPhonecallOngoing ) )	// TODO what about video-call
-                {
-                // send Green and Red keys to phoneapp's windowgroup
-                INFO( "CLockAppStateControl::CheckForPhoneKeys - SendKeyToPhoneApp");
-                SendKeyToPhoneApp( aKeyEvent, aType );
-                return ETrue;
-                }
-            }
-        }
-#endif // !RD_GLOBALWG_PRIORITY_CHANGE
-    return EFalse;
-    }
-
-// ---------------------------------------------------------------------------
-// Brings foreground/background the root window.
-// ---------------------------------------------------------------------------
-void CLockAppStateControl::BringForward(TBool aForeground )
-    {
-    	RDebug::Printf( "%s %s (%u) aForeground=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aForeground );
-    if ( aForeground )
-        {
-        INFO_4( "CLockAppStateControl::BringForward(1) STA - EvWG(%d,%d) ViWG(%d,%d)",
-                iWGEventGate.OrdinalPosition(), iWGEventGate.OrdinalPriority(),
-                iWGVisibilityGate.OrdinalPosition(), iWGVisibilityGate.OrdinalPriority());
-        // not sure if these cause flush in WindowServer
-        iWGVisibilityGate.SetOrdinalPosition( 0, ECoeWinPriorityAlwaysAtFront + KGlobalWindowPriority_LockVisibilityGate );
-        iWGEventGate.SetOrdinalPosition( 0, ECoeWinPriorityAlwaysAtFront + KGlobalWindowPriority_LockVisibilityGate );
-        iEikonEnv->BringForwards( ETrue, ECoeWinPriorityAlwaysAtFront + KGlobalWindowPriority_KeyLock );
-        /*if ( iIncallBubble )
-            {
-            iIncallBubble->SetIncallBubbleAllowedInIdleL( ETrue );
-            }*/
-        }
-    else
-        {
-        INFO_4( "CLockAppStateControl::BringForward(0) STA - EvWG(%d,%d) ViWG(%d,%d)",
-                iWGEventGate.OrdinalPosition(), iWGEventGate.OrdinalPriority(),
-                iWGVisibilityGate.OrdinalPosition(), iWGVisibilityGate.OrdinalPriority());
-
-        // not sure if these cause flush in WindowServer
-        iWGVisibilityGate.SetOrdinalPosition( 0, ECoeWinPriorityNeverAtFront );
-		iWGEventGate.SetOrdinalPosition( 0, ECoeWinPriorityNeverAtFront );
-        iEikonEnv->BringForwards( EFalse );
-        /*if ( iIncallBubble )
-            {
-            iIncallBubble->SetIncallBubbleAllowedInIdleL( EFalse );
-            }*/
-        }
-
-    INFO_4( "CLockAppStateControl::BringForward END - EvWG(%d,%d) ViWG(%d,%d)",
-            iWGEventGate.OrdinalPosition(), iWGEventGate.OrdinalPriority(),
-            iWGVisibilityGate.OrdinalPosition(), iWGVisibilityGate.OrdinalPriority());
-    }
-
-// ---------------------------------------------------------------------------
-// Mute key sounds when phone is locked.
-// ---------------------------------------------------------------------------
-void CLockAppStateControl::MuteSounds(TBool aMuteSounds )
-    {
-    	RDebug::Printf( "%s %s (%u) aMuteSounds=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aMuteSounds );
-    if ( iSoundsMuted != aMuteSounds )
-        {
-        if ( aMuteSounds )
-            {
-            TRAPD(err, iAvkonAppUiBase->KeySounds()->PushContextL(R_AVKON_SILENT_SKEY_LIST))
-            if ( !err )
-                {
-                iAvkonAppUiBase->KeySounds()->BringToForeground();
-                iAvkonAppUiBase->KeySounds()->LockContext();
-                iSoundsMuted = ETrue;
-                }
-            }
-        else
-            {
-            iAvkonAppUiBase->KeySounds()->ReleaseContext();
-            iAvkonAppUiBase->KeySounds()->PopContext();
-            iSoundsMuted = EFalse;
-            }
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Print out call state.
-// ---------------------------------------------------------------------------
-void CLockAppStateControl::PrintCallState( TInt aValue )
-    {
-    RDebug::Printf( "%s %s (%u) aValue=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aValue );
-    switch ( aValue )
-        {
-        case EPSCTsyCallStateUninitialized:
-            INFO("CLockAppStateControl::PrintCallState - Uninitialized")
-            break;
-        case EPSCTsyCallStateNone:
-            INFO("CLockAppStateControl::PrintCallState - None")
-            break;
-        case EPSCTsyCallStateAlerting:
-            INFO("CLockAppStateControl::PrintCallState - Alerting")
-            break;
-        case EPSCTsyCallStateRinging:
-            INFO("CLockAppStateControl::PrintCallState - Ringing")
-            break;
-        case EPSCTsyCallStateDialling:
-            INFO("CLockAppStateControl::PrintCallState - Dialling")
-            break;
-        case EPSCTsyCallStateAnswering:
-            INFO("CLockAppStateControl::PrintCallState - Answering")
-            break;
-        case EPSCTsyCallStateDisconnecting:
-            INFO("CLockAppStateControl::PrintCallState - Disconnecting")
-            break;
-        case EPSCTsyCallStateConnected:
-            INFO("CLockAppStateControl::PrintCallState - Connected")
-            break;
-        case EPSCTsyCallStateHold:
-            INFO("CLockAppStateControl::PrintCallState - Hold")
-            break;
-        default:
-            break;
-        }
-    }
-
-// END OF FILE
--- a/securitydialogs/lockapp/src/lockappstatepublisher.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +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:  Publishes LockApp states to other applications
- *
-*/
-
-
-#include "lockappstatepublisher.h"
-#include "lockapputils.h"
-
-// defines keys KPSUidAvkonDomain, KAknKeyguardStatus, TAknKeyguardStatus
-#include <avkondomainpskeys.h>
-
-// ---------------------------------------------------------------------------
-// Standard Symbian OS construction sequence
-// ---------------------------------------------------------------------------
-CLockAppStatePublisher* CLockAppStatePublisher::NewL( )
-    {
-    CLockAppStatePublisher* self = new (ELeave) CLockAppStatePublisher();
-    CleanupStack::PushL( self );
-    self->ConstructL( );
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-// Standard C++ constructor
-// ---------------------------------------------------------------------------
-CLockAppStatePublisher::CLockAppStatePublisher()
-    {
-    // no implementation required
-    }
-
-// ---------------------------------------------------------------------------
-// Closes the property handle.
-// ---------------------------------------------------------------------------
-CLockAppStatePublisher::~CLockAppStatePublisher()
-    {
-    iStatusProperty.Close();
-    }
-
-// ---------------------------------------------------------------------------
-// Defines the P&S key storing keyguard status
-// ---------------------------------------------------------------------------
-void CLockAppStatePublisher::ConstructL()
-    {
-    // for some reason P&S capability policy macros do not work with codetest
-#ifdef _LOCKAPP_CODETEST_DEBUG
-    RProperty::Define(
-        KPSUidAvkonDomain,
-        KAknKeyguardStatus,
-        RProperty::EInt,
-        TSecurityPolicy(TSecurityPolicy::EAlwaysPass),
-        TSecurityPolicy(TSecurityPolicy::EAlwaysPass));
-#else
-    // defines the P&S key
-    _LIT_SECURITY_POLICY_C1(KWritePolicy, ECapabilityWriteDeviceData);
-    RProperty::Define(
-        KPSUidAvkonDomain,
-        KAknKeyguardStatus,
-        RProperty::EInt,
-        TSecurityPolicy(TSecurityPolicy::EAlwaysPass),
-        KWritePolicy);
-#endif
-    // creates handle to property
-    iStatusProperty.Attach(KPSUidAvkonDomain, KAknKeyguardStatus);
-    }
-
-// ---------------------------------------------------------------------------
-// From @c CLockAppStateObserver. Used to publish lockapp state
-// to external parties.
-// ---------------------------------------------------------------------------
-void CLockAppStatePublisher::HandleLockStatusChangedL( TLockStatus aLockStatus )
-    {
-    switch ( aLockStatus )
-        {
-        case ELockNotActive:
-            {
-            iStatusProperty.Set(EKeyguardNotActive);
-            }
-            break;
-        case EDevicelockActive:
-            {
-            iStatusProperty.Set(EKeyguardAutolockEmulation);
-            }
-            break;
-        case EKeyguardActive:
-            {
-            iStatusProperty.Set(EKeyguardLocked);
-            }
-            break;
-        default:
-            DoPanic(ELockUnknownValue);
-            break;
-        }
-    }
--- a/securitydialogs/lockapp/src/lockapputils.cpp	Thu Aug 19 10:45:23 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:  Lock App internal utils
- *
-*/
-
-
-#include <e32base.h>
-#include <coemain.h>
-#include <apgwgnam.h>
-#include "lockapputils.h"
-
-#define KSysApUid TUid::Uid(0x100058F3)
-#define KPhoneAppUid TUid::Uid(0x100058B3)
-
-// ---------------------------------------------------------------------------
-// Queries bits in aStatusMask specified by the aQueryMask
-// ---------------------------------------------------------------------------
-TBool IsBitFieldSet( TUint aStatusMask, TUint aQueryMask )
-    {
-    return (aStatusMask & aQueryMask);
-    }
-
-// ---------------------------------------------------------------------------
-// Sets bits in aResultMask specified by the aSetMask
-// ---------------------------------------------------------------------------
-void SetBitField( TUint &aResultMask, TUint aSetMask, TBool aSet )
-    {
-    if ( aSet )
-        {
-        aResultMask = aResultMask | aSetMask;
-        }
-    else
-        {
-        aResultMask = aResultMask & ~ aSetMask;
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Panic function for LockApp internal panics.
-// ---------------------------------------------------------------------------
-void DoPanic( TLockAppPanic aPanic )
-    {
-    _LIT(KPanic,"LockApp");
-    User::Panic( KPanic, aPanic );
-    }
-
-// ---------------------------------------------------------------------------
-// Causes client Panic (illegal use of the server services).
-// Used RMessagePtr2::Panic() also completes the message.
-// ---------------------------------------------------------------------------
-void PanicClient(const RMessagePtr2& aMessage, TLockAppPanic aPanic )
-    {
-    _LIT(KPanic, "LockAppServer");
-    aMessage.Panic( KPanic, aPanic );
-    }
-
-// ---------------------------------------------------------------------------
-// Sends application spesific events to Sysap.
-// Used mainly for lights control.
-// ---------------------------------------------------------------------------
-void SendMessageToSysAp( TInt aMessage )
-    {
-    RWsSession& ws = CCoeEnv::Static()->WsSession( );
-    TInt wgId = 0;
-    CApaWindowGroupName::FindByAppUid( KSysApUid, ws, wgId );
-
-    // if sysap window group exists
-    if ( wgId )
-        {
-        TWsEvent event;
-        event.SetType( aMessage );
-        event.SetTimeNow( );
-        ws.SendEventToWindowGroup( wgId, event );
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Sends a key event to the windowgroup in background.
-// Used mainly for sending red and green keys to phone app when
-// devicelock or keyguard is in foreground.
-// ---------------------------------------------------------------------------
-void SendKeyToPhoneApp( const TKeyEvent& aKey, TEventCode aType )
-    {
-    RWsSession& ws = CCoeEnv::Static()->WsSession( );
-    TInt wgId = 0;
-    CApaWindowGroupName::FindByAppUid( KPhoneAppUid, ws, wgId );
-
-    // if sysap window group exists
-    if ( wgId )
-        {
-        TWsEvent event;
-        *event.Key() = aKey;
-        event.SetType( aType );
-        event.SetTimeNow( );
-        ws.SendEventToWindowGroup( wgId, event );
-        }
-    }
-
-// END OF FILE
--- a/securitydialogs/lockapp/src/lockappwait.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,176 +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:  Async-Sync utility class
- *
-*/
-
-
-#include <e32base.h>
-#include <eikenv.h>
-#include <eikappui.h>
-#include "lockappwait.h"
-
-// ----------------------------------------------------------
-// Standard Symbian OS construction sequence
-// ----------------------------------------------------------
-//
-CWait* CWait::NewL( )
-    {
-    CWait* self = new (ELeave) CWait( );
-    CleanupStack::PushL( self );
-    self->ConstructL( );
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// ----------------------------------------------------------
-// 2nd phase constructor.
-// ----------------------------------------------------------
-//
-void CWait::ConstructL( )
-    {
-    CActiveScheduler::Add( this );
-    }
-
-// ----------------------------------------------------------
-// Constructor
-// ----------------------------------------------------------
-//
-CWait::CWait( ) :
-    CActive(0)
-    {
-    // no implementation required
-    }
-
-// ----------------------------------------------------------
-// Destructor.
-// ----------------------------------------------------------
-//
-CWait::~CWait( )
-    {
-    Cancel( );
-    }
-
-// ----------------------------------------------------------
-//
-// ----------------------------------------------------------
-//
-TInt CWait::WaitForRequestL( )
-    {
-    CWaitAbsorbingControl* absorbing = CWaitAbsorbingControl::NewLC( );
-    SetActive( );
-    iWait.Start( );
-    CleanupStack::PopAndDestroy( absorbing );
-    return iStatus.Int( );
-    }
-
-// ----------------------------------------------------------
-//
-// ----------------------------------------------------------
-//
-void CWait::RunL( )
-    {
-    if ( iWait.IsStarted( ) )
-        {
-        iWait.AsyncStop( );
-        }
-    }
-
-// ----------------------------------------------------------
-// Cancels code request
-// ----------------------------------------------------------
-//
-void CWait::DoCancel( )
-    {
-    if ( iWait.IsStarted( ) )
-        {
-        iWait.AsyncStop( );
-        }
-    }
-
-// ----------------------------------------------------------
-// Sets active request type
-// ----------------------------------------------------------
-//
-void CWait::SetRequestType(TInt aRequestType )
-    {
-    iRequestType = aRequestType;
-    }
-
-// ----------------------------------------------------------
-// Gets active request type
-// ----------------------------------------------------------
-//
-TInt CWait::GetRequestType( )
-    {
-    return iRequestType;
-    }
-
-// ----------------------------------------------------------
-// Standard Symbian OS construction sequence
-// ----------------------------------------------------------
-//
-CWaitAbsorbingControl* CWaitAbsorbingControl::NewLC( )
-    {
-    CWaitAbsorbingControl* self= new (ELeave) CWaitAbsorbingControl();
-    CleanupStack::PushL( self );
-    self->ConstructL( );
-    return self;
-    }
-
-// ----------------------------------------------------------
-//
-// ----------------------------------------------------------
-//
-CWaitAbsorbingControl::CWaitAbsorbingControl( )
-    {
-    // no implementation required
-    }
-
-// ----------------------------------------------------------
-// Destructor.
-// ----------------------------------------------------------
-//
-CWaitAbsorbingControl::~CWaitAbsorbingControl( )
-    {
-    if ( iCoeEnv && iAppUi )
-        iAppUi->RemoveFromStack( this );
-    }
-
-// ----------------------------------------------------------
-//
-// ----------------------------------------------------------
-//
-void CWaitAbsorbingControl::ConstructL( )
-    {
-    CreateWindowL( );
-    SetExtent( TPoint( 0, 0 ), TSize( 0, 0 ) );
-    ActivateL( );
-    SetPointerCapture( ETrue );
-    ClaimPointerGrab( ETrue );
-    iAppUi = iEikonEnv->EikAppUi();
-    iAppUi->AddToStackL( this, ECoeStackPriorityEnvironmentFilter );
-    }
-
-// ----------------------------------------------------------
-//
-// ----------------------------------------------------------
-//
-TKeyResponse CWaitAbsorbingControl::OfferKeyEventL(const TKeyEvent& /*aKeyEvent*/, TEventCode /*aType*/)
-    {
-    	RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 );
-    return EKeyWasConsumed;
-    }
-
-// End of file
--- a/securitydialogs/lockclient/eabi/lockclientu.def	Thu Aug 19 10:45:23 2010 +0300
+++ b/securitydialogs/lockclient/eabi/lockclientu.def	Tue Aug 31 16:04:40 2010 +0300
@@ -21,8 +21,4 @@
 	_ZN20CDevicelockAccessApiD0Ev @ 20 NONAME
 	_ZN20CDevicelockAccessApiD1Ev @ 21 NONAME
 	_ZN20CDevicelockAccessApiD2Ev @ 22 NONAME
-	_ZTI18CKeyguardAccessApi @ 23 NONAME ; #<TI>#
-	_ZTI20CDevicelockAccessApi @ 24 NONAME ; #<TI>#
-	_ZTV18CKeyguardAccessApi @ 25 NONAME ; #<VT>#
-	_ZTV20CDevicelockAccessApi @ 26 NONAME ; #<VT>#
 
--- a/securitydialogs/lockclient/group/ABLD.BAT	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-@ECHO OFF
-
-REM Bldmake-generated batch file - ABLD.BAT
-REM ** DO NOT EDIT **
-
-perl -S ABLD.PL "\sf\mw\securitysrv\securitydialogs\lockclient\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9
-if errorlevel==1 goto CheckPerl
-goto End
-
-:CheckPerl
-perl -v >NUL
-if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed?
-goto End
-
-:End
--- a/securitydialogs/lockclient/group/bld.inf	Thu Aug 19 10:45:23 2010 +0300
+++ b/securitydialogs/lockclient/group/bld.inf	Tue Aug 31 16:04:40 2010 +0300
@@ -20,8 +20,12 @@
 
 PRJ_EXPORTS
 
+/* this is also done in  .pro , but doesn't harm to do it here, too */
 ../rom/lockclient.iby CORE_MW_LAYER_IBY_EXPORT_PATH(lockclient.iby)
 
 PRJ_MMPFILES
 
+/*
+Not any more. This is done in the QT way, using  lockclient.pro
 lockclient.mmp
+*/
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/lockclient/group/bwins/lockclientu.def	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,20 @@
+EXPORTS
+	?ShowKeysLockedNote@CKeyguardAccessApi@@QAEHXZ @ 1 NONAME ; int CKeyguardAccessApi::ShowKeysLockedNote(void)
+	?TestDestruct@CKeyguardAccessApi@@QAEHXZ @ 2 NONAME ; int CKeyguardAccessApi::TestDestruct(void)
+	?NewL@CDevicelockAccessApi@@SAPAV1@XZ @ 3 NONAME ; class CDevicelockAccessApi * CDevicelockAccessApi::NewL(void)
+	?OfferKeyguard@CKeyguardAccessApi@@QAEHXZ @ 4 NONAME ; int CKeyguardAccessApi::OfferKeyguard(void)
+	?IsKeyguardEnabled@CKeyguardAccessApi@@QAEHXZ @ 5 NONAME ; int CKeyguardAccessApi::IsKeyguardEnabled(void)
+	?EnableKeyguard@CKeyguardAccessApi@@QAEHH@Z @ 6 NONAME ; int CKeyguardAccessApi::EnableKeyguard(int)
+	?IsKeylockEnabled@CKeyguardAccessApi@@QAEHXZ @ 7 NONAME ; int CKeyguardAccessApi::IsKeylockEnabled(void)
+	?IsDevicelockEnabled@CDevicelockAccessApi@@QAEHXZ @ 8 NONAME ; int CDevicelockAccessApi::IsDevicelockEnabled(void)
+	?DisableDevicelock@CDevicelockAccessApi@@QAEHXZ @ 9 NONAME ; int CDevicelockAccessApi::DisableDevicelock(void)
+	?TestPanicClient@CKeyguardAccessApi@@QAEHXZ @ 10 NONAME ; int CKeyguardAccessApi::TestPanicClient(void)
+	?TestInternal@CKeyguardAccessApi@@QAEHXZ @ 11 NONAME ; int CKeyguardAccessApi::TestInternal(void)
+	?DisableKeyguard@CKeyguardAccessApi@@QAEHH@Z @ 12 NONAME ; int CKeyguardAccessApi::DisableKeyguard(int)
+	?EnableDevicelock@CDevicelockAccessApi@@QAEHW4TDevicelockReason@@@Z @ 13 NONAME ; int CDevicelockAccessApi::EnableDevicelock(enum TDevicelockReason)
+	?IsKeylockEnabled@CDevicelockAccessApi@@QAEHXZ @ 14 NONAME ; int CDevicelockAccessApi::IsKeylockEnabled(void)
+	??1CKeyguardAccessApi@@UAE@XZ @ 15 NONAME ; CKeyguardAccessApi::~CKeyguardAccessApi(void)
+	??1CDevicelockAccessApi@@UAE@XZ @ 16 NONAME ; CDevicelockAccessApi::~CDevicelockAccessApi(void)
+	?OfferDevicelock@CDevicelockAccessApi@@QAEHXZ @ 17 NONAME ; int CDevicelockAccessApi::OfferDevicelock(void)
+	?NewL@CKeyguardAccessApi@@SAPAV1@XZ @ 18 NONAME ; class CKeyguardAccessApi * CKeyguardAccessApi::NewL(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/lockclient/group/eabi/lockclientu.def	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,24 @@
+EXPORTS
+	_ZN18CKeyguardAccessApi12TestDestructEv @ 1 NONAME
+	_ZN18CKeyguardAccessApi12TestInternalEv @ 2 NONAME
+	_ZN18CKeyguardAccessApi13OfferKeyguardEv @ 3 NONAME
+	_ZN18CKeyguardAccessApi14EnableKeyguardEi @ 4 NONAME
+	_ZN18CKeyguardAccessApi15DisableKeyguardEi @ 5 NONAME
+	_ZN18CKeyguardAccessApi15TestPanicClientEv @ 6 NONAME
+	_ZN18CKeyguardAccessApi16IsKeylockEnabledEv @ 7 NONAME
+	_ZN18CKeyguardAccessApi17IsKeyguardEnabledEv @ 8 NONAME
+	_ZN18CKeyguardAccessApi18ShowKeysLockedNoteEv @ 9 NONAME
+	_ZN18CKeyguardAccessApi4NewLEv @ 10 NONAME
+	_ZN18CKeyguardAccessApiD0Ev @ 11 NONAME
+	_ZN18CKeyguardAccessApiD1Ev @ 12 NONAME
+	_ZN18CKeyguardAccessApiD2Ev @ 13 NONAME
+	_ZN20CDevicelockAccessApi15OfferDevicelockEv @ 14 NONAME
+	_ZN20CDevicelockAccessApi16EnableDevicelockE17TDevicelockReason @ 15 NONAME
+	_ZN20CDevicelockAccessApi16IsKeylockEnabledEv @ 16 NONAME
+	_ZN20CDevicelockAccessApi17DisableDevicelockEv @ 17 NONAME
+	_ZN20CDevicelockAccessApi19IsDevicelockEnabledEv @ 18 NONAME
+	_ZN20CDevicelockAccessApi4NewLEv @ 19 NONAME
+	_ZN20CDevicelockAccessApiD0Ev @ 20 NONAME
+	_ZN20CDevicelockAccessApiD1Ev @ 21 NONAME
+	_ZN20CDevicelockAccessApiD2Ev @ 22 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/lockclient/group/lockclient.pro	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,51 @@
+#
+# 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 = lockclient 	
+
+TARGET.UID3 = 0x2000B124
+
+TARGET.CAPABILITY = CAP_GENERAL_DLL
+
+
+DEPENDPATH += .
+DEPENDPATH += ../src
+DEPENDPATH += ../inc
+
+INCLUDEPATH += .
+
+CONFIG += hb
+
+# Input
+SOURCES += devicelockaccessapi.cpp \
+           keyguardaccessapi.cpp \
+           lockaccessextension.cpp
+
+HEADERS = lockaccessextension.h
+
+LIBS += -lxqservice
+LIBS += -lxqserviceutil
+LIBS += -lapparc
+LIBS += -lapgrfx
+
+symbian*: { 
+	TARGET.EPOCALLOWDLLDATA = 1
+	MMP_RULES -= "OPTION_REPLACE ARMCC --export_all_vtbl -D__QT_NOEFFECTMACRO_DONOTUSE"
+	}
+
+BLD_INF_RULES.prj_exports += "../rom/lockclient.iby            CORE_APP_LAYER_IBY_EXPORT_PATH(lockclient.iby)"
--- a/securitydialogs/lockclient/inc/lockaccessextension.h	Thu Aug 19 10:45:23 2010 +0300
+++ b/securitydialogs/lockclient/inc/lockaccessextension.h	Tue Aug 31 16:04:40 2010 +0300
@@ -21,6 +21,12 @@
 
 #include <e32base.h>
 
+#if defined(_DEBUG)
+#define RDEBUG( x, y ) RDebug::Printf( "%s %s (%u) %s=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, x, y );
+#else
+#define RDEBUG( x, y )
+#endif
+
 class RWsSession;
 
 /**
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/lockclient/lockclient.pro	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,21 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+# 
+# Description:
+#
+
+TEMPLATE = subdirs
+
+SYMBIAN_PLATFORMS = WINSCW ARMV5
+
+SUBDIRS += group/lockclient.pro
--- a/securitydialogs/lockclient/rom/lockclient.iby	Thu Aug 19 10:45:23 2010 +0300
+++ b/securitydialogs/lockclient/rom/lockclient.iby	Tue Aug 31 16:04:40 2010 +0300
@@ -20,6 +20,6 @@
 #include <data_caging_paths_for_iby.hrh>
  
 //file=ABI_DIR\BUILD_DIR\lockclient.dll SHARED_LIB_DIR\lockclient.dll
-file=ABI_DIR\UDEB\lockclient.dll SHARED_LIB_DIR\lockclient.dll
+file=ABI_DIR\BUILD_DIR\lockclient.dll SHARED_LIB_DIR\lockclient.dll
 
 #endif // __LOCKCLIENT_IBY__
--- a/securitydialogs/lockclient/src/devicelockaccessapi.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/securitydialogs/lockclient/src/devicelockaccessapi.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -29,6 +29,7 @@
 // ---------------------------------------------------------------------------
 EXPORT_C CDevicelockAccessApi* CDevicelockAccessApi::NewL( )
     {
+    RDEBUG("0", 0);
     CDevicelockAccessApi* self = new (ELeave) CDevicelockAccessApi( );
     CleanupStack::PushL( self );
     self->ConstructL( );
@@ -41,6 +42,7 @@
 // ---------------------------------------------------------------------------
 CDevicelockAccessApi::CDevicelockAccessApi()
     {
+    RDEBUG("0", 0);
     }
 
 // ---------------------------------------------------------------------------
@@ -69,6 +71,7 @@
 // ---------------------------------------------------------------------------
 EXPORT_C TBool CDevicelockAccessApi::IsKeylockEnabled()
     {
+    RDEBUG("0", 0);
     TInt value;
     TInt err = RProperty::Get(KPSUidAvkonDomain, KAknKeyguardStatus, value);
     if ( err == KErrNone )
@@ -94,6 +97,7 @@
 // ---------------------------------------------------------------------------
 EXPORT_C TBool CDevicelockAccessApi::IsDevicelockEnabled()
     {
+    RDEBUG("0", 0);
     TInt value;
     TInt err = RProperty::Get(KPSUidAvkonDomain, KAknKeyguardStatus, value);
     if ( err == KErrNone )
@@ -119,6 +123,7 @@
 // ---------------------------------------------------------------------------
 EXPORT_C TInt CDevicelockAccessApi::EnableDevicelock( TDevicelockReason aReason )
     {
+    RDEBUG("aReason", aReason);
     if ( iLockAccessExtension )
         {
         switch (aReason)
@@ -141,6 +146,7 @@
 // ---------------------------------------------------------------------------
 EXPORT_C TInt CDevicelockAccessApi::OfferDevicelock()
     {
+    RDEBUG("0", 0);
     if ( iLockAccessExtension )
         {
         return iLockAccessExtension->SendMessage( ELockAppOfferDevicelock );
@@ -157,6 +163,7 @@
 // ---------------------------------------------------------------------------
 EXPORT_C TInt CDevicelockAccessApi::DisableDevicelock()
     {
+    RDEBUG("0", 0);
     if ( iLockAccessExtension )
         {
         return iLockAccessExtension->SendMessage( ELockAppDisableDevicelock );
--- a/securitydialogs/lockclient/src/keyguardaccessapi.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/securitydialogs/lockclient/src/keyguardaccessapi.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -24,11 +24,15 @@
 #include <e32property.h> // P&S API
 #include <e32debug.h>
 
+#include <QDebug>
+
 // ---------------------------------------------------------------------------
 // Standard Symbian OS construction sequence
 // ---------------------------------------------------------------------------
 EXPORT_C CKeyguardAccessApi* CKeyguardAccessApi::NewL( )
     {
+    RDEBUG("0", 0);
+
     CKeyguardAccessApi* self = new (ELeave) CKeyguardAccessApi( );
     CleanupStack::PushL( self );
     self->ConstructL( );
@@ -41,6 +45,7 @@
 // ---------------------------------------------------------------------------
 CKeyguardAccessApi::CKeyguardAccessApi()
     {
+    RDEBUG("0", 0);
     }
 
 // ---------------------------------------------------------------------------
@@ -61,6 +66,7 @@
 // ---------------------------------------------------------------------------
 void CKeyguardAccessApi::ConstructL( )
     {
+    RDEBUG("0", 0);
     iLockAccessExtension = new (ELeave) RLockAccessExtension;
     }
 
@@ -69,6 +75,8 @@
 // ---------------------------------------------------------------------------
 EXPORT_C TBool CKeyguardAccessApi::IsKeylockEnabled()
     {
+
+		RDEBUG("0", 0);
     TInt value;
     TInt err = RProperty::Get(KPSUidAvkonDomain, KAknKeyguardStatus, value);
     if ( err == KErrNone )
@@ -94,6 +102,7 @@
 // ---------------------------------------------------------------------------
 EXPORT_C TBool CKeyguardAccessApi::IsKeyguardEnabled()
     {
+    RDEBUG("0", 0);
     TInt value;
     TInt err = RProperty::Get(KPSUidAvkonDomain, KAknKeyguardStatus, value);
     if ( err == KErrNone )
@@ -134,12 +143,15 @@
 // ---------------------------------------------------------------------------
 EXPORT_C TInt CKeyguardAccessApi::DisableKeyguard( TBool aWithNote )
     {
+		RDEBUG("aWithNote", aWithNote);
     if ( iLockAccessExtension )
         {
+        RDEBUG("0", 1);
         return iLockAccessExtension->SendMessage( ELockAppDisableKeyguard, aWithNote );
         }
     else
         {
+        RDEBUG("0", 0);
         return KErrNotFound;
         }
     }
@@ -149,6 +161,7 @@
 // ---------------------------------------------------------------------------
 EXPORT_C TInt CKeyguardAccessApi::OfferKeyguard()
     {
+   	RDEBUG("0", 0);
     if ( iLockAccessExtension )
         {
         return iLockAccessExtension->SendMessage( ELockAppOfferKeyguard );
@@ -164,6 +177,7 @@
 // ---------------------------------------------------------------------------
 EXPORT_C TInt CKeyguardAccessApi::ShowKeysLockedNote()
     {
+    RDEBUG("0", 0);
     if ( iLockAccessExtension )
         {
         return iLockAccessExtension->SendMessage( ELockAppShowKeysLockedNote );
--- a/securitydialogs/lockclient/src/lockaccessextension.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/securitydialogs/lockclient/src/lockaccessextension.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -15,17 +15,20 @@
  *
 */
 
-
 #include "lockaccessextension.h"
 #include <lockappclientserver.h>
 #include <e32property.h> // P&S API
 #include <apgtask.h> // TApaTask, TApaTaskList
 #include <coemain.h> // CCoeEnv
-
+#include "../../Autolock/PubSub/securityuisprivatepskeys.h"
+#include <apgcli.h>
+#include <apacmdln.h>
 
-// Constants
-const TInt KTimesToConnectServer( 2);
-const TInt KTimeoutBeforeRetrying( 50000);
+#include <xqservicerequest.h>
+#include <xqserviceutil.h>
+#include <xqrequestinfo.h>
+#include <xqaiwrequest.h>
+#include <xqappmgr.h>
 
 // ---------------------------------------------------------------------------
 // Gets server version, needed for connection
@@ -41,6 +44,8 @@
 TInt RLockAccessExtension::TryConnect( RWsSession& aWsSession )
 	{
 	TInt ret(KErrNone);
+	/*
+	this is the old methd. Now we use QtHighway
 	TApaTaskList list(aWsSession);
 	// check that lockapp is running
 	TApaTask task = list.FindApp( KLockAppUid );
@@ -62,6 +67,8 @@
 		RDebug::Printf( "%s %s (%u) ???? LockApp task not found=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, KLockAppUid );
 		ret = KErrNotReady;
 		}
+	*/
+	RDEBUG("ret", ret);
 	return ret;
 	}
 
@@ -71,7 +78,70 @@
 TInt RLockAccessExtension::EnsureConnected( )
 	{
 	TInt ret(KErrNone);
+
+	// Now we use QtHighway, but nevertheless need to be sure that only 1 process is running
+	// This is done because Autolock.exe should start at the beginning, but it might not be ready yet.
+	// As Qthighway will start it, it's better to give time for the first one to prepare itself.
+	TInt err = KErrNone;
+	TInt numAttempts = 0;
+	TInt numberOfInstances = 0;
+	do
+		{
+		numberOfInstances=0;
+		TFullName processName;
+		TFindThread find(_L("*utolock*"));	// first letter can can be uppercase or lowercase
+		while( find.Next( processName ) == KErrNone )
+		    {
+				// Autolock[100059b5]0002::Autolock		in device
+				// autolock.exe[100059b5]0002::Main		in emulator
+				RDEBUG("found process", 1);
+        numberOfInstances++;
+		    }	// end while
+		RDEBUG("numberOfInstances", numberOfInstances);
+		if(numberOfInstances<=0)
+			{
+			RDEBUG("Autolock.exe not running already. Starting.", 0 );
+	    RApaLsSession ls;
+	    User::LeaveIfError(ls.Connect());
+	    CleanupClosePushL(ls);
+	    RDEBUG("commandLine", 0); 
+	    CApaCommandLine* commandLine = CApaCommandLine::NewLC();
+	    commandLine->SetExecutableNameL(_L("autolock.exe"));
+	    commandLine->SetCommandL(EApaCommandRun);
+	    // Try to launch the application.
+	    RDEBUG("StartApp", 0); 
+	    TInt err = ls.StartApp(*commandLine); // this migh fail
+    	CleanupStack::PopAndDestroy(2); // commandLine, ls
+
+			RDEBUG("Autolock.exe launched. Waiting a bit. err", err );
+			User::After(1000*1000);
+			RDEBUG("re-verifying Autolock.exe process.", 1 );
+			}
+		} while (numAttempts++ <3 && numberOfInstances<=0);
+		
+
+
+	TInt value = -1;
+	err = KErrNone;
+	numAttempts = 0;
+	while( value<1 && numAttempts++ <10 )	// wait max 5 seconds
+		{
+		// process was started, but still not fully running. Give a bit more time
+		err = RProperty::Get(KPSUidSecurityUIs, KSecurityUIsLockInitiatorUID, value);
+		RDEBUG("err", err);
+		RDEBUG("value", value);
+		if(value<1)
+			{
+			RDEBUG("Autolock.exe has started but it's not fully running", value);
+			User::After(5*100*1000);	// half a second
+			}
+		}
+	RDEBUG("numAttempts", numAttempts);
+	/*
+	this is the old method. 
 	// we need CCoeEnv because of window group list
+	const TInt KTimesToConnectServer( 2);
+	const TInt KTimeoutBeforeRetrying( 50000);
 	CCoeEnv* coeEnv = CCoeEnv::Static( );
 	if ( coeEnv )
 		{
@@ -90,6 +160,8 @@
 		// No CCoeEnv
 		ret = KErrNotSupported;
 		}
+	*/
+	RDEBUG("ret", ret);
 	return ret;
 	}
 
@@ -98,10 +170,12 @@
 // ---------------------------------------------------------------------------
 TInt RLockAccessExtension::SendMessage( TInt aMessage )
 	{
-	TInt ret = EnsureConnected( );
+	RDEBUG("0", 0);
+	TInt ret = KErrNone;
 	if ( ret == KErrNone )
 		{
-		ret = SendReceive( aMessage );
+		// ret = SendReceive( aMessage );
+		ret = SendMessage( aMessage, -1, -1 );
 		}
 	return ret;
 	}
@@ -111,12 +185,14 @@
 // ---------------------------------------------------------------------------
 TInt RLockAccessExtension::SendMessage( TInt aMessage, TInt aParam1 )
 	{
-	TInt ret = EnsureConnected( );
+	RDEBUG("0", 0);
+	TInt ret = KErrNone;
 	if ( ret == KErrNone )
 		{
 		// assign parameters to IPC argument
 		TIpcArgs args(aParam1);
-		ret = SendReceive( aMessage, args );
+		// ret = SendReceive( aMessage, args );
+		ret = SendMessage( aMessage, aParam1, -1 );
 		}
 	return ret;
 	}
@@ -126,13 +202,82 @@
 // ---------------------------------------------------------------------------
 TInt RLockAccessExtension::SendMessage( TInt aMessage, TInt aParam1, TInt aParam2 )
 	{
+	RDEBUG("0", 0);
 	TInt ret = EnsureConnected( );
+	RDEBUG("ret", ret);
 	if ( ret == KErrNone )
 		{
 		// assign parameters to IPC argument
-		TIpcArgs args( aParam1, aParam2);
-		ret = SendReceive( aMessage, args );
+		// TIpcArgs args( aParam1, aParam2);
+		// this is the old methd. Now we use QtHighway
+		// ret = SendReceive( aMessage, args );
+    RDEBUG("aMessage", aMessage);
+    RDEBUG("aParam1", aParam1);
+    RDEBUG("aParam2", aParam2);
+
+		
+			{	// old method. Not used any more. Kept as reference
+			/*
+	    XQServiceRequest* mServiceRequest;
+      RDEBUG("XQServiceRequest", 0);
+	    mServiceRequest = new XQServiceRequest("com.nokia.services.Autolock.Autolock","service(QString,QString,QString)");// use   , false    to make async
+      RDEBUG("aMessage", 0);
+	    QString label;
+	    label = "" + QString("%1").arg(aMessage);
+	    *mServiceRequest << QString(label);
+      RDEBUG("aParam1", 0);
+	    label = "" + QString("%1").arg(aParam1);
+	    *mServiceRequest << QString(label);
+      RDEBUG("aParam2", 0);
+	    label = "" + QString("%1").arg(aParam2);
+	    *mServiceRequest << QString(label);
+	    int returnvalue;
+      RDEBUG("send", 0);
+	    bool ret = mServiceRequest->send(returnvalue);
+      RDEBUG("ret", ret);
+      RDEBUG("returnvalue", returnvalue);
+      */
+			}
+
+			RDEBUG("args", 0);
+			QList<QVariant> args;
+	    args << QVariant(QString(QString::number(aMessage)));
+	    args << QVariant(QString(QString::number(aParam1)));
+	    args << QVariant(QString(QString::number(aParam2)));
+
+	    XQApplicationManager mAppManager;
+	    XQAiwRequest *request;
+	    RDEBUG("create", 0);
+			request = mAppManager.create("com.nokia.services.Autolock", "Autolock", "service(QString,QString,QString)", false);
+			// also works with		create("Autolock", "service(QString,QString,QString)", false);
+			if(request)
+				{
+	    	RDEBUG("got request", 0);
+	    	}
+	    else
+	    	{
+	 	    RDEBUG("not got request", 0);
+	 	    RDebug::Printf( "%s %s (%u) not got request=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
+	 	    return KErrAbort;
+	 	  	}
+				
+			RDEBUG("setArguments", 0);
+			request->setArguments(args);
+			RDEBUG("args", 0);
+	    int returnvalue=0;
+	    QVariant var = QVariant(returnvalue);
+			RDEBUG("send", 0);
+			bool retSend = request->send(var);
+			returnvalue = var.toInt();
+			RDEBUG("retSend", retSend);
+			RDEBUG("returnvalue", returnvalue);
+	    int error = request->lastError();
+			RDEBUG("error", error);
+	    ret = returnvalue;
+	
+	    delete request;
 		}
+  RDEBUG("ret", ret);
 	return ret;
 	}
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/inc/secuinotificationcontentwidget.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: SecUi notification content widget.
+*
+*/
+
+#ifndef SECUINOTIFICATIONCONTENTWIDGET_H
+#define SECUINOTIFICATIONCONTENTWIDGET_H
+
+#include <hbwidget.h>       // HbWidget
+#include <hblineedit.h>       // HbWidget
+
+#include <HbCheckBox>
+#include <HbListWidget>
+#include <HbListWidgetItem>
+class HbLabel;
+class HbCheckBox;
+class HbListWidget;
+
+
+class SecUiNotificationContentWidget : public HbWidget
+{
+    Q_OBJECT
+
+public:
+    SecUiNotificationContentWidget(QGraphicsItem *parent=0, Qt::WindowFlags flags=0);
+    virtual ~SecUiNotificationContentWidget();
+
+    void constructFromParameters(const QVariantMap &parameters);
+
+signals:
+    void memorySelectionChanged(const QString &text);
+    void codeTopChanged(const QString &text);
+    void codeTopContentChanged();
+    void codeBottomChanged(const QString &text);
+    void but1Changed();
+    void but2Changed();
+    void but3Changed();
+
+private:
+    Q_DISABLE_COPY(SecUiNotificationContentWidget)
+
+private:    // data
+public:
+		HbLineEdit *codeTop;
+		HbLineEdit *codeBottom;
+        HbCheckBox *checkbox;
+        HbLabel *DialogText;
+        HbListWidget *listWidget;
+    int queryType;
+    int lMinLength;
+    int lMaxLength;
+    int queryDual;
+    int lEmergencySupported;
+    int isEmergency;
+};
+
+#endif // SECUINOTIFICATIONCONTENTWIDGET_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/inc/secuinotificationdebug.h	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,30 @@
+/*
+* 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: SecUi notification plugin dialog.
+*
+*/
+
+#ifndef SECUINOTIFICATIONDEBUG_H
+#define SECUINOTIFICATIONDEBUG_H
+
+#include <e32debug.h>
+#ifdef _DEBUG
+#define RDEBUG( x, y ) RDebug::Printf( "%s %s (%u) %s=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, x, y );
+#define RDEBUGQT( x, y ) qDebug() << __FILE__ << " " << __PRETTY_FUNCTION__ << " (" << __LINE__ << ") " << x << "=" << y ;
+#else
+#define RDEBUG( x, y )
+#define RDEBUGQT( x, y ) 
+#endif
+
+#endif // SECUINOTIFICATIONDEBUG_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/inc/secuinotificationdialog.h	Tue Aug 31 16:04:40 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: SecUi notification plugin dialog.
+*
+*/
+
+#ifndef SECUINOTIFICATIONDIALOG_H
+#define SECUINOTIFICATIONDIALOG_H
+
+
+#include <hbdialog.h>                   // HbDialog
+#include <hbdevicedialoginterface.h>    // HbDeviceDialogInterface
+#include <hbwidget.h>       // HbWidget
+#include <hblineedit.h>       // HbWidget
+#include <hblabel.h>
+#include <HbCheckBox>
+#include <HbListWidget>
+
+#include <qmobilityglobal.h>
+
+class HbTranslator;
+
+QTM_BEGIN_NAMESPACE
+    class QValueSpacePublisher;
+    class QValueSpaceSubscriber;
+QTM_END_NAMESPACE
+QTM_USE_NAMESPACE
+
+/**
+ * SW Install notification widget class.
+ */
+class SecUiNotificationDialog : public HbDialog, public HbDeviceDialogInterface
+{
+    Q_OBJECT
+
+public:     // constructor and destructor
+    SecUiNotificationDialog(const QVariantMap &parameters);
+    virtual ~SecUiNotificationDialog();
+
+public:     // from HbDeviceDialogInterface
+    bool setDeviceDialogParameters(const QVariantMap &parameters);
+    int deviceDialogError() const;
+    void closeDeviceDialog(bool byClient);
+    HbDialog *deviceDialogWidget() const;
+
+signals:
+    void deviceDialogClosed();
+    void deviceDialogData(const QVariantMap &data);
+
+protected:  // from HbPopup (via HbDialog)
+    void hideEvent(QHideEvent *event);
+    void showEvent(QShowEvent *event);
+
+private:    // new functions
+    bool constructDialog(const QVariantMap &parameters);
+    void sendResult(int accepted);
+
+private slots:
+    void handleAccepted();
+    void handleCancelled();
+    void handleMemorySelectionChanged(const QString &text);
+    void handleCodeTopChanged(const QString &text);
+    void handleCodeBottomChanged(const QString &text);
+    void handleCodeTopContentChanged();
+		void saveFocusWidget(QWidget*,QWidget*);
+		void handlebut1Changed();
+		void handlebut2Changed();
+		void handlebut3Changed();
+
+public slots:    
+    void subscriberKSecurityUIsDismissDialogChanged();
+private:
+    Q_DISABLE_COPY(SecUiNotificationDialog)
+
+    HbTranslator *mCommonTranslator;
+    HbTranslator *mSecUiNotificationTranslator;
+    int mMyId;
+    int mLastError;
+    bool mShowEventReceived;
+    QVariantMap mResultMap;
+    HbLineEdit *codeTop;
+    HbLineEdit *codeBottom;
+    HbCheckBox *checkBox;
+    HbListWidget *listWidget;
+    HbAction *okAction;
+    HbAction *cancelAction;
+    HbAction *okVKBAction;
+    HbLabel *titleWidget;
+    int queryType;
+    int lMinLength;
+    int lMaxLength;
+    int queryDual;
+    int lEmergencySupported;
+    int isEmergency;
+    QValueSpaceSubscriber *subscriberKSecurityUIsDismissDialog;
+};
+
+#endif // SECUINOTIFICATIONDIALOG_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/inc/secuinotificationdialogplugin.h	Tue Aug 31 16:04:40 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: SecUi notification plugin class.
+*
+*/
+
+#ifndef SECUINOTIFICATIONDIALOGPLUGIN_H
+#define SECUINOTIFICATIONDIALOGPLUGIN_H
+
+#include <hbdevicedialogplugin.h>       // HbDeviceDialogPlugin
+
+
+/**
+ * Software install notification plugin.
+ * Implements the HbDeviceDialogPlugin to show SW install confirmatoin dialogs.
+ */
+class SecUiNotificationDialogPlugin : public HbDeviceDialogPlugin
+{
+    Q_OBJECT
+
+public:
+    SecUiNotificationDialogPlugin();
+    ~SecUiNotificationDialogPlugin();
+
+public:     // from HbDeviceDialogPlugin
+    bool accessAllowed(const QString &deviceDialogType, const QVariantMap &parameters,
+            const QVariantMap &securityInfo) const;
+    HbDeviceDialogInterface *createDeviceDialog(const QString &deviceDialogType,
+            const QVariantMap &parameters);
+    bool deviceDialogInfo(const QString &deviceDialogType, const QVariantMap &parameters,
+            DeviceDialogInfo *info) const;
+    QStringList deviceDialogTypes() const;
+    PluginFlags pluginFlags() const;
+    int error() const;
+
+private:
+    Q_DISABLE_COPY(SecUiNotificationDialogPlugin)
+
+    int mError;
+};
+
+#endif // SECUINOTIFICATIONDIALOGPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/inc/secuinotificationdialogpluginkeys.h	Tue Aug 31 16:04:40 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: SecUi notification keys.
+*
+*/
+
+#ifndef SECUINOTIFICATIONPLUGINKEYS_H
+#define SECUINOTIFICATIONPLUGINKEYS_H
+
+#include <QString>
+
+// Device dialog type
+#define SECUINOTIFICATIONDIALOG "com.nokia.secuinotificationdialog/1.0"
+
+// Keys for the parameters passed to notification framework plugin
+const QString KDialogTitle = "title";
+const QString KApplicationName = "application";
+const QString KQueryType = "type";
+const QString KQueryMinLength = "MinLength";
+const QString KQueryMaxLength = "MaxLength";
+const QString KApplicationIcon = "icon";
+const QString KSupplier = "supplier";
+const QString KMemorySelection = "memory";
+const QString KCertificates = "certificates";
+const QString KDrmDetails = "drmDetails";
+const QString KCodeTop = "codeTop";
+const QString KCodeBottom = "codeBottom";	// not really needed because is never sent back
+const QString KEmergency = "emergency";
+const QString KInvalidNewLockCode = "invalidNewLockCode";
+const QString KDefaultCode = "DefaultCode";
+
+const QString KChecboxType = "ChecboxDialog";
+const QString KMultiChecboxType = "MultiChecboxDialog";
+// Keys for the return values passed back to calling application
+const QString KResultAccepted = "accepted";         // int
+const QString KSelectedMemoryIndex = "memory";      // int
+const QString KCodeTopIndex = "codeTop";      // int
+const QString KCodeBottomIndex = "codeBottom";      // int	// not really needed because is never sent back
+
+// Error values
+const int KNoError = 0;
+
+#endif // SECUINOTIFICATIONPLUGINKEYS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/resources/cert.svg	Tue Aug 31 16:04:40 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 width="16" height="16" viewBox="0 0 16 16">
+<path fill="#496DA2" d="M10.61,7.411H9.651v0.003l-2.188,8.539c0.62-0.047,1.979-0.227,3.015-0.583 c2.477-0.776,2.543-3.669,2.543-3.669c0.02-0.002,0.021-0.004,0-0.004l0.156-5.019L10.61,7.411z"/>
+<path fill="#A2C2DD" d="M10.492,12.252c0-0.011,0-4.838,0-4.838l-9.94-0.557l0.112,4.63c0.053,1.974,1.425,3.954,2.82,4.091 l3.802,0.377C8.292,15.861,10.354,14.993,10.492,12.252z"/>
+<path fill="#496DA2" d="M6.105,10.902c0.613-0.453,0.605-1.24,0.189-1.717C5.977,8.824,5.549,8.795,5.538,8.794 C5.527,8.793,5.239,8.719,4.781,9.022c-0.417,0.387-0.425,1.172,0.189,1.757L4.619,13.23l1.925,0.193L6.105,10.902z"/>
+<path fill="#235487" d="M5.148,10.779c0,0-0.237-0.098-0.444-0.66C4.526,8.994,5.291,8.857,5.279,8.855 c-0.011,0-0.298-0.075-0.756,0.229c-0.417,0.387-0.425,1.172,0.189,1.756l-0.352,2.452l0.521-0.095L5.148,10.779z"/>
+<polygon fill="#CEE1EF" points="13.177,6.66 3.135,6.063 0.552,6.857 10.789,7.411 "/>
+<path fill="#496DA2" d="M5.071,6.567c0-0.49-0.192-1.703,0.785-1.989c1.624-0.475,2.268,0.99,2.268,2.262 c0,0.491,2.336,0.379,2.309-0.17c-0.027-0.548-0.279-3.594-2.84-4.136C2.985,2.016,2.76,6.01,2.906,6.567 C3.033,7.049,5.071,6.878,5.071,6.567z"/>
+</svg>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/resources/drm.svg	Tue Aug 31 16:04:40 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="#496DA2" points="8.54,8.603 9.474,8.046 9.328,12.963 8.437,13.543 "/>
+<path d="M8.468,4.789c-0.211,0.13-0.471,0.293-0.748,0.456C7.185,5.456,6.111,4.399,6.745,3.57 c0.293-0.195,0.504-0.309,0.764-0.471C7.07,3.488,7.233,4.854,8.468,4.789z" fill="#496DA2"/>
+<polygon fill="#496DA2" points="8.421,13.559 9.344,12.932 8.688,13.822 7.864,14.373 "/>
+<polygon fill="#496DA2" points="9.633,3.526 11.02,2.778 10.893,8.346 9.75,9.016 "/>
+<polygon fill="#CEE1EF" points="6.083,1.627 4.965,2.088 9.759,3.463 11.035,2.778 "/>
+<path d="M9.805,3.457L4.982,2.084l0.206,5.465l1.32,0.422l0.235,0.757l0.285,0.453l0.835,5.191l0.573-0.83 l0.157-4.906l1.173,0.375L9.805,3.457z M7.166,3.438C7.218,3.44,7.271,3.45,7.326,3.467c0.411,0.129,0.75,0.622,0.76,1.099 c0.01,0.429-0.231,0.695-0.563,0.68C7.472,5.243,7.419,5.234,7.365,5.219C6.963,5.09,6.615,4.597,6.604,4.111 C6.595,3.699,6.84,3.423,7.166,3.438z" fill="#A2C2DD"/>
+<polygon fill="#496DA2" points="6.771,9.591 7.037,9.173 7.75,9.391 7.861,14.361 7.45,14.229 6.847,13.038 6.819,11.782 7.244,11.326 6.793,10.572 "/>
+</svg>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/resources/qgn_indi_midp_trusted.svg	Tue Aug 31 16:04:40 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 width="16" height="16" viewBox="0 0 16 16">
+<path fill="#496DA2" d="M10.61,7.411H9.651v0.003l-2.188,8.539c0.62-0.047,1.979-0.227,3.015-0.583 c2.477-0.776,2.543-3.669,2.543-3.669c0.02-0.002,0.021-0.004,0-0.004l0.156-5.019L10.61,7.411z"/>
+<path fill="#A2C2DD" d="M10.492,12.252c0-0.011,0-4.838,0-4.838l-9.94-0.557l0.112,4.63c0.053,1.974,1.425,3.954,2.82,4.091 l3.802,0.377C8.292,15.861,10.354,14.993,10.492,12.252z"/>
+<path fill="#496DA2" d="M6.105,10.902c0.613-0.453,0.605-1.24,0.189-1.717C5.977,8.824,5.549,8.795,5.538,8.794 C5.527,8.793,5.239,8.719,4.781,9.022c-0.417,0.387-0.425,1.172,0.189,1.757L4.619,13.23l1.925,0.193L6.105,10.902z"/>
+<path fill="#235487" d="M5.148,10.779c0,0-0.237-0.098-0.444-0.66C4.526,8.994,5.291,8.857,5.279,8.855 c-0.011,0-0.298-0.075-0.756,0.229c-0.417,0.387-0.425,1.172,0.189,1.756l-0.352,2.452l0.521-0.095L5.148,10.779z"/>
+<polygon fill="#CEE1EF" points="13.177,6.66 3.135,6.063 0.552,6.857 10.789,7.411 "/>
+<path fill="#496DA2" d="M5.071,6.567c0-0.49-0.192-1.703,0.785-1.989c1.624-0.475,2.268,0.99,2.268,2.262 c0,0.491,2.336,0.379,2.309-0.17c-0.027-0.548-0.279-3.594-2.84-4.136C2.985,2.016,2.76,6.01,2.906,6.567 C3.033,7.049,5.071,6.878,5.071,6.567z"/>
+</svg>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/resources/qgn_menu_am_midlet.svg	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,71 @@
+<?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="100%" height="100%" viewBox="0 0 88 88">
+<linearGradient id="_12" gradientUnits="userSpaceOnUse" x1="44.68" y1="44.13" x2="62.99" y2="80.2">
+<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(#_12)" d="M14.475,14.003c0,0,0.809,11.089,0.952,13.061c-5.274-2.117-12.123,2.153-12.088,8.081 c0.032,5.237,6.587,11.975,13.074,9.778l0.983,16.064l19.536,6.212l3.87-3.304c-1.391-1.28-4.237-6.712-0.913-10.679 c1.636,0.074,3.803,1.019,5.318,3.341c-0.755,0.446-2.435,1.438-2.435,1.438l1.769,18.358l15.22,5.217L70.69,74.02 c0,0,0.713-11.908,0.78-13.026c6.92-0.28,10.947-6.543,10.947-11.571c0-6.004-4.893-12.288-12.286-12.695 c0.042-1.229,0.537-15.648,0.537-15.648l-23.381-4.272l-4.885,3.214c3.509,4.846,3.525,10.268,1.019,13.249 c-3.51,2.305-11.719-5.695-4.459-17.366l-20.704-3.978L14.475,14.003z"/>
+<linearGradient id="_13" gradientUnits="userSpaceOnUse" x1="48.4" y1="45.14" x2="26.4" y2="15.64">
+<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(#_13)" d="M24.994,28.365l8.648-9.673l4.228-2.288c-6.905,12.095,2.267,20.532,6.18,17.29 c-0.206,0.233-1.306,5.171-1.306,5.171L24.994,28.365z"/>
+<linearGradient id="_14" gradientUnits="userSpaceOnUse" x1="49.78" y1="73.59" x2="33.78" y2="54.09">
+<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="M39.571,52.482c-3.281,3.521-1.765,8.89,0.253,11.328l-3.05,2.604L20.548,42.523L39.571,52.482z "/>
+<linearGradient id="_15" gradientUnits="userSpaceOnUse" x1="66.5" y1="18.51" x2="66.79" y2="46.9">
+<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>
+<polygon fill="url(#_15)" points="63.325,42.008 63.278,24.622 69.948,21.658 69.371,38.502 "/>
+<linearGradient id="_16" gradientUnits="userSpaceOnUse" x1="25.65" y1="17.91" x2="27.75" y2="12.21">
+<stop stop-color="#FFFFFF" offset="0.05"/>
+<stop stop-color="#A2C2DD" offset="1"/>
+</linearGradient>
+<polygon fill="url(#_16)" points="15.205,14.4 18.376,12.659 37.964,16.356 33.643,18.692 "/>
+<linearGradient id="_17" gradientUnits="userSpaceOnUse" x1="55.45" y1="24.23" x2="58.18" y2="16.83">
+<stop stop-color="#FFFFFF" offset="0.05"/>
+<stop stop-color="#A2C2DD" offset="1"/>
+</linearGradient>
+<polygon fill="url(#_17)" points="43.376,20.218 47.438,17.545 69.948,21.658 63.807,24.622 "/>
+<linearGradient id="_18" gradientUnits="userSpaceOnUse" x1="9.41" y1="29.03" x2="15.24" y2="32.03">
+<stop stop-color="#FFFFFF" offset="0.05"/>
+<stop stop-color="#A2C2DD" offset="1"/>
+</linearGradient>
+<path fill="url(#_18)" d="M5.168,31.243c3.055-4.432,8.436-4.929,11.075-3.032l0.301,3.842L5.168,31.243z"/>
+<linearGradient id="_19" gradientUnits="userSpaceOnUse" x1="66" y1="32.31" x2="81.16" y2="58.31">
+<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(#_19)" d="M63.479,40.737l5.963-3.383c7.639-1.027,18.434,11.723,8.048,20.789L63.479,40.737z"/>
+<linearGradient id="_20" gradientUnits="userSpaceOnUse" x1="53.27" y1="11.98" x2="36.67" y2="58.23">
+<stop stop-color="#FFFFFF" offset="0.05"/>
+<stop stop-color="#A2C2DD" offset="1"/>
+</linearGradient>
+<path fill="url(#_20)" d="M63.543,40.685c7.758-3.933,16.752,4.756,16.232,11.543c-0.824,10.789-12.64,9.004-16.388,5.077 L45.833,69.03c4.174-3.883,1.91-14.799-4.674-16.367c-6.584-1.569-9.549,7.171-4.385,13.751l-18.709-5.948l-1.01-16.502 c-6.7,3.158-12.989-4.322-13.017-8.823c-0.04-6.581,7.252-8.843,12.437-3.323L15.205,14.4l18.438,4.292 c-4.241,6.53,0.437,15.692,5.636,16.821c5.2,1.128,9.505-7.159,4.098-15.296l20.431,4.404L63.543,40.685z"/>
+<polygon fill="#58A015" points="59.654,80.794 45.195,75.838 43.51,58.344 60.175,62.587 "/>
+<polygon fill="#17594C" points="59.654,80.794 70.012,73.638 71.094,55.58 59.654,62.587 "/>
+<linearGradient id="_21" gradientUnits="userSpaceOnUse" x1="43.41" y1="57.36" x2="71.04" y2="57.36">
+<stop stop-color="#DCE8E4" offset="0"/>
+<stop stop-color="#43910A" offset="1"/>
+</linearGradient>
+<polygon fill="url(#_21)" points="43.408,58.344 59.654,62.587 71.042,55.58 54.517,52.14 "/>
+<linearGradient id="_22" gradientUnits="userSpaceOnUse" x1="41.47" y1="83.72" x2="60.49" y2="73.75">
+<stop stop-color="#DCE8E4" offset="0"/>
+<stop stop-color="#43910A" offset="1"/>
+</linearGradient>
+<polygon fill="url(#_22)" points="58.806,67.904 59.629,80.923 45.193,75.631 "/>
+<rect fill="none" height="88" width="88"/>
+</svg>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/resources/qgn_menu_am_sis.svg	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,71 @@
+<?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="100%" height="100%" viewBox="0 0 88 88">
+<linearGradient id="_12" gradientUnits="userSpaceOnUse" x1="44.68" y1="44.13" x2="62.99" y2="80.2">
+<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(#_12)" d="M14.475,14.003c0,0,0.809,11.089,0.952,13.061c-5.274-2.117-12.123,2.153-12.088,8.081 c0.032,5.237,6.587,11.975,13.074,9.778l0.983,16.064l19.536,6.212l3.87-3.304c-1.391-1.28-4.237-6.712-0.913-10.679 c1.636,0.074,3.803,1.019,5.318,3.341c-0.755,0.446-2.435,1.438-2.435,1.438l1.769,18.358l15.22,5.217L70.69,74.02 c0,0,0.713-11.908,0.78-13.026c6.92-0.28,10.947-6.543,10.947-11.571c0-6.004-4.893-12.288-12.286-12.695 c0.042-1.229,0.537-15.648,0.537-15.648l-23.381-4.272l-4.885,3.214c3.509,4.846,3.525,10.268,1.019,13.249 c-3.51,2.305-11.719-5.695-4.459-17.366l-20.704-3.978L14.475,14.003z"/>
+<linearGradient id="_13" gradientUnits="userSpaceOnUse" x1="48.4" y1="45.14" x2="26.4" y2="15.64">
+<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(#_13)" d="M24.994,28.365l8.648-9.673l4.228-2.288c-6.905,12.095,2.267,20.532,6.18,17.29 c-0.206,0.233-1.306,5.171-1.306,5.171L24.994,28.365z"/>
+<linearGradient id="_14" gradientUnits="userSpaceOnUse" x1="49.78" y1="73.59" x2="33.78" y2="54.09">
+<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="M39.571,52.482c-3.281,3.521-1.765,8.89,0.253,11.328l-3.05,2.604L20.548,42.523L39.571,52.482z "/>
+<linearGradient id="_15" gradientUnits="userSpaceOnUse" x1="66.5" y1="18.51" x2="66.79" y2="46.9">
+<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>
+<polygon fill="url(#_15)" points="63.325,42.008 63.278,24.622 69.948,21.658 69.371,38.502 "/>
+<linearGradient id="_16" gradientUnits="userSpaceOnUse" x1="25.65" y1="17.91" x2="27.75" y2="12.21">
+<stop stop-color="#FFFFFF" offset="0.05"/>
+<stop stop-color="#A2C2DD" offset="1"/>
+</linearGradient>
+<polygon fill="url(#_16)" points="15.205,14.4 18.376,12.659 37.964,16.356 33.643,18.692 "/>
+<linearGradient id="_17" gradientUnits="userSpaceOnUse" x1="55.45" y1="24.23" x2="58.18" y2="16.83">
+<stop stop-color="#FFFFFF" offset="0.05"/>
+<stop stop-color="#A2C2DD" offset="1"/>
+</linearGradient>
+<polygon fill="url(#_17)" points="43.376,20.218 47.438,17.545 69.948,21.658 63.807,24.622 "/>
+<linearGradient id="_18" gradientUnits="userSpaceOnUse" x1="9.41" y1="29.03" x2="15.24" y2="32.03">
+<stop stop-color="#FFFFFF" offset="0.05"/>
+<stop stop-color="#A2C2DD" offset="1"/>
+</linearGradient>
+<path fill="url(#_18)" d="M5.168,31.243c3.055-4.432,8.436-4.929,11.075-3.032l0.301,3.842L5.168,31.243z"/>
+<linearGradient id="_19" gradientUnits="userSpaceOnUse" x1="66" y1="32.31" x2="81.16" y2="58.31">
+<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(#_19)" d="M63.479,40.737l5.963-3.383c7.639-1.027,18.434,11.723,8.048,20.789L63.479,40.737z"/>
+<linearGradient id="_20" gradientUnits="userSpaceOnUse" x1="53.27" y1="11.98" x2="36.67" y2="58.23">
+<stop stop-color="#FFFFFF" offset="0.05"/>
+<stop stop-color="#A2C2DD" offset="1"/>
+</linearGradient>
+<path fill="url(#_20)" d="M63.543,40.685c7.758-3.933,16.752,4.756,16.232,11.543c-0.824,10.789-12.64,9.004-16.388,5.077 L45.833,69.03c4.174-3.883,1.91-14.799-4.674-16.367c-6.584-1.569-9.549,7.171-4.385,13.751l-18.709-5.948l-1.01-16.502 c-6.7,3.158-12.989-4.322-13.017-8.823c-0.04-6.581,7.252-8.843,12.437-3.323L15.205,14.4l18.438,4.292 c-4.241,6.53,0.437,15.692,5.636,16.821c5.2,1.128,9.505-7.159,4.098-15.296l20.431,4.404L63.543,40.685z"/>
+<polygon fill="#A15EB6" points="59.654,80.794 45.195,75.838 43.51,58.344 60.175,62.587 "/>
+<polygon fill="#5E1B67" points="59.654,80.794 70.012,73.638 71.094,55.58 59.654,62.587 "/>
+<linearGradient id="_21" gradientUnits="userSpaceOnUse" x1="43.41" y1="57.36" x2="71.04" y2="57.36">
+<stop stop-color="#DEDEED" offset="0"/>
+<stop stop-color="#9646AC" offset="1"/>
+</linearGradient>
+<polygon fill="url(#_21)" points="43.408,58.344 59.654,62.587 71.042,55.58 54.517,52.14 "/>
+<linearGradient id="_22" gradientUnits="userSpaceOnUse" x1="32.16" y1="82.01" x2="58.74" y2="74.55">
+<stop stop-color="#DEDEED" offset="0"/>
+<stop stop-color="#9646AC" offset="1"/>
+</linearGradient>
+<polygon fill="url(#_22)" points="58.806,67.904 59.629,80.923 45.193,75.631 "/>
+<rect fill="none" height="88" width="88"/>
+</svg>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/resources/qgn_menu_am_widget.svg	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,88 @@
+<?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="100" height="100" viewBox="91.792 -149.167 100 100">
+<linearGradient id="_12" gradientUnits="userSpaceOnUse" x1="128.6" y1="-127.68" x2="193.93" y2="-15.69">
+<stop stop-color="#A2C2DD" offset="0.1"/>
+<stop stop-color="#6C83BB" offset="0.71"/>
+<stop stop-color="#003D6D" offset="0.99"/>
+</linearGradient>
+<path d="M135.493-120.781c-0.478-0.18-12.771-4.823-12.771-4.823l-26.878,13.277 c0,0,12.594,6.267,13.282,6.609c-0.438,0.637-9.085,13.257-9.085,13.257s10.833,3.342,11.251,3.471 c0.057,0.44,2.233,17.397,2.233,17.397l34.702,11.894l24.876-17.188c0,0,1.103-17.331,1.122-17.65 c0.257-0.192,15.861-11.912,15.861-11.912s-14.446-5.944-15.053-6.194c0.227-0.605,4.3-11.491,4.3-11.491l-36.559-7.074 C142.775-131.206,135.776-121.187,135.493-120.781z" fill="url(#_12)"/>
+<linearGradient id="_13" gradientUnits="userSpaceOnUse" x1="145.21" y1="-145.16" x2="190.71" y2="-57.16">
+<stop stop-color="#FFFFFF" offset="0"/>
+<stop stop-color="#A2C2DD" offset="1"/>
+</linearGradient>
+<polygon fill="url(#_13)" points="178.584,-123.833 143.017,-130.716 135.73,-120.284 174.184,-112.071 "/>
+<linearGradient id="_14" gradientUnits="userSpaceOnUse" x1="140.41" y1="-128.26" x2="143.41" y2="-95.26">
+<stop stop-color="#FFFFFF" offset="0"/>
+<stop stop-color="#E0EAF3" offset="0.11"/>
+<stop stop-color="#A2C2DD" offset="0.35"/>
+<stop stop-color="#8CA9CF" offset="0.48"/>
+<stop stop-color="#6C83BB" offset="0.7"/>
+<stop stop-color="#637DB5" offset="0.75"/>
+<stop stop-color="#4C6EA4" offset="0.82"/>
+<stop stop-color="#265689" offset="0.91"/>
+<stop stop-color="#003D6D" offset="0.99"/>
+</linearGradient>
+<polygon fill="url(#_14)" points="109.686,-105.792 147.872,-95.819 174.638,-112.288 135.797,-120.374 "/>
+<linearGradient id="_15" gradientUnits="userSpaceOnUse" x1="107.3" y1="-131.49" x2="135.97" y2="-96.82">
+<stop stop-color="#FFFFFF" offset="0"/>
+<stop stop-color="#E0EAF3" offset="0.11"/>
+<stop stop-color="#A2C2DD" offset="0.35"/>
+<stop stop-color="#8CA9CF" offset="0.48"/>
+<stop stop-color="#6C83BB" offset="0.7"/>
+<stop stop-color="#637DB5" offset="0.75"/>
+<stop stop-color="#4C6EA4" offset="0.82"/>
+<stop stop-color="#265689" offset="0.91"/>
+<stop stop-color="#003D6D" offset="0.99"/>
+</linearGradient>
+<polygon fill="url(#_15)" points="135.572,-120.108 135.572,-98.88 109.721,-105.749 "/>
+<linearGradient id="_16" gradientUnits="userSpaceOnUse" x1="108.62" y1="-137.93" x2="134.12" y2="-68.43">
+<stop stop-color="#FFFFFF" offset="0"/>
+<stop stop-color="#A2C2DD" offset="1"/>
+</linearGradient>
+<polygon fill="url(#_16)" points="97.182,-112.409 110.625,-105.72 135.882,-120.319 123.023,-125.175 "/>
+<polygon fill="#58A015" points="132.854,-86.221 116.422,-91.854 114.508,-111.732 133.445,-106.912 "/>
+<polygon fill="#17594C" points="132.854,-86.221 144.623,-94.354 145.854,-114.873 132.854,-106.912 "/>
+<linearGradient id="_17" gradientUnits="userSpaceOnUse" x1="105.33" y1="-103.01" x2="158.66" y2="-124.34">
+<stop stop-color="#DCE8E4" offset="0"/>
+<stop stop-color="#43910A" offset="1"/>
+</linearGradient>
+<polygon fill="url(#_17)" points="114.392,-111.732 132.854,-106.912 145.794,-114.873 127.016,-118.783 "/>
+<polygon fill="#A15EB6" points="155.074,-85.857 138.643,-91.488 137.395,-111.286 155.666,-106.549 "/>
+<polygon fill="#5E1B67" points="155.074,-85.857 166.844,-93.988 168.074,-114.51 155.074,-106.549 "/>
+<linearGradient id="_18" gradientUnits="userSpaceOnUse" x1="118.58" y1="-107.01" x2="179.92" y2="-117.01">
+<stop stop-color="#DEDEED" offset="0"/>
+<stop stop-color="#9646AC" offset="1"/>
+</linearGradient>
+<polygon fill="url(#_18)" points="137.278,-111.286 155.074,-106.549 168.015,-114.51 149.236,-118.42 "/>
+<linearGradient id="_19" gradientUnits="userSpaceOnUse" x1="151.58" y1="-107.35" x2="177.08" y2="-53.6">
+<stop stop-color="#FFFFFF" offset="0"/>
+<stop stop-color="#E0EAF3" offset="0.11"/>
+<stop stop-color="#A2C2DD" offset="0.35"/>
+<stop stop-color="#8CA9CF" offset="0.48"/>
+<stop stop-color="#6C83BB" offset="0.7"/>
+<stop stop-color="#637DB5" offset="0.75"/>
+<stop stop-color="#4C6EA4" offset="0.82"/>
+<stop stop-color="#265689" offset="0.91"/>
+<stop stop-color="#003D6D" offset="0.99"/>
+</linearGradient>
+<polygon fill="url(#_19)" points="148.205,-60.69 172.549,-77.511 174.761,-112.288 147.872,-95.819 "/>
+<linearGradient id="_20" gradientUnits="userSpaceOnUse" x1="97.82" y1="-111.74" x2="158.07" y2="-62.49">
+<stop stop-color="#FFFFFF" offset="0"/>
+<stop stop-color="#A2C2DD" offset="1"/>
+</linearGradient>
+<polygon fill="url(#_20)" points="148.205,-60.69 114.219,-72.339 109.926,-105.792 149.096,-95.819 "/>
+<polygon fill="#7899BA" points="147.278,-95.021 161.751,-81.749 173.334,-89.417 174.08,-111.786 "/>
+<linearGradient id="_21" gradientUnits="userSpaceOnUse" x1="149.14" y1="-126.92" x2="193.64" y2="-66.92">
+<stop stop-color="#FFFFFF" offset="0"/>
+<stop stop-color="#A2C2DD" offset="1"/>
+</linearGradient>
+<polygon fill="url(#_21)" points="147.528,-95.771 164.385,-88.013 189.001,-106.5 174.33,-112.536 "/>
+<polygon fill="#7899BA" points="147.848,-94.663 110.006,-104.687 112.667,-85.292 144.501,-75.499 "/>
+<linearGradient id="_22" gradientUnits="userSpaceOnUse" x1="123.4" y1="-111.76" x2="128.9" y2="-39.76">
+<stop stop-color="#FFFFFF" offset="0"/>
+<stop stop-color="#A2C2DD" offset="1"/>
+</linearGradient>
+<polygon fill="url(#_22)" points="148.328,-96.028 109.886,-105.927 101.106,-92.935 141.801,-80.379 "/>
+<rect fill="none" height="100" width="100" x="91.792" y="-149.167"/>
+</svg>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/resources/qgn_prop_drm_rights_valid.svg	Tue Aug 31 16:04:40 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="#496DA2" points="8.54,8.603 9.474,8.046 9.328,12.963 8.437,13.543 "/>
+<path d="M8.468,4.789c-0.211,0.13-0.471,0.293-0.748,0.456C7.185,5.456,6.111,4.399,6.745,3.57 c0.293-0.195,0.504-0.309,0.764-0.471C7.07,3.488,7.233,4.854,8.468,4.789z" fill="#496DA2"/>
+<polygon fill="#496DA2" points="8.421,13.559 9.344,12.932 8.688,13.822 7.864,14.373 "/>
+<polygon fill="#496DA2" points="9.633,3.526 11.02,2.778 10.893,8.346 9.75,9.016 "/>
+<polygon fill="#CEE1EF" points="6.083,1.627 4.965,2.088 9.759,3.463 11.035,2.778 "/>
+<path d="M9.805,3.457L4.982,2.084l0.206,5.465l1.32,0.422l0.235,0.757l0.285,0.453l0.835,5.191l0.573-0.83 l0.157-4.906l1.173,0.375L9.805,3.457z M7.166,3.438C7.218,3.44,7.271,3.45,7.326,3.467c0.411,0.129,0.75,0.622,0.76,1.099 c0.01,0.429-0.231,0.695-0.563,0.68C7.472,5.243,7.419,5.234,7.365,5.219C6.963,5.09,6.615,4.597,6.604,4.111 C6.595,3.699,6.84,3.423,7.166,3.438z" fill="#A2C2DD"/>
+<polygon fill="#496DA2" points="6.771,9.591 7.037,9.173 7.75,9.391 7.861,14.361 7.45,14.229 6.847,13.038 6.819,11.782 7.244,11.326 6.793,10.572 "/>
+</svg>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/rom/secuinotificationdialogplugin.iby	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: ROM image files for SecUi notification dialog plugin.
+*
+*/
+
+#ifndef __SECUINOTIFICATIONDIALOGPLUGIN_IBY__
+#define __SECUINOTIFICATIONDIALOGPLUGIN_IBY__
+
+REM DLL
+file=ABI_DIR\UREL\secuinotificationdialogplugin.dll SHARED_LIB_DIR\secuinotificationdialogplugin.dll UNPAGED
+data=\epoc32\data\z\pluginstub\secuinotificationdialogplugin.qtplugin \resource\plugins\devicedialogs\secuinotificationdialogplugin.qtplugin
+data=\epoc32\data\z\resource\qt\crml\secuinotificationdialogplugin.qcrml \resource\qt\crml\secuinotificationdialogplugin.qcrml
+
+/* This is for testing purposes
+file=ABI_DIR\UREL\SecUiTest.exe SHARED_LIB_DIR\SecUiTest.exe
+data=\epoc32\data\z\resource\apps\SecUiTest.rsc \resource\apps\SecUiTest.rsc
+data=\epoc32\data\z\private\10003a3f\import\apps\SecUiTest_reg.rsc \private\10003a3f\import\apps\SecUiTest_reg.rsc
+*/
+#endif  // __SECUINOTIFICATIONDIALOGPLUGIN_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/rom/secuinotificationdialogplugin_resources.iby	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef __SECUINOTIFICATIONDIALOGPLUGIN_RESOURCES_IBY__
+#define __SECUINOTIFICATIONDIALOGPLUGIN_RESOURCES_IBY__
+
+#include <bldvariant.hrh>
+#include <data_caging_paths_for_iby.hrh>
+
+data=DATAZ_\QT_TRANSLATIONS_DIR\secui.qm QT_TRANSLATIONS_DIR\secui.qm 
+
+#endif	// __SECUINOTIFICATIONDIALOGPLUGIN_RESOURCES_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/secui.ts	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="1.0" sourcelanguage="en" language="en">
+  <context>
+    <name>nString</name>
+    <message numerus="no" id="txt_pin_code_dpopinfo_autolock_must_be_active">
+      <source>Autolock must be active</source>
+      <translation variants="no">en #Autolock must be active</translation>
+    </message>
+    <message numerus="no" id="txt_pin_code_dialog_pin2_code">
+      <source>PIN2 code:</source>
+      <translation variants="no">en #PIN2 code:</translation>
+    </message>
+    <message numerus="no" id="txt_pin_code_dpopinfo_insert_sim">
+      <source>Insert SIM</source>
+      <translation variants="no">en #Insert SIM</translation>
+    </message>
+    <message numerus="no" id="txt_pin_code_dpopinfo_gsm_invalid_parameter">
+      <source>Gsm Invalid Parameter</source>
+      <translation variants="no">en #Gsm Invalid Parameter</translation>
+    </message>
+    <message numerus="no" id="txt_pin_code_dialog_new_upin_code">
+      <source>New UPIN code:</source>
+      <translation variants="no">en #New UPIN code:</translation>
+    </message>
+    <message numerus="no" id="txt_pin_code_dialog_new_pin_code">
+      <source>New PIN code:</source>
+      <translation variants="no">en #New PIN code:</translation>
+    </message>
+    <message numerus="no" id="txt_pin_code_dpopinfo_pin2_rejected">
+      <source>PIN2 rejected</source>
+      <translation variants="no">en #PIN2 rejected</translation>
+    </message>
+    <message numerus="yes" id="txt_pin_code_dpopinfo_ln_attempts_remaining">
+      <source> %Ln attempts remaining</source>
+      <translation>
+        <numerusform plurality="a">en #MISSING</numerusform>
+        <numerusform plurality="b">en #MISSING</numerusform>
+      </translation>
+    </message>
+    <message numerus="no" id="txt_pin_code_dpopinfo_operation_not_supported">
+      <source>Operation not supported</source>
+      <translation variants="no">en #Operation not supported</translation>
+    </message>
+    <message numerus="no" id="txt_pin_code_dpopinfo_security_blocked">
+      <source>Security Blocked</source>
+      <translation variants="no">en #Security Blocked</translation>
+    </message>
+    <message numerus="no" id="txt_pin_code_dpopinfo_operation_not_allowed">
+      <source>Operation not Allowed</source>
+      <translation variants="no">en #Operation not Allowed</translation>
+    </message>
+    <message numerus="no" id="txt_pin_code_dpopinfo_emergency_calls_only">
+      <source>Emergency calls only</source>
+      <translation variants="no">en #Emergency calls only</translation>
+    </message>
+    <message numerus="no" id="txt_pin_code_dialog_upin_code">
+      <source>UPIN code:</source>
+      <translation variants="no">en #UPIN code:</translation>
+    </message>
+    <message numerus="no" id="txt_pin_code_dpophead_wrong_pin_code">
+      <source>Wrong PIN code</source>
+      <translation variants="no">en #Wrong PIN code</translation>
+    </message>
+    <message numerus="no" id="txt_pin_code_dialog_verify_new_pin_code">
+      <source>Retype PIN code:</source>
+      <translation variants="no">en #Retype PIN code:</translation>
+    </message>
+    <message numerus="no" id="txt_pin_code_dpopinfo_if_failed_be_ready_with_puk">
+      <source>If failed call customer care to get PUK code</source>
+      <translation variants="no">en #If failed call customer care to get PUK code</translation>
+    </message>
+    <message numerus="no" id="txt_pin_code_dpopinfo_code_chaged">
+      <source>Code chaged</source>
+      <translation variants="no">en #Code chaged</translation>
+    </message>
+    <message numerus="no" id="txt_pin_code_dpopinfo_access_denied">
+      <source>Access Denied</source>
+      <translation variants="no">en #Access Denied</translation>
+    </message>
+    <message numerus="no" id="txt_pin_code_dialog_puk_code">
+      <source>PUK code:</source>
+      <translation variants="no">en #PUK code:</translation>
+    </message>
+    <message numerus="no" id="txt_pin_code_dialog_pin_code">
+      <source>PIN code:</source>
+      <translation variants="no">en #PIN code:</translation>
+    </message>
+    <message numerus="no" id="txt_pin_code_dpopinfo_upin_not_allowed">
+      <source>UPIN not Allowed</source>
+      <translation variants="no">en #UPIN not Allowed</translation>
+    </message>
+    <message numerus="no" id="txt_pin_code_dpophead_last_attempt">
+      <source>Last attempt</source>
+      <translation variants="no">en #Last attempt</translation>
+    </message>
+    <message numerus="no" id="txt_pin_code_dialog_retype_upin_code">
+      <source>Retype UPIN code:</source>
+      <translation variants="no">en #Retype UPIN code:</translation>
+    </message>
+  </context>
+</TS>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/secuinotificationdialogplugin.pro	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,70 @@
+#
+# 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: SecUi notification dialog plugin project.
+#
+
+TEMPLATE = lib
+TARGET = secuinotificationdialogplugin
+CONFIG += plugin
+TRANSLATIONS = secui.ts
+
+CONFIG += hb
+CONFIG += mobility
+MOBILITY = publishsubscribe
+
+# directories
+INCLUDEPATH += .
+DEPENDPATH += .
+INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+INCLUDEPATH += ../../../../inc
+
+HEADERS += inc/secuinotificationdialogplugin.h \
+    inc/secuinotificationdialog.h \
+    inc/secuinotificationcontentwidget.h
+
+SOURCES += src/secuinotificationdialogplugin.cpp \
+    src/secuinotificationdialog.cpp \
+    src/secuinotificationcontentwidget.cpp
+
+RESOURCES += secuinotificationdialogplugin.qrc
+
+symbian: {
+    TARGET.EPOCALLOWDLLDATA = 1
+    # NetworkControl NetworkServices needed for emergency calls
+    TARGET.CAPABILITY = CAP_GENERAL_DLL NetworkControl NetworkServices
+    TARGET.UID3 = 0x2102432C    # TODO: allocate UID
+
+    pluginstub.sources = secuinotificationdialogplugin.dll
+    pluginstub.path = /resource/plugins/devicedialogs
+    DEPLOYMENT += pluginstub
+    crml.sources = secuinotificationdialogplugin.qcrml
+    crml.path = c:/resource/qt/crml
+    DEPLOYMENT += crml
+}
+BLD_INF_RULES.prj_exports += \
+  "$${LITERAL_HASH}include <platform_paths.hrh>" \
+  "qmakepluginstubs/secuinotificationdialogplugin.qtplugin   /epoc32/data/z/pluginstub/secuinotificationdialogplugin.qtplugin"\
+  "rom/secuinotificationdialogplugin.iby    CORE_APP_LAYER_IBY_EXPORT_PATH(secuinotificationdialogplugin.iby)"\
+	"rom/secuinotificationdialogplugin_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(secuinotificationdialogplugin_resources.iby)"
+  
+LIBS += -lxqservice
+LIBS += -lphoneclient
+
+tests {
+    test.depends = sub-src
+    test.commands += cd tsrc && $(MAKE) test
+    autotest.depends = sub-src
+    autotest.commands += cd tsrc && $(MAKE) autotest
+    QMAKE_EXTRA_TARGETS += test autotest
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/secuinotificationdialogplugin.qcrml	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<repository target="RProperty" uidValue="0x100059b5">
+    <key int="0x00000309"  ref="/KPSUidSecurityUIs/KSecurityUIsDismissDialog"></key>
+</repository>
+<repository target="RProperty" uidValue="0x10207218">
+    <key int="0x00000001"  ref="/KPSUidAvkonDomain/KAknKeyguardStatus"></key>
+</repository>
+<repository target="RProperty" uidValue="0x101F8767">
+    <key int="0x00000501"  ref="/KPSUidCoreApplicationUIs/KCoreAppUIsAutolockStatus"></key>
+</repository>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/secuinotificationdialogplugin.qrc	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,6 @@
+<RCC>
+    <qresource prefix="/" >
+        <file alias="cert.svg" >resources/cert.svg</file>
+        <file alias="drm.svg" >resources/drm.svg</file>
+    </qresource>
+</RCC>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/src/secuinotificationcontentwidget.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,367 @@
+/*
+* 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: SecUi notification content widget.
+*
+*/
+
+#include "secuinotificationdebug.h"
+#include "secuinotificationcontentwidget.h"
+#include "secuinotificationdialogpluginkeys.h"
+#include <QGraphicsLinearLayout>
+#include <QToolButton>
+#include <hblabel.h>
+#include <hbpushbutton.h>
+#include <hbiconitem.h>
+#include <hbcombobox.h>
+#include <hblineedit.h>
+#include <hbinputeditorinterface.h>
+#include <QDebug>
+
+#include <HbCheckBox>  // needed for a checkbox dialog
+#include <HbListWidget>  // needed for multicheckbox dialog
+#include <HbListWidgetItem>
+#include <HbAbstractItemView>
+#include <HbEmailAddressFilter>
+
+#define ESecUiCancelSupported  0x1000000
+#define ESecUiCancelNotSupported  0x0000000
+
+#define ESecUiEmergencySupported  0x2000000
+#define ESecUiEmergencyNotSupported  0x0000000
+
+#define ESecUiAlphaSupported  0x4000000
+#define ESecUiAlphaNotSupported  0x0000000
+
+#define ESecUiSecretSupported  0x8000000
+#define ESecUiSecretNotSupported  0x0000000
+
+#define ESecUiMaskFlags  0xFF000000
+#define ESecUiMaskType   0x00FFFFFF
+
+#define ESecUiTypeDeviceLock		0x00100000
+#define ESecUiTypeKeyguard			0x00200000
+#define ESecUiTypeClock  				0x00300000
+#define ESecUiTypeScreensaver		0x00400000
+
+#define ESecUiTypeMaskLock			0x00F00000
+
+
+// ----------------------------------------------------------------------------
+// SecUiNotificationContentWidget::SecUiNotificationContentWidget()
+// ----------------------------------------------------------------------------
+//
+SecUiNotificationContentWidget::SecUiNotificationContentWidget(
+        QGraphicsItem *parent, Qt::WindowFlags flags) : HbWidget(parent, flags)
+{
+		RDEBUG("0", 0);
+}
+
+// ----------------------------------------------------------------------------
+// SecUiNotificationContentWidget::~SecUiNotificationContentWidget()
+// ----------------------------------------------------------------------------
+//
+SecUiNotificationContentWidget::~SecUiNotificationContentWidget()
+{
+}
+
+// ----------------------------------------------------------------------------
+// SecUiNotificationContentWidget::constructFromParameters()
+// ----------------------------------------------------------------------------
+//
+void SecUiNotificationContentWidget::constructFromParameters(const QVariantMap &parameters)
+{
+		RDEBUG("0", 0);
+		RDEBUGQT("parameters", parameters);
+    QGraphicsLinearLayout *mainLayout = new QGraphicsLinearLayout(Qt::Vertical);
+
+    lMinLength = 4;	// might be replaced later
+    lMaxLength = 8;	// might be replaced later
+ 		queryDual=0;
+ 		isEmergency=0;
+       codeTop=0;
+
+    // KApplicationSize
+    if (parameters.contains(KQueryType)) {
+				RDEBUG("0", 0);
+        queryType = parameters.value(KQueryType).toUInt();
+				RDEBUG("queryType", queryType);
+				if( (queryType & ESecUiTypeMaskLock) )
+					{
+					RDEBUG("KQueryType=ESecUiTypeMaskLock", queryType);
+					// showing "Lock" icon. All other params are irrelevant. codeTop is not even created
+					
+        	HbLabel *iconLabel = new HbLabel("Locked");
+        	HbIcon *icon = new HbIcon("qtg_large_device_lock");
+        	// iconLabel->setAspectRatioMode(Qt::IgnoreAspectRatio);
+    			// iconLabel->setGeometry(QRectF(QPointF(10,10),QSizeF(300,300)));
+        	iconLabel->setIcon(*icon);
+        	if( (queryType & ESecUiTypeMaskLock)==ESecUiTypeDeviceLock )
+        		{	// really big icon for the devicelock
+	        	iconLabel->setPreferredHeight(500);
+  	      	iconLabel->setPreferredWidth(500);
+  	      	}
+        	else if( (queryType & ESecUiTypeMaskLock)==ESecUiTypeKeyguard )
+        		{	// smaller icon for the keyguard
+	        	iconLabel->setPreferredHeight(100);
+  	      	iconLabel->setPreferredWidth(100);
+  	      	}
+
+        	// icon->setWidth(300);
+        	// icon->setHeight(350);
+        	// icon->setGeometry(QRectF(QPointF(10,10),QSizeF(500,300)));
+        	// icon->setSize(QSizeF(300,300));
+        	
+        	mainLayout->addItem(iconLabel);
+        	mainLayout->setAlignment(iconLabel, Qt::AlignCenter );
+        	// mainLayout->setGeometry(QRectF(QPointF(10,10),QSizeF(300,300)));
+        	
+					/*
+					QToolButton* mLabelIcon = new QToolButton;
+					mLabelIcon->setIcon(QIcon(":/AutolockSrv_hbicon/qtg_large_device_lock.svg"));
+					mLabelIcon->setIconSize(QSize(300,300));
+					HbLabel *iconLabel = new HbLabel("Locked");
+					iconLabel->setIcon(*mLabelIcon);
+					mainLayout->addItem(iconLabel);
+					*/
+
+        	// mainLayout->setContentsMargins(10,10,300,500);	// this makes the dialog really big
+					setLayout(mainLayout);	// same as at the end
+					return;
+					}
+				// not ESecUiTypeMaskLock
+				lEmergencySupported = ESecUiEmergencyNotSupported;
+				if((queryType & ESecUiEmergencySupported)==ESecUiEmergencySupported)
+					{
+					lEmergencySupported = ESecUiEmergencySupported;
+					}
+				RDEBUG("lEmergencySupported", lEmergencySupported);
+    }
+
+    if (parameters.contains(KQueryMinLength)) {
+				RDEBUG("KQueryMinLength", 0);
+        lMinLength = parameters.value(KQueryMinLength).toUInt();
+				RDEBUG("lMinLength", lMinLength);
+    }
+    if (parameters.contains(KQueryMaxLength)) {
+				RDEBUG("KQueryMaxLength", 0);
+        lMaxLength = parameters.value(KQueryMaxLength).toUInt();
+				RDEBUG("lMaxLength", lMaxLength);
+    }
+
+    if (parameters.contains(KEmergency)) {
+				RDEBUG("KEmergency", 0);
+        QString emergencyText = parameters.value(KEmergency).toString();
+        RDEBUGQT("emergencyText", emergencyText);
+        if(!emergencyText.compare("emergencyYes"))
+        	{
+					RDEBUG("emergencyYes", 1);
+        	isEmergency = 1;
+        	}
+        if(!emergencyText.compare("emergencyNo"))
+        	{
+					RDEBUG("emergencyNo", 0);
+        	isEmergency = 0;
+        	}
+    }
+
+
+    // KCodeTop
+    if (parameters.contains(KCodeTop)) {
+				RDEBUG("KCodeTop", 0);
+        codeTop = new HbLineEdit("");	// no default value
+				RDEBUG("queryType", queryType);
+				codeTop->setInputMethodHints(Qt::ImhDigitsOnly);	// default
+ 		    if (queryType & ESecUiAlphaSupported)
+		    	{
+					RDEBUG("ESecUiAlphaSupported", ESecUiAlphaSupported);
+ 	    		codeTop->setInputMethodHints(Qt::ImhNone);
+		  		}
+ 		    if (queryType & ESecUiSecretSupported)
+		    	{
+					RDEBUG("ESecUiSecretSupported", ESecUiSecretSupported);
+ 	    		codeTop->setEchoMode(HbLineEdit::PasswordEchoOnEdit);
+		  		}
+				RDEBUG("lMaxLength", lMaxLength);
+        if(lMaxLength>2)
+	        codeTop->setMaxLength(lMaxLength);
+				
+				if (parameters.contains(KDefaultCode)) {
+					RDEBUG("KDefaultCode", 0);
+  	      QString defaultCode = parameters.value(KDefaultCode).toString();
+    	    RDEBUGQT("defaultCode", defaultCode);
+					codeTop->setText(defaultCode);
+					}
+				RDEBUG("1", 1);
+
+        connect(codeTop, SIGNAL(textChanged(const QString &)), this, SIGNAL(codeTopChanged(const QString &)));
+        connect(codeTop, SIGNAL(contentsChanged()), this, SIGNAL(codeTopContentChanged()));
+
+				if (parameters.contains(KDefaultCode)) {	// this is done in this step so that the OK becomes valid (if rules are fulfilled)
+					RDEBUG("KDefaultCode", 0);
+  	      QString defaultCode = parameters.value(KDefaultCode).toString();
+    	    RDEBUGQT("defaultCode", defaultCode);
+					codeTop->setText(defaultCode);
+					}
+				RDEBUG("2", 2);
+
+		    if (parameters.contains(KDialogTitle)) {
+		        QString titleText = parameters.value(KDialogTitle).toString();
+		        QString titleAttempts = "";
+		   			if(titleText.indexOf('|')>0)
+		    				{	// if separator, take only first part
+		    				titleText = titleText.left(titleText.indexOf('|'));
+		    				}
+		   			if(titleText.indexOf('$')>0)
+		    				{	// if separator, take only first part
+		    					// it comes translated alredy, from the client
+		    				titleAttempts = titleText.right(titleText.length()-titleText.indexOf('$')-1);
+		    				RDEBUGQT("titleAttempts", titleAttempts);
+		    				int nAttempts = titleAttempts.toInt();
+		    				RDEBUG("nAttempts", nAttempts);
+		    				titleText = titleText.left(titleText.indexOf('$'));	// this comes translated already
+								if(nAttempts==1)	// last attempt
+		    					{
+		    					// This must be in a new line, to avoid problems with left-to-right writing
+		    					titleAttempts = hbTrId("txt_pin_code_dpophead_last_attempt");
+			    				}
+			    			else if(nAttempts>0)
+		    					{
+		    					titleAttempts = hbTrId("attempts") + "=" + QString::number(nAttempts);
+		    					// TODO this requires %L1 localization using txt_pin_code_dpopinfo_ln_attempts_remaining
+			    				}
+			    			else if(nAttempts==0)
+		    					{
+		    					titleAttempts = "";	// something special for the last attempt ?
+			    				}
+				    		else
+				    			{
+				    			titleAttempts = "";
+				    			}
+				    		}
+		        HbLabel *titleTop = new HbLabel(titleText);
+		        mainLayout->addItem(titleTop);
+		        if (titleAttempts.length()>0 )
+		        	{
+		        	HbLabel *titleTopAttemps = new HbLabel(titleAttempts);
+		        	mainLayout->addItem(titleTopAttemps);
+		        	}
+		        // in the dialog, it was setHeadingWidget(title);
+		    }
+				RDEBUG("3", 3);
+    		mainLayout->addItem(codeTop);
+    		// double-query
+    		if (parameters.contains(KCodeBottom))
+    			{
+    			queryDual=1;
+    			QString titleText = parameters.value(KDialogTitle).toString();
+    			if(titleText.indexOf('|')>0)
+    				{	// if no separator, don't create label
+    				QString titleBottomStr = titleText.right(titleText.length()-titleText.indexOf('|')-1);
+    				// no need to translate
+    				HbLabel *titleBottom = new HbLabel(titleBottomStr);
+    				mainLayout->addItem(titleBottom);
+    				}
+    			
+        	codeBottom = new HbLineEdit("");	// no default value
+	        if(lMaxLength>2)
+		        codeBottom->setMaxLength(lMaxLength);
+	    		codeBottom->setInputMethodHints(Qt::ImhDigitsOnly);	// default
+	 		    if (queryType & ESecUiAlphaSupported)
+			    	{
+			    	RDEBUG("setInputMethodHints", 0);
+	 	    		codeBottom->setInputMethodHints(Qt::ImhNone);
+			  		}
+	 		    if (queryType & ESecUiSecretSupported)
+			    	{
+			    	RDEBUG("ESecUiSecretSupported", 0);
+	 	    		codeBottom->setEchoMode(HbLineEdit::PasswordEchoOnEdit);	// this will also remove predictive, which is what we want
+			  		}
+		    	RDEBUG("connecting", 0);
+	        connect(codeBottom, SIGNAL(textChanged(const QString &)), this, SIGNAL(codeBottomChanged(const QString &)));
+        	connect(codeBottom, SIGNAL(contentsChanged(const QString &)), this, SIGNAL(codeBottomChanged(const QString &)));
+	    		mainLayout->addItem(codeBottom);
+	    		}
+
+    		QGraphicsLinearLayout *mainLayoutButtons = new QGraphicsLinearLayout(Qt::Horizontal);
+        HbPushButton *but1 = new HbPushButton("1234");
+        HbPushButton *but2 = new HbPushButton("+1");
+        HbPushButton *but3 = new HbPushButton("+5");
+        connect(but1, SIGNAL(clicked()), this, SIGNAL(but1Changed()));
+        connect(but2, SIGNAL(clicked()), this, SIGNAL(but2Changed()));
+        connect(but3, SIGNAL(clicked()), this, SIGNAL(but3Changed()));
+        #if defined(_DEBUG)
+        mainLayoutButtons->addItem(but1);
+        mainLayoutButtons->addItem(but2);
+        mainLayoutButtons->addItem(but3);
+        #endif
+
+        mainLayout->addItem(mainLayoutButtons);
+        
+        // remove setFocus from PIN query because Orbit can't handle it
+        // codeTop->setFocus();	// this should open the VKB
+
+    }
+
+    if (parameters.contains(KChecboxType)) {
+	    	RDEBUG("KChecboxType", 0);
+        if (parameters.contains(KDialogTitle)) {
+            //TODO position of the label is not centered
+            QString tmpText=parameters.value(KDialogTitle).toString();
+            if (tmpText.endsWith("\n"))  tmpText=tmpText.left(tmpText.length()-1);
+            DialogText= new HbLabel(tmpText);   
+            DialogText->setTextWrapping(Hb::TextWordWrap);
+            DialogText->setAlignment(Qt::AlignVCenter);
+            mainLayout->addItem(DialogText);                   
+        }
+
+        checkbox = new HbCheckBox("Caption");   
+        if (parameters.contains(KDefaultCode)) {
+	    			RDEBUG("KDefaultCode", 0);
+            QStringList list1 = parameters.value(KDefaultCode).toString().split("|");
+            if (!list1.isEmpty() && list1.count()==2) {
+                if (!list1[0].isNull() && !list1[0].isEmpty()) checkbox->setText(list1[0]);
+                if (!list1[1].isNull() && !list1[1].isEmpty()) checkbox->setChecked(list1[1].toInt());
+            }
+            // TODO this needs localization
+        }
+        mainLayout->addItem(checkbox);
+    }
+
+    if (parameters.contains(KMultiChecboxType) && parameters.contains(KDefaultCode)) 
+    	{
+   			RDEBUG("KMultiChecboxType", 0);
+        QStringList list1 = parameters.value(KDefaultCode).toString().split("1\t");
+        if (!list1.isEmpty()) {
+            listWidget = new HbListWidget();
+            for (int i = 0; (i < list1.count()); i++)
+                if (!list1[i].isEmpty() && !list1[i].isNull()) {
+                    HbListWidgetItem* modelItem = new HbListWidgetItem();
+                    modelItem->setData(QVariant(list1[i]), Qt::DisplayRole);
+            				// TODO this needs localization
+                    listWidget->addItem(modelItem);  
+                }
+            listWidget->setCurrentRow(0);
+            listWidget->setSelectionMode(HbAbstractItemView::MultiSelection);
+            //listWidget->setClampingStyle(HbScrollArea::BounceBackClamping);
+            listWidget->setVerticalScrollBarPolicy(HbScrollArea::ScrollBarAsNeeded);
+            listWidget->setMaximumHeight(150);
+            mainLayout->addItem(listWidget); 
+            //     delete listWidget;
+            }
+        }
+
+    setLayout(mainLayout);
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/src/secuinotificationdialog.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,877 @@
+/*
+* 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: SecUi notification plugin class.
+*
+*/
+
+#include "secuinotificationdebug.h"
+#include "secuinotificationdialog.h"
+#include "secuinotificationdialogpluginkeys.h"
+#include "secuinotificationcontentwidget.h"
+// #include <hbpopupbase.h>        // HbPopupBase::NoTimeout
+#include <hblabel.h>
+#include <hbaction.h>
+#include <QDebug>
+#include <e32debug.h>
+#include <hbtranslator.h>
+#include <cphcltemergencycall.h>
+#include <SCPServerInterface.h>	// for TARM error codes while validating new lock code
+#include <QString>
+#include <QDialogButtonBox>
+#include <HbEditorInterface>
+#include <e32property.h>
+
+QTM_USE_NAMESPACE
+
+const QString KTranslationsPath = "/resource/qt/translations/";
+const QString KSecUiNotificationTranslationsFile = "secui";
+const QString KCommonTranslationsFile = "common";
+
+#include <qvaluespacesubscriber.h>
+#include <qvaluespacepublisher.h>
+#define ESecUiBasicTypeText    0x0000000
+#define ESecUiBasicTypeCheck   0x0010000
+#define ESecUiBasicTypeCheckMulti   0x0020000
+#define ESecUiBasicTypeMask    0x00F0000
+
+#define ESecUiCancelSupported  0x1000000
+#define ESecUiCancelNotSupported  0x0000000
+
+#define ESecUiEmergencySupported  0x2000000
+#define ESecUiEmergencyNotSupported  0x0000000
+
+#define ESecUiAlphaSupported  0x4000000
+#define ESecUiAlphaNotSupported  0x0000000
+
+#define ESecUiSecretSupported  0x8000000
+#define ESecUiSecretNotSupported  0x0000000
+
+#define ESecUiMaskFlags  0xFF000000
+#define ESecUiMaskType   0x00FFFFFF
+
+#define ESecUiTypeDeviceLock		0x00100000
+#define ESecUiTypeKeyguard			0x00200000
+#define ESecUiTypeClock  				0x00300000
+#define ESecUiTypeScreensaver		0x00400000
+
+#define ESecUiTypeMaskLock			0x00F00000
+
+const TUid KPSUidSecurityUIs = { 0x100059b5 };
+const TUint32 KSecurityUIsDismissDialog  = 0x00000309;
+
+enum TSecurityUIsDismissDialogValues
+    {
+    ESecurityUIsDismissDialogUninitialized = 0,
+    ESecurityUIsDismissDialogOn,
+    ESecurityUIsDismissDialogProcessing,
+    ESecurityUIsDismissDialogDone,
+    ESecurityUIsDismissDialogLastValue
+    };
+
+// ----------------------------------------------------------------------------
+// SecUiNotificationDialog::SecUiNotificationDialog()
+// ----------------------------------------------------------------------------
+//
+SecUiNotificationDialog::SecUiNotificationDialog(
+        const QVariantMap &parameters) : HbDialog(), mCommonTranslator(0), mSecUiNotificationTranslator(0), mLastError(KNoError)
+{
+		RDEBUG("0", 0);
+		TTime myTime;
+    myTime.HomeTime();
+		mMyId = I64LOW( myTime.Int64() );
+    mCommonTranslator = new HbTranslator(KTranslationsPath, KCommonTranslationsFile);
+    mSecUiNotificationTranslator = new HbTranslator(KTranslationsPath, KSecUiNotificationTranslationsFile);
+    constructDialog(parameters);
+}
+
+// ----------------------------------------------------------------------------
+// SecUiNotificationDialog::~SecUiNotificationDialog()
+// ----------------------------------------------------------------------------
+//
+SecUiNotificationDialog::~SecUiNotificationDialog()
+{
+		RDEBUG("0", 0);
+    delete mSecUiNotificationTranslator;
+    delete mCommonTranslator;
+		RDEBUG("0", 0);
+    // TODO what about subscriberKSecurityUIsDismissDialog
+    // and codeTop
+		RDEBUG("1", 1);
+}
+
+// ----------------------------------------------------------------------------
+// SecUiNotificationDialog::setDeviceDialogParameters()
+// ----------------------------------------------------------------------------
+//
+bool SecUiNotificationDialog::setDeviceDialogParameters(const QVariantMap &parameters)
+{
+	 RDEBUG("0", 0);
+   return constructDialog(parameters);
+}
+
+// ----------------------------------------------------------------------------
+// SecUiNotificationDialog::deviceDialogError()
+// ----------------------------------------------------------------------------
+//
+int SecUiNotificationDialog::deviceDialogError() const
+{
+		RDEBUG("mLastError", mLastError);
+		RDEBUG("mMyId", mMyId);
+    return mLastError;
+}
+
+// ----------------------------------------------------------------------------
+// SecUiNotificationDialog::closeDeviceDialog
+// ----------------------------------------------------------------------------
+//
+void SecUiNotificationDialog::closeDeviceDialog(bool byClient)
+{
+    Q_UNUSED(byClient);
+		RDEBUG("mMyId", mMyId);
+		RDEBUG("calling close()", 0);
+    close();
+		RDEBUG("mShowEventReceived", mShowEventReceived);
+
+    // 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) {
+    		RDEBUG("emitting deviceDialogClosed", 0);
+        emit deviceDialogClosed();
+				if(1==0 && subscriberKSecurityUIsDismissDialog)
+					{
+						RDEBUG("disconnect subscriberKSecurityUIsDismissDialog", 0);
+						disconnect(subscriberKSecurityUIsDismissDialog, SIGNAL(contentsChanged()), this, SLOT(subscriberKSecurityUIsDismissDialogChanged()));
+						RDEBUG("disconnected subscriberKSecurityUIsDismissDialog", 1);
+						if(1==1)
+							{
+							RDEBUG("deleting subscriberKSecurityUIsDismissDialog", 0);
+							delete subscriberKSecurityUIsDismissDialog;
+							subscriberKSecurityUIsDismissDialog = NULL;
+							RDEBUG("deleted subscriberKSecurityUIsDismissDialog", 1);
+							}
+				 }
+    }
+    RDEBUG("0", 0);
+}
+
+// ----------------------------------------------------------------------------
+// SecUiNotificationDialog::deviceDialogWidget
+// ----------------------------------------------------------------------------
+//
+HbDialog *SecUiNotificationDialog::deviceDialogWidget() const
+{
+    return const_cast<SecUiNotificationDialog*>(this);
+}
+
+// ----------------------------------------------------------------------------
+// SecUiNotificationDialog::hideEvent
+// ----------------------------------------------------------------------------
+//
+void SecUiNotificationDialog::hideEvent(QHideEvent *event)
+{
+		RDEBUG("0", 0);
+    HbDialog::hideEvent(event);
+		RDEBUG("mMyId", mMyId);
+		RDEBUG("calling close()", 0);
+		close();
+		RDEBUG("emitting deviceDialogClosed", 0);
+		emit deviceDialogClosed();
+		RDEBUG("deviceDialogClosed", 1);
+		if(1==0 && subscriberKSecurityUIsDismissDialog)
+			{
+				RDEBUG("disconnect subscriberKSecurityUIsDismissDialog", 0);
+				disconnect(subscriberKSecurityUIsDismissDialog, SIGNAL(contentsChanged()), this, SLOT(subscriberKSecurityUIsDismissDialogChanged()));
+				RDEBUG("disconnected subscriberKSecurityUIsDismissDialog", 1);
+				if(1==1)
+					{ 
+					RDEBUG("deleting subscriberKSecurityUIsDismissDialog", 0);
+					delete subscriberKSecurityUIsDismissDialog;
+					subscriberKSecurityUIsDismissDialog = NULL;
+					RDEBUG("deleted subscriberKSecurityUIsDismissDialog", 1);
+					}
+			}
+    // old method was   emit deviceDialogClosed();
+   RDEBUG("0", 0);
+}
+
+// ----------------------------------------------------------------------------
+// SecUiNotificationDialog::showEvent
+// ----------------------------------------------------------------------------
+//
+void SecUiNotificationDialog::showEvent(QShowEvent *event)
+{
+		RDEBUG("0", 0);
+		RDEBUG("mMyId", mMyId);
+    HbDialog::showEvent(event);
+
+		if(!(queryType & ESecUiTypeMaskLock))
+			{	// not for the "lock icon"
+			RDEBUG("check default.1", 0);
+			if(codeTop!=NULL)
+            {
+            RDEBUG("check default.2", 0);
+            if(codeTop->text().length()>0)	// there's a default value. Verify it and (might) enable OK
+                {
+                RDEBUG("check default.3", 0);
+                handleCodeTopChanged(codeTop->text());
+                }
+            RDEBUG("setFocus", 0);
+        		// remove setFocus from PIN query because Orbit can't handle it
+      			// codeTop->setFocus();	// this should open the VKB . Doesn't seem to work when it's done on the widget, so it's done here.
+            }	// codeTop!=NULL
+            
+			const TUint32 KSecurityUIsTestCode  = 0x00000307;
+			TInt value = 0;
+			TInt err = RProperty::Get(KPSUidSecurityUIs, KSecurityUIsTestCode, value );
+			RDEBUG("KSecurityUIsTestCode err", err);
+			RDEBUG("faking value", value);
+			RDEBUG("mShowEventReceived", mShowEventReceived);
+			if(value>0 && value<1000000 && mShowEventReceived==true)	// show happens 2 times. Dialog can be closed only the second.
+				{
+				QString myString = "";
+				myString += QString("%1").arg(value);
+				RDEBUGQT("myString", myString);
+		    codeTop->setText( myString );
+		    TInt err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsTestCode, 0 );	// clear after using it
+		    RDEBUGQT("calling handleAccepted myString", myString);
+		    emit handleAccepted();
+				// handleAccepted already   emit closeDeviceDialog(false);	// false means "not by client", although it's not really used
+				}
+			}
+    mShowEventReceived = true;
+    RDEBUG("1", 1);
+}
+
+// ----------------------------------------------------------------------------
+// SecUiNotificationDialog::constructDialog()
+// ----------------------------------------------------------------------------
+//
+bool SecUiNotificationDialog::constructDialog(const QVariantMap &parameters)
+    {
+		RDEBUG("0", 0);
+		RDEBUG("mMyId", mMyId);
+    setTimeout(HbPopup::NoTimeout);
+    setDismissPolicy(HbPopup::NoDismiss);
+    setModal(true);
+    mShowEventReceived = false;
+    subscriberKSecurityUIsDismissDialog = NULL;
+    titleWidget = NULL;
+		RDEBUG("subscriberKSecurityUIsDismissDialog NULL", 0);
+
+    subscriberKSecurityUIsDismissDialog = new QValueSpaceSubscriber("/KPSUidSecurityUIs/KSecurityUIsDismissDialog", this);
+    if(subscriberKSecurityUIsDismissDialog)
+    	{
+    	RDEBUG("subscriberKSecurityUIsDismissDialog created", 1);
+    	}
+    else
+    	{
+    	RDEBUG("subscriberKSecurityUIsDismissDialog not created", 0);
+    	}
+    connect(subscriberKSecurityUIsDismissDialog, SIGNAL(contentsChanged()), this, SLOT(subscriberKSecurityUIsDismissDialogChanged()));
+		RDEBUG("subscriberKSecurityUIsDismissDialog", 1);
+
+    // Title
+    // this is also done later in the widget
+    // For now, it only says "Security"
+    if (parameters.contains(KDialogTitle)) {
+        QString titleText = parameters.value(KDialogTitle).toString();
+        QString titleAttempts = "";
+   			if(titleText.indexOf('|')>0)
+    				{	// if separator, take only first part
+    				titleText = titleText.left(titleText.indexOf('|'));
+    				}
+   			if(titleText.indexOf('$')>0)
+    				{	// if separator, take only first part
+    				titleAttempts = titleText.right(titleText.length()-titleText.indexOf('$')-1);
+    				RDEBUGQT("titleAttempts", titleAttempts);
+    				int nAttempts = titleAttempts.toInt();
+    				RDEBUG("nAttempts", nAttempts);
+    				titleText = titleText.left(titleText.indexOf('$'));
+    				if(nAttempts>0)
+    					titleText = titleText + " attempts=" + QString::number(nAttempts);
+    				}
+    		titleText = hbTrId("Security Query");	// this is the header, for any potential later error which needs to be displayed
+        // This is created only if needed (i.e. errors for NewLockCode)
+        // titleWidget = new HbLabel(titleText);
+        // setHeadingWidget(titleWidget);
+    }
+
+	    if (parameters.contains(KEmergency)) {
+					RDEBUG("KEmergency", 1);
+	        QString emergencyText = parameters.value(KEmergency).toString();
+	        RDEBUGQT("emergencyText", emergencyText);
+	        if(!emergencyText.compare("emergencyYes"))
+	        	{
+	        	RDEBUG("emergencyYes", 1);
+	        	isEmergency = 1;
+	        	okAction->setEnabled(true);
+	        	okAction->setText(hbTrId("Call"));
+    				return true;
+	        	}
+	        if(!emergencyText.compare("emergencyNo"))
+	        	{
+	        	RDEBUG("emergencyNo", 1);
+	        	isEmergency = 0;
+	        	okAction->setEnabled(false);	// 112 -> 1122 (=password) . This is handled by   < lMinLength 
+	        	okAction->setText(hbTrId("Ok"));
+    				return true;
+	        	}
+	    }
+	    // after TARM validation.
+	    if (parameters.contains(KInvalidNewLockCode)) {
+					RDEBUG("KInvalidNewLockCode", 0);
+	        QString invalidText = parameters.value(KInvalidNewLockCode).toString();
+	        RDEBUGQT("invalidText", invalidText);
+	        QString newTitleText = "Lock Code";	// TODO take from the original one
+
+	        QString invalidStr = invalidText.right(invalidText.length()-invalidText.indexOf('$')-1);
+	        int invalidNumber = invalidStr.toInt();
+	        RDEBUG("invalidNumber", invalidNumber);
+	        if(invalidNumber<0)	// that is, -1
+	        	{
+	        	RDEBUG("invalidNumber<0", invalidNumber );
+	        	// nothing to do
+	        	}
+				if(invalidNumber==EDeviceLockAutolockperiod)
+	        	{
+	        	RDEBUG("EDeviceLockAutolockperiod", invalidNumber );
+	        	newTitleText+=hbTrId("EDeviceLockAutolockperiod");
+	        	}
+	        if(invalidNumber==EDeviceLockMaxAutolockPeriod)
+	        	{
+	        	RDEBUG("EDeviceLockAutolockperiod", invalidNumber );
+	        	newTitleText+=hbTrId("EDeviceLockMaxAutolockPeriod");
+	        	}
+	        if(invalidNumber==EDeviceLockMinlength)
+	        	{
+	        	RDEBUG("EDeviceLockMinlength", invalidNumber );
+	        	newTitleText+=hbTrId("EDeviceLockMinlength");
+	        	}
+	        if(invalidNumber==EDeviceLockMaxlength)
+	        	{
+	        	RDEBUG("EDeviceLockMaxlength", invalidNumber );
+	        	newTitleText+=hbTrId("EDeviceLockMaxlength");
+	        	}
+	        if(invalidNumber==EDeviceLockRequireUpperAndLower)
+	        	{
+	        	RDEBUG("EDeviceLockRequireUpperAndLower", invalidNumber );
+	        	newTitleText+=hbTrId("EDeviceLockRequireUpperAndLower");
+	        	}
+	        if(invalidNumber==EDeviceLockRequireCharsAndNumbers)
+	        	{
+	        	RDEBUG("EDeviceLockMaxlength", invalidNumber );
+	        	newTitleText+=hbTrId("EDeviceLockMaxlength");
+	        	}
+	        if(invalidNumber==EDeviceLockAllowedMaxRepeatedChars)
+	        	{
+	        	RDEBUG("EDeviceLockAllowedMaxRepeatedChars", invalidNumber );
+	        	newTitleText+=hbTrId("EDeviceLockAllowedMaxRepeatedChars");
+	        	}
+	        if(invalidNumber==EDeviceLockHistoryBuffer)
+	        	{
+	        	RDEBUG("EDeviceLockHistoryBuffer", invalidNumber );
+	        	newTitleText+=hbTrId("EDeviceLockHistoryBuffer");
+	        	}
+	        if(invalidNumber==EDeviceLockPasscodeExpiration)
+	        	{
+	        	RDEBUG("EDeviceLockPasscodeExpiration", invalidNumber );
+	        	newTitleText+=hbTrId("EDeviceLockPasscodeExpiration");
+	        	}
+	        if(invalidNumber==EDeviceLockMinChangeTolerance)
+	        	{
+	        	RDEBUG("EDeviceLockMinChangeTolerance", invalidNumber );
+	        	newTitleText+=hbTrId("EDeviceLockMinChangeTolerance");
+	        	}
+	        if(invalidNumber==EDeviceLockMinChangeInterval)
+	        	{
+	        	RDEBUG("EDeviceLockMinChangeInterval", invalidNumber );
+	        	newTitleText+=hbTrId("EDeviceLockMinChangeInterval");
+	        	}
+	        if(invalidNumber==EDeviceLockDisallowSpecificStrings)
+	        	{
+	        	RDEBUG("EDeviceLockDisallowSpecificStrings", invalidNumber );
+	        	newTitleText+=hbTrId("EDeviceLockDisallowSpecificStrings");
+	        	}
+	        if(invalidNumber==EDeviceLockAllowedMaxAtempts)
+	        	{
+	        	RDEBUG("EDeviceLockAllowedMaxAtempts", invalidNumber );
+	        	newTitleText+=hbTrId("EDeviceLockAllowedMaxAtempts");
+	        	}
+	        if(invalidNumber==EDeviceLockConsecutiveNumbers)
+	        	{
+	        	RDEBUG("EDeviceLockConsecutiveNumbers", invalidNumber );
+	        	newTitleText+=hbTrId("EDeviceLockConsecutiveNumbers");
+	        	}
+	        if(invalidNumber==EDeviceLockMinSpecialCharacters)
+	        	{
+	        	RDEBUG("EDeviceLockMinSpecialCharacters", invalidNumber );
+	        	newTitleText+=hbTrId("EDeviceLockMinSpecialCharacters");
+	        	}
+	        if(invalidNumber==EDeviceLockSingleCharRepeatNotAllowed)
+	        	{
+	        	RDEBUG("EDeviceLockSingleCharRepeatNotAllowed", invalidNumber );
+	        	newTitleText+=hbTrId("EDeviceLockSingleCharRepeatNotAllowed");
+	        	}
+	        if(invalidNumber==EDevicelockConsecutiveCharsNotAllowed)
+	        	{
+	        	RDEBUG("EDevicelockConsecutiveCharsNotAllowed", invalidNumber );
+	        	newTitleText+=hbTrId("EDevicelockConsecutiveCharsNotAllowed");
+	        	}
+	        if(invalidNumber>=EDevicelockTotalPolicies)
+	        	{
+	        	RDEBUG("EDevicelockTotalPolicies", invalidNumber );
+	        	newTitleText+=hbTrId("EDevicelockTotalPolicies");
+	        	}
+	        if( !titleWidget )
+	        	{
+	        	RDEBUG("creating titleWidget", 0 );
+	        	titleWidget = new HbLabel(hbTrId("New lock code"));	// it will be changed later
+          	setHeadingWidget(titleWidget);
+          	}
+          RDEBUG("setPlainText", 0 );
+	        titleWidget->setPlainText(newTitleText);
+	        
+	        if(invalidNumber<0)	// everything is ok
+	        	{
+	        	okAction->setEnabled(true);	// this might fail in the scenario: check this : invalid -> valid. This allows verif ?
+	        	okAction->setText(hbTrId("Ok"));
+	        	codeBottom->setEnabled(true);
+	        	}
+	        else
+	        	{
+	        	okAction->setEnabled(false);
+	        	codeBottom->setEnabled(false);
+	        	codeBottom->setText("");
+	        	okAction->setText(hbTrId("Ok"));
+	        	}
+	        // need to return because all objects are already created
+   				return true;
+	    }
+	
+    // Content
+    SecUiNotificationContentWidget *content = new SecUiNotificationContentWidget();
+    content->constructFromParameters(parameters);
+    setContentWidget(content);
+
+		queryType = content->queryType;
+		queryDual = content->queryDual;
+		isEmergency = content->isEmergency;
+    codeTop=NULL;
+		codeTop = content->codeTop;
+    checkBox = content->checkbox;
+    listWidget = content->listWidget;
+		codeBottom = content->codeBottom;
+		lMinLength = content->lMinLength;
+		lMaxLength = content->lMaxLength;
+		lEmergencySupported = content->lEmergencySupported;
+
+    connect(content, SIGNAL(codeTopChanged(const QString &)), this, SLOT(handleCodeTopChanged(const QString &)));
+    connect(content, SIGNAL(codeBottomChanged(const QString &)), this, SLOT(handleCodeBottomChanged(const QString &)));
+    connect(content, SIGNAL(codeTopContentChanged()), this, SLOT(handleCodeTopContentChanged()));
+    connect(content, SIGNAL(but1Changed()), this, SLOT(handlebut1Changed()));
+    connect(content, SIGNAL(but2Changed()), this, SLOT(handlebut2Changed()));
+    connect(content, SIGNAL(but3Changed()), this, SLOT(handlebut3Changed()));
+		RDEBUG("queryType", queryType);
+    // Buttons
+    if( (queryType & ESecUiTypeMaskLock))
+    	{
+    	// no need to create OK or Cancel
+    	return true;
+    	}
+
+    okAction = new HbAction(hbTrId("Ok"));
+    RDEBUG("created HbAction okAction", 1);
+    okAction->setEnabled(false);	// initially the OK is disabled because codeTop is empty
+    if((queryType & ESecUiBasicTypeMask) ==ESecUiBasicTypeCheck) {
+        okAction->setEnabled(true);
+        setHeadingWidget(0); // had to remove this no multiline
+    }
+    else if ((queryType & ESecUiBasicTypeMask) ==ESecUiBasicTypeCheckMulti){
+        okAction->setEnabled(true);
+    }
+
+    // setAction(okAction, QDialogButtonBox::AcceptRole);	// it's supposed to use this, when deprecated
+    // setPrimaryAction(okAction);
+    addAction(okAction);
+    disconnect(okAction, SIGNAL(triggered()), this, SLOT(close()));	// the close will be done in handleAccepted
+    connect(okAction, SIGNAL(triggered()), this, SLOT(handleAccepted()));
+    
+    cancelAction = new HbAction(hbTrId("Cancel"));    // qtTrId("txt_common_button_cancel")
+    addAction(cancelAction);
+    disconnect(cancelAction, SIGNAL(triggered()), this, SLOT(close()));	// the close will be done in handleCancelled
+    connect(cancelAction, SIGNAL(triggered()), this, SLOT(handleCancelled()));
+    // setAction(cancelAction, QDialogButtonBox::RejectRole);		// it's supposed to use this, when deprecated
+    // setSecondaryAction(cancelAction);
+
+		// this should had been set by Autolock, but just to be sure
+    TInt ret = RProperty::Define(KPSUidSecurityUIs, KSecurityUIsDismissDialog,
+            RProperty::EInt, TSecurityPolicy(TSecurityPolicy::EAlwaysPass),
+            TSecurityPolicy(TSecurityPolicy::EAlwaysPass));
+    RDEBUG("defined KSecurityUIsDismissDialog", ret);
+    TInt aDismissDialog = -1;
+    ret = RProperty::Get(KPSUidSecurityUIs, KSecurityUIsDismissDialog, aDismissDialog );
+    RDEBUG("ret", ret);
+    RDEBUG("aDismissDialog", aDismissDialog);
+    if(aDismissDialog==ESecurityUIsDismissDialogOn || aDismissDialog==ESecurityUIsDismissDialogProcessing)
+    	{
+    	RDebug::Printf( "potential error: %s %s (%u) aDismissDialog=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aDismissDialog );
+    	}
+	
+		RDEBUG("check cancel", 0);
+    if ((queryType & ESecUiCancelSupported)==ESecUiCancelSupported)
+    	{
+    		// nothing to do. Cancel is enabled by default
+    	}
+  	else
+  		{
+				RDEBUG("disable Cancel", 1);
+  			cancelAction->setEnabled(false);
+  			cancelAction->setText("");
+  			cancelAction->setVisible(false);
+  		}
+    
+    return true;
+}
+
+// ----------------------------------------------------------------------------
+// SecUiNotificationDialog::sendResult()
+// ----------------------------------------------------------------------------
+//
+void SecUiNotificationDialog::sendResult(int accepted)
+{
+		RDEBUG("0", 0);
+		RDEBUG("mMyId", mMyId);
+    QVariant acceptedValue(accepted);
+		RDEBUG("0", 0);
+    mResultMap.insert(KResultAccepted, acceptedValue);
+		RDEBUG("0", 0);
+		RDEBUGQT("mResultMap", mResultMap);
+		RDEBUG("queryType", queryType);
+		if(!(queryType & ESecUiTypeMaskLock))
+			{	// the lock-icon should not reply
+			RDEBUG("emit deviceDialogData", 0);
+    	emit deviceDialogData(mResultMap);
+    	}
+		RDEBUG("1", 1);
+}
+
+// ----------------------------------------------------------------------------
+// SecUiNotificationDialog::handleAccepted()
+// ----------------------------------------------------------------------------
+//
+void SecUiNotificationDialog::handleAccepted()
+{
+		RDEBUG("0", 0);
+		// okAction
+		RDEBUG("mMyId", mMyId);
+		QString codeTopText="";
+
+		if( (queryType & ESecUiTypeMaskLock))
+    	{
+    	codeTopText = "Unlock-Request";
+    	}
+    else if( (queryType & ESecUiBasicTypeMask)==ESecUiBasicTypeCheck)
+    	{
+        codeTopText=(checkBox->isChecked() ?  "1":"0");
+        mResultMap.insert(KCodeTopIndex,  codeTopText);
+    	}
+    else if( (queryType & ESecUiBasicTypeMask)==ESecUiBasicTypeCheckMulti)
+    	{
+        QItemSelectionModel *selectionModel = listWidget->selectionModel();
+        QModelIndexList selectedItems = selectionModel->selectedIndexes();
+        QModelIndex index;
+        codeTopText="";
+         foreach(index, selectedItems) { 
+		 		 codeTopText+=QString::number(index.row());
+                // could also use  if(index.row()!=selectedItems.count()-1) codeTopText+= "|";
+                codeTopText+= "|";
+                }
+         mResultMap.insert(KCodeTopIndex,  codeTopText);
+    	}
+    else
+        codeTopText = codeTop->text();
+    // no need to check last time for codeBottom
+   	RDEBUGQT("codeTopText", codeTopText);
+    sendResult(KErrNone);
+    RDEBUG("calling close()", 0);
+    close();	// this is needed because Cancel doesn't automatically closes the dialog
+		RDEBUG("emitting deviceDialogClosed", 0);
+		emit deviceDialogClosed();
+}
+
+// ----------------------------------------------------------------------------
+// SecUiNotificationDialog::handleCancelled()
+// ----------------------------------------------------------------------------
+//
+void SecUiNotificationDialog::handleCancelled()
+{
+		RDEBUG("0", 0);
+		RDEBUG("mMyId", mMyId);
+    sendResult(KErrCancel);
+		RDEBUG("callingclose()", 0);
+    close();	// this is needed because Cancel doesn't automatically closes the dialog
+		RDEBUG("emitting deviceDialogClosed", 0);
+		emit deviceDialogClosed();
+}
+
+// ----------------------------------------------------------------------------
+// SecUiNotificationDialog::handleMemorySelectionChanged()
+// ----------------------------------------------------------------------------
+//
+void SecUiNotificationDialog::handleMemorySelectionChanged(const QString &text)
+    {
+		RDEBUG("0", 0);
+		RDEBUG("mMyId", mMyId);
+    RDEBUGQT("text", text);
+    QVariant memorySelection(text);
+    mResultMap.insert(KSelectedMemoryIndex, memorySelection);
+    }
+
+void SecUiNotificationDialog::handleCodeTopContentChanged()
+    {
+		RDEBUG("0", 0);
+		RDEBUG("mMyId", mMyId);
+    	RDEBUGQT("codeTop->text()", codeTop->text());
+    	handleCodeTopChanged(codeTop->text());
+    }
+
+// ----------------------------------------------------------------------------
+// SecUiNotificationDialog::handleCodeTopChanged()
+// ----------------------------------------------------------------------------
+//
+void SecUiNotificationDialog::handleCodeTopChanged(const QString &text)
+    {
+		RDEBUG("0", 0);
+    	RDEBUGQT("text", text);
+    	if(queryDual)
+    		{
+    		codeBottom->setText("");	// any change resets the verification.
+	    	if( (queryType & ESecUiMaskType) == 0x000004  )	// new codeLock
+	    		{	// ChangeSecCodeParamsL change RMobilePhone::ESecurityCodePhonePassword
+				    QVariant codeTopVar(text);
+				    mResultMap.insert(KCodeTopIndex, codeTopVar);
+						sendResult(KErrCompletion);	// send the current password back to the client for further TARM validation. This is done on any key-press, not in the OK
+	    		}
+    		}
+    	else if(text.length() < lMinLength )
+    		{
+    		RDEBUGQT("too short text", text);
+    		okAction->setEnabled(false);
+				RDEBUG("lEmergencySupported", lEmergencySupported);
+				if( lEmergencySupported && text.length() > 2 )	// emergency numbers need at least 3 digits
+					{	// check whether it's a emergency number
+					QVariant codeTopVar(text);
+  				mResultMap.insert(KCodeTopIndex, codeTopVar);
+					sendResult(KErrAbort);	// send the current password back to the client. Perhaps it's an emergency number and decides to Ok->Call
+					}
+    		}
+    	else if (text.length() >= lMinLength)
+    		{
+    		// might use a flag to avoid re-setting. But this complicates things if there's another initial verification
+    		RDEBUGQT("long enough text", text);
+    		okAction->setText(hbTrId("Ok"));
+    		if(queryDual==0)	// only if Bottom is not used
+    			okAction->setEnabled(true);
+    		}
+    QVariant codeTopVar(text);
+    mResultMap.insert(KCodeTopIndex, codeTopVar);
+    }
+// ----------------------------------------------------------------------------
+// SecUiNotificationDialog::handleCodeBottomChanged()
+// ----------------------------------------------------------------------------
+//
+void SecUiNotificationDialog::handleCodeBottomChanged(const QString &text)
+    {
+		RDEBUG("0", 0);
+    	RDEBUGQT("text", text);
+    	RDEBUGQT("codeTop->text()", codeTop->text());
+    	if(text.length() < lMinLength )
+    		{
+    		RDEBUGQT("too short text", text);
+    		okAction->setEnabled(false);
+    		}
+    	else
+    		{
+    		// might use a flag to avoid re-setting. But it just complicates things.
+    		RDEBUGQT("long enough text", text);
+    		if(codeTop->text()==text)
+    			{
+    			// unless both codes match, don't allow OK. Note that the first field doesn't allow exit until the validations (i.e. NewLockCode) as succesfull
+    			RDEBUGQT("codes match", text);
+	    		okAction->setEnabled(true);
+	    		}
+	    	else
+	    		{
+    			RDEBUGQT("codes don't match", text);
+					okAction->setEnabled(false);
+	    		}
+    		}
+		// verification is not sent
+    }
+// ----------------------------------------------------------------------------
+// SecUiNotificationDialog::handlebut1Changed()
+// ----------------------------------------------------------------------------
+//
+void SecUiNotificationDialog::handlebut1Changed()
+    {
+		RDEBUG("0", 0);
+    codeTop->setText("1234");
+    }
+// ----------------------------------------------------------------------------
+// SecUiNotificationDialog::handlebut2Changed()
+// ----------------------------------------------------------------------------
+//
+void SecUiNotificationDialog::handlebut2Changed()
+    {
+		RDEBUG("0", 0);
+    	QString codeTopText = codeTop->text();
+    	RDEBUGQT("codeTopText", codeTopText);
+    	codeTopText = codeTopText + "1" ;
+    	RDEBUGQT("codeTopText+1", codeTopText);
+    	codeTop->setText(codeTopText);
+    	
+    	      RDEBUG("editorInterface", 0);
+      			HbEditorInterface editorInterface(codeTop);
+      			RDEBUG("actions", 0);
+      			QList<HbAction *> vkbList = editorInterface.actions();
+      			RDEBUG("count", 0);
+      			int count = vkbList.count();
+      			RDEBUG("got count", count);
+		        for (int i = 0; i < count; i++)
+		        		{
+		        		RDEBUG("i", i);
+		            HbAction *action = static_cast<HbAction *>(vkbList[i]);
+		            RDEBUG("action", 0);
+		          	}
+		          	
+		        RDEBUG("okVKBAction", 0);
+		        okVKBAction = new HbAction(tr("Ok"));
+		        RDEBUG("addAction", 0);
+		        editorInterface.addAction(okVKBAction);
+		        RDEBUG("addAction", 1);
+		        connect(okVKBAction, SIGNAL(triggered()), this, SLOT(handleAccepted()));
+		        RDEBUG("connect", 1);
+
+      			QList<HbAction *> vkbList2 = editorInterface.actions();
+      			RDEBUG("count", 0);
+      			int count2 = vkbList2.count();
+      			RDEBUG("got count2", count2);
+		        for (int i = 0; i < count2; i++)
+		        		{
+		        		RDEBUG("i", i);
+		            HbAction *action2 = static_cast<HbAction *>(vkbList2[i]);
+		            RDEBUG("action2", 0);
+		          	}
+    
+    }
+// ----------------------------------------------------------------------------
+// SecUiNotificationDialog::handlebut3Changed()
+// ----------------------------------------------------------------------------
+//
+void SecUiNotificationDialog::handlebut3Changed()
+    {
+    	RDEBUG("0", 0);
+    	QString codeTopText = codeTop->text();
+    	RDEBUG("codeTopText", 0);
+    	RDEBUGQT("codeTopText", codeTopText);
+    	codeTopText = codeTopText + "5" ;
+    	RDEBUGQT("codeTopText+5", codeTopText);
+    	codeTop->setEchoMode(HbLineEdit::PasswordEchoOnEdit);
+    	RDEBUGQT("codeTopText", codeTopText);
+    	codeTop->setText(codeTopText);
+    	RDEBUG("setFocus", 0);
+    	codeTop->setFocus();
+    	RDEBUG("1", 1);
+    }
+
+// ----------------------------------------------------------------------------
+// SecUiNotificationDialog::saveFocusWidget(QWidget*,QWidget*)
+// ----------------------------------------------------------------------------
+//
+void SecUiNotificationDialog::saveFocusWidget(QWidget*,QWidget*)
+{
+		RDEBUG("0", 0);
+}
+
+// ----------------------------------------------------------------------------
+// SecUiNotificationDialog::subscriberKSecurityUIsDismissDialogChanged()
+// A way for Autolock to dismiss any possible PIN dialog
+// This doesn't dismiss the lockIcon because P&S is not connected
+// Note: if this changes itself, then it becomes recursive
+// ----------------------------------------------------------------------------
+//
+void SecUiNotificationDialog::subscriberKSecurityUIsDismissDialogChanged()
+    {
+
+    RDEBUG("0", 0);
+		RDEBUG("mMyId", mMyId);
+    TInt aDismissDialog = ESecurityUIsDismissDialogUninitialized;
+    TInt err = RProperty::Get(KPSUidSecurityUIs, KSecurityUIsDismissDialog, aDismissDialog );
+    RDEBUG("err", err);
+		RDEBUG("aDismissDialog", aDismissDialog);
+    if( aDismissDialog == ESecurityUIsDismissDialogOn )
+    	{
+    	if(subscriberKSecurityUIsDismissDialog)
+    		{
+    		RDEBUG("subscriberKSecurityUIsDismissDialog", 1);
+    		}
+    	else
+    		{
+    		RDEBUG("! subscriberKSecurityUIsDismissDialog", 0);
+    		}
+
+    	if(this)
+    		{
+    		RDEBUG("this", 1);
+    		}
+    	else
+    		{
+    		RDEBUG("! this", 0);
+    		}
+
+
+			RDEBUG("disconnect subscriberKSecurityUIsDismissDialog", 0);
+			disconnect(subscriberKSecurityUIsDismissDialog, SIGNAL(contentsChanged()), this, SLOT(subscriberKSecurityUIsDismissDialogChanged()));
+			// this doesn't really disconnect, because somehow the events are still queued. This is a QtMobility error
+			RDEBUG("disconnected subscriberKSecurityUIsDismissDialog", 1);
+			
+			RDEBUG("not set KSecurityUIsDismissDialog", ESecurityUIsDismissDialogProcessing);
+			// can't set it because it does recursion
+			// err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsDismissDialog, ESecurityUIsDismissDialogProcessing );
+			RDEBUG("err", err);
+			// only if Cancel is allowed
+			if ((queryType & ESecUiCancelSupported)==ESecUiCancelSupported)
+				{
+				RDEBUG("sendResult(KErrCancel)", KErrCancel);	// another option is KErrDied
+				sendResult(KErrCancel);	// similar to     emit handleCancelled();
+				RDEBUG("calling close()", 0);
+				err = close();
+				RDEBUG("err", err);
+				RDEBUG("emitting deviceDialogClosed", 0);
+				emit deviceDialogClosed();
+				// RDEBUG("emit closeDeviceDialog", 0);
+				// this is old method    emit closeDeviceDialog(false);	// false means "not by client", although it's not really used
+				RDEBUG("all emited", 0);
+				}
+			RDEBUG("not set KSecurityUIsDismissDialog", ESecurityUIsDismissDialogDone);
+			// can't set it because it does recursion
+			// err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsDismissDialog, ESecurityUIsDismissDialogDone );	// clear after using it
+			RDEBUG("err", err);
+
+			RDEBUG("reconnect subscriberKSecurityUIsDismissDialog", 0);
+			connect(subscriberKSecurityUIsDismissDialog, SIGNAL(contentsChanged()), this, SLOT(subscriberKSecurityUIsDismissDialogChanged()));
+			RDEBUG("reconnected subscriberKSecurityUIsDismissDialog", 1);
+    	}
+    RDEBUG("1", 1);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/src/secuinotificationdialogplugin.cpp	Tue Aug 31 16:04:40 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: SecUi notification plugin.
+*
+*/
+
+#include "secuinotificationdebug.h"
+#include "secuinotificationdialogplugin.h"
+#include "secuinotificationdialog.h"
+#include "secuinotificationdialogpluginkeys.h"
+
+#include <etelmm.h>
+
+// This plugin implements one device dialog type
+static const struct {
+    const char *mTypeString;
+} dialogInfos[] = {
+    {SECUINOTIFICATIONDIALOG}
+};
+
+
+// ----------------------------------------------------------------------------
+// SecUiNotificationDialogPlugin::SecUiNotificationDialogPlugin()
+// ----------------------------------------------------------------------------
+//
+SecUiNotificationDialogPlugin::SecUiNotificationDialogPlugin() : mError(KNoError)
+{
+}
+
+// ----------------------------------------------------------------------------
+// SecUiNotificationDialogPlugin::~SecUiNotificationDialogPlugin()
+// ----------------------------------------------------------------------------
+//
+SecUiNotificationDialogPlugin::~SecUiNotificationDialogPlugin()
+{
+}
+
+// ----------------------------------------------------------------------------
+// SecUiNotificationDialogPlugin::accessAllowed()
+// ----------------------------------------------------------------------------
+//
+bool SecUiNotificationDialogPlugin::accessAllowed(const QString &deviceDialogType,
+    const QVariantMap &parameters, const QVariantMap &securityInfo) const
+{
+		RDEBUG("0", 0);
+    Q_UNUSED(deviceDialogType)
+    Q_UNUSED(parameters)
+    Q_UNUSED(securityInfo)
+
+    // All clients are allowed to use.
+    // should access be limited to certain clients or capabilities ? Not for now.
+    return true;
+}
+
+// ----------------------------------------------------------------------------
+// SecUiNotificationDialogPlugin::createDeviceDialog()
+// ----------------------------------------------------------------------------
+//
+HbDeviceDialogInterface *SecUiNotificationDialogPlugin::createDeviceDialog(
+    const QString &deviceDialogType, const QVariantMap &parameters)
+{
+    //  Create device dialog widget
+    RDEBUG("0", 0);
+    Q_UNUSED(deviceDialogType)
+
+    SecUiNotificationDialog *deviceDialog = new SecUiNotificationDialog(parameters);
+    mError = deviceDialog->deviceDialogError();
+    if (mError != KNoError) {
+        delete deviceDialog;
+        deviceDialog = 0;
+    }
+
+    RDEBUG("1", 1);
+    return deviceDialog;
+}
+
+// ----------------------------------------------------------------------------
+// SecUiNotificationDialogPlugin::deviceDialogInfo()
+// ----------------------------------------------------------------------------
+//
+bool SecUiNotificationDialogPlugin::deviceDialogInfo( const QString &deviceDialogType,
+        const QVariantMap &parameters, DeviceDialogInfo *info) const
+{
+		// For some unknown reason, this function doesn't print the signature 
+		RDEBUG("0", 0);
+		#ifdef _DEBUG
+		RDebug::Printf( "SecUiNotificationDialogPlugin::deviceDialogInfo=%x", 0 );
+		#endif
+
+    Q_UNUSED(deviceDialogType);
+
+		info->group = SecurityGroup;
+    info->flags = NoDeviceDialogFlags;
+    info->priority = DefaultPriority;
+
+		// The unlock-query must have higher priority, to get over Telephony.
+		if (parameters.contains(KQueryType)) {
+				#ifdef _DEBUG
+				RDebug::Printf( "SecUiNotificationDialogPlugin::deviceDialogInfo KQueryType=%x", 1 );
+				#endif
+        int iqueryType = parameters.value(KQueryType).toUInt();
+        RDEBUG("iqueryType", iqueryType);
+				#ifdef _DEBUG
+				RDebug::Printf( "SecUiNotificationDialogPlugin::deviceDialogInfo iqueryType=%x", iqueryType );
+				#endif
+				if( (iqueryType & 0xFFFF) == RMobilePhone::ESecurityCodePhonePassword )
+					{
+					RDEBUG("CriticalGroup", CriticalGroup);
+					#ifdef _DEBUG
+					RDebug::Printf( "SecUiNotificationDialogPlugin::deviceDialogInfo CriticalGroup=%x", CriticalGroup );
+					#endif
+					info->group = CriticalGroup;
+					}
+				// The unlock-query must have lower priority, to get over change PIN code request.					
+				else if( iqueryType == 0xB000000 )
+					{
+					#ifdef _DEBUG
+					RDebug::Printf( "SecUiNotificationDialogPlugin::deviceDialogInfo GenericDeviceDialogGroup=%x", GenericDeviceDialogGroup );
+					#endif						
+				  info->group = GenericDeviceDialogGroup;
+					}					
+				}
+    // Return device dialog flags
+
+    RDEBUG("1", 1);
+    return true;
+}
+
+// ----------------------------------------------------------------------------
+// SecUiNotificationDialogPlugin::deviceDialogTypes()
+// ----------------------------------------------------------------------------
+//
+QStringList SecUiNotificationDialogPlugin::deviceDialogTypes() const
+{
+		RDEBUG("0", 0);
+    // Return device dialog types this plugin implements
+
+    QStringList types;
+    const int numTypes = sizeof(dialogInfos) / sizeof(dialogInfos[0]);
+    for(int i = 0; i < numTypes; ++i) {
+        types.append(dialogInfos[i].mTypeString);
+    }
+
+    return types;
+}
+
+// ----------------------------------------------------------------------------
+// SecUiNotificationDialogPlugin::pluginFlags()
+// ----------------------------------------------------------------------------
+//
+HbDeviceDialogPlugin::PluginFlags SecUiNotificationDialogPlugin::pluginFlags() const
+{
+		RDEBUG("0", 0);
+    // Return plugin flags
+    return NoPluginFlags;
+}
+
+// ----------------------------------------------------------------------------
+// SecUiNotificationDialogPlugin::error()
+// ----------------------------------------------------------------------------
+//
+int SecUiNotificationDialogPlugin::error() const
+{
+		RDEBUG("mError", mError);
+    // Return last error
+    return mError;
+}
+
+Q_EXPORT_PLUGIN2(secuinotificationdialogplugin,SecUiNotificationDialogPlugin)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/secuinotifications/secuinotifications.pro	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,21 @@
+#
+# 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: SecUi notification dialog plugin project.
+#
+
+TEMPLATE = subdirs
+
+SYMBIAN_PLATFORMS = WINSCW ARMV5
+
+SUBDIRS += secuinotificationdialogplugin/secuinotificationdialogplugin.pro
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/securitydialogs.pro	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,24 @@
+#
+# 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: SecUi notification dialog plugin project.
+#
+
+TEMPLATE = subdirs
+
+SUBDIRS += secuinotifications/secuinotifications.pro
+SUBDIRS += lockclient/group/lockclient.pro
+SUBDIRS += Autolock/indicatorplugin/indicatorautolockplugin.pro
+SUBDIRS += Autolock/autolockuseractivityservice.pro
+SUBDIRS += Autolock/Autolock.pro
+
--- a/securitydialogs/simlockui/data/SimLockUI.rss	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,277 +0,0 @@
-/*
-* ============================================================================
-*  Name        : SimLockUI.rss
-*  Part of     : SimLock UI Application / Resource Definitions
-*  Description : Resource definitions for SimLock UI
-*  Version     : 
-*  
-* Copyright (c) 2005-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:   Build info file for Ado domain appinstall 
-* ============================================================================
-*/
-
-// Resource Name Identifier
-NAME SLUI
-
-// Include Files
-#include <eikon.rh>
-#include <eikon.rsg>
-#include <avkon.rh>
-#include <avkon.rsg>
-#include <appinfo.rh>
-
-#include "simlockui.hrh"
-#include <simlockui.loc>
-
-// Resource Identifiers
-RESOURCE RSS_SIGNATURE { }
-RESOURCE TBUF r_default_document_name { buf = "Document"; }
-
-// Constants
-#define ESimLockUiQueryFlags (EGeneralQueryFlags)
-
-// ========================== RESOURCE DEFINITIONS ===========================
-
-// ---------------------------------------------------------------------------
-// EIK_APP_INFO
-// Define default menu and CBA key.
-// ---------------------------------------------------------------------------
-//
-RESOURCE EIK_APP_INFO
-    {
-    cba = R_AVKON_SOFTKEYS_EMPTY;
-    menubar= R_AVKON_MENUPANE_EMPTY;
-    }
-
-// ---------------------------------------------------------------------------
-// Text resources
-//
-// ---------------------------------------------------------------------------
-//
-
-// Background text captions
-RESOURCE TBUF r_simlock_ui_background_text_main {buf = qtn_sim_title_sim_unlock;}
-RESOURCE TBUF r_simlock_ui_background_text_unlock_complete {buf = qtn_sim_title_unlock_complete;}
-RESOURCE TBUF r_simlock_ui_codes_not_match {buf = qtn_sim_title_code_no_match;}
-RESOURCE TBUF r_simlock_ui_background_text_unlock_incorrect {buf = qtn_sim_title_code_wrong;}
-RESOURCE TBUF r_simlock_ui_background_text_unlock_failed {buf = qtn_sim_title_unlock_fail;}
-
-// Information notes
-RESOURCE TBUF r_sim_unlock_message_sim_unlocked {buf = qtn_sim_info_prev_unlock;}
-RESOURCE TBUF r_sim_unlock_message_cannot_unlock {buf = qtn_sim_info_perm_lock;}
-RESOURCE TBUF r_sim_unlock_message_end_call {buf = qtn_sim_info_end_call;}
-RESOURCE TBUF r_sim_phone_unlocked {buf = qtn_sim_info_phone_unlocked;}
-
-// Text for SIM popup text
-RESOURCE TBUF r_sim_info_welcome_note_text{buf=qtn_sim_popup_intro_info;}
-
-
-// ---------------------------------------------------------------------------
-// r_sim_info_welcome_note
-// Intro note displayed when Sim Lock UI Application starts
-// ---------------------------------------------------------------------------
-//
- RESOURCE DIALOG r_sim_info_welcome_note
-    {
-    flags=ESimLockUiQueryFlags;
-    buttons=R_AVKON_SOFTKEYS_YES_NO__YES;
-    items=
-        {
-        DLG_LINE
-            {
-            type = EAknCtPopupHeadingPane;
-            id = EAknMessageQueryHeaderId;
-            control = AVKON_HEADING
-                {
-                headinglayout = R_AVKON_LIST_HEADING_PANE_POPUPS;
-                label = qtn_sim_title_sim_unlock;
-                };
-            },
-        DLG_LINE
-            {
-            type = EAknCtMessageQuery;
-            id = EAknMessageQueryContentId;
-
-            control = AVKON_MESSAGE_QUERY
-                {               
-                };
-            }
-        };
-    }
-
-// ---------------------------------------------------------------------------
-// r_sim_unlock_final
-// Indicates the final unlock attempt has been performed
-// ---------------------------------------------------------------------------
-//
-RESOURCE DIALOG r_sim_unlock_final
-    {
-    flags=ESimLockUiQueryFlags;
-    buttons=R_AVKON_SOFTKEYS_OK_EMPTY;
-    items=
-        {
-        DLG_LINE
-            {
-            type = EAknCtPopupHeadingPane;
-            id = EAknMessageQueryHeaderId;
-            control = AVKON_HEADING
-                {
-                headinglayout = R_AVKON_LIST_HEADING_PANE_POPUPS;
-                label = qtn_sim_title_unlock_fail;
-                };
-            },
-        DLG_LINE
-            {
-            type=EAknCtMessageQuery;
-            id=EAknMessageQueryContentId;
-            control= AVKON_MESSAGE_QUERY
-                {
-                message = qtn_sim_info_code_wrong_final;
-                };
-            }
-        };
-    }
-
-// ---------------------------------------------------------------------------
-// r_sim_info_codes_not_match
-// Dialog that indicates two Sim lock codes do not match
-// ---------------------------------------------------------------------------
-//
-RESOURCE DIALOG r_sim_info_codes_not_match
-    {
-    flags=ESimLockUiQueryFlags;
-    buttons=R_AVKON_SOFTKEYS_OK_CANCEL__OK;
-    items=
-        {
-        DLG_LINE
-            {
-            type = EAknCtPopupHeadingPane;
-            id = EAknMessageQueryHeaderId;
-            control = AVKON_HEADING
-                {
-                headinglayout = R_AVKON_LIST_HEADING_PANE_POPUPS;
-                label = qtn_sim_title_code_no_match;
-                };
-            },
-
-        DLG_LINE
-            {
-            type=EAknCtMessageQuery;
-            id=EAknMessageQueryContentId;
-            control= AVKON_MESSAGE_QUERY
-                {
-                message = qtn_sim_info_code_no_match;
-                };
-            }
-        };
-    }
-
-// ---------------------------------------------------------------------------
-// r_sim_info_code_incorrect
-// Dialog that indicates an incorrect code was entered
-// ---------------------------------------------------------------------------
-//
-RESOURCE DIALOG r_sim_info_code_incorrect
-    {
-    flags=ESimLockUiQueryFlags;
-    buttons=R_AVKON_SOFTKEYS_OK_CANCEL__OK;
-    items=
-        {
-        DLG_LINE
-            {
-            type = EAknCtPopupHeadingPane;
-            id = EAknMessageQueryHeaderId;
-            control = AVKON_HEADING
-                {
-                headinglayout = R_AVKON_LIST_HEADING_PANE_POPUPS;
-                label = qtn_sim_title_code_wrong;
-                };
-            },
-
-        DLG_LINE
-            {
-            type=EAknCtMessageQuery;
-            id=EAknMessageQueryContentId;
-            control= AVKON_MESSAGE_QUERY
-                {
-                message = qtn_sim_urn_code_wrong;
-                };
-            }
-        };
-    }
-
-// ---------------------------------------------------------------------------
-// r_sim_info_enter_password
-// Password entry dialog
-// ---------------------------------------------------------------------------
-//
-RESOURCE DIALOG r_sim_info_enter_password
-
-    {
-    flags=ESimLockUiQueryFlags;
-    buttons=R_AVKON_SOFTKEYS_OK_CANCEL__OK;
-    items=
-        {
-        DLG_LINE
-            {
-            type=EAknCtQuery;
-            id=EGeneralQuery;
-            control= AVKON_DATA_QUERY
-                {
-                layout = EPhoneLayout;
-                label = qtn_sim_query_enter_code;
-                control = EDWIN
-                    {
-                    lines = 1;
-                    width = SEC_ATT_PASSWORD_MAX_BUFFER;
-                    default_input_mode = EAknEditorNumericInputMode;
-                    allowed_input_modes = EAknEditorNumericInputMode;
-                    };
-                };
-            }
-        };
-    }
-
-// ---------------------------------------------------------------------------
-// r_sim_info_test_password_reenter
-// Password re-entry dialog
-// ---------------------------------------------------------------------------
-//
-RESOURCE DIALOG r_sim_info_reenter_password
-
-    {
-    flags=ESimLockUiQueryFlags;
-    buttons=R_AVKON_SOFTKEYS_OK_CANCEL__OK;
-    items=
-        {
-
-        DLG_LINE
-            {
-            type=EAknCtQuery;
-            id=EGeneralQuery;
-            control= AVKON_DATA_QUERY
-                {
-                layout = EPhoneLayout;
-                label = qtn_sim_query_reenter_code;
-                control = EDWIN
-                    {
-                    lines = 1;
-                    width = SEC_ATT_PASSWORD_MAX_BUFFER;
-                    default_input_mode = EAknEditorNumericInputMode;
-                    allowed_input_modes = EAknEditorNumericInputMode;
-                    };
-                };
-            }
-        };
-    }
--- a/securitydialogs/simlockui/data/SimLockUI_reg.rss	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
-* ============================================================================
-*  Name        : SimLockUI_reg.rss
-*  Part of     : SimLock UI
-*  Description : SimLock UI App Registration file file
-*  Version     :
-*  
-* Copyright (c) 2005-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:   Build info file for Ado domain appinstall 
-* ============================================================================
-*/
-
-//SimLockUI application's registration resource file 
-
-#include <appinfo.rh>
-#include <simlockui.rsg>
-
-#include "simlockui.hrh"
-
-UID2 KUidAppRegistrationResourceFile
-UID3 SIMLOCK_UI_UID3
-
-RESOURCE APP_REGISTRATION_INFO 
-    {
-    app_file="SimLockUI";
-    
-    // Application is not in the menu
-    hidden = KAppIsHidden;
-    // Uncomment and comment previous line to un-hide
-    //hidden = KAppNotHidden;
-    //localisable_resource_file="\\resource\\apps\\SimLockUI";
-    embeddability = KAppNotEmbeddable;
-    newfile = KAppDoesNotSupportNewFile;
-    }
--- a/securitydialogs/simlockui/group/SimLockUI.mmp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-/*
-* ============================================================================
-*  Name        : simlockui.mmp
-*  Part of     : SimLock UI
-*  Description : SimLock UI mmp file
-*  Version     : 
-*
-* Copyright (c) 2005-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:   Build info file for Ado domain appinstall 
-* ============================================================================
-*/
-
-#include "../inc/simlockui.hrh"
-#include <data_caging_paths.hrh>
-#include <platform_paths.hrh>
-CAPABILITY CAP_APPLICATION
-
-TARGETPATH        /sys/bin
-TARGET            simlockui.exe
-TARGETTYPE        exe
-
-UID               0x00000000 SIMLOCK_UI_UID3
-VENDORID          VID_DEFAULT
-
-LANGUAGE_IDS
-
-SOURCEPATH        ../src
-SOURCE            simlockui.cpp
-SOURCE            simlockuiapplication.cpp 
-SOURCE            simlockuibackgroundcontrol.cpp
-SOURCE            simlockuiappui.cpp
-SOURCE            simlockuidocument.cpp 
-SOURCE            simlockdatahandlingdelegate.cpp
-SOURCE            simlocktelephonyproxy.cpp
-
-USERINCLUDE       ../inc 
-SYSTEMINCLUDE     /epoc32/include/internal
-
-APP_LAYER_SYSTEMINCLUDE
-LIBRARY       euser.lib
-LIBRARY       apparc.lib
-LIBRARY       cone.lib 
-LIBRARY       eikcore.lib  
-LIBRARY       avkon.lib  
-LIBRARY       gdi.lib  
-LIBRARY       etel.lib
-LIBRARY       etelmm.lib
-LIBRARY       customapi.lib
-LIBRARY       commonengine.lib
-LIBRARY       aknskins.lib  
-LIBRARY       aknskinsrv.lib
-LIBRARY       aknswallpaperutils.lib
-LIBRARY       aknlayout2.lib
-LIBRARY       aknlayout2scalable.lib
-LIBRARY       cdlengine.lib
-LIBRARY       ws32.lib
-LIBRARY       etel3rdparty.lib
-LIBRARY       eikcoctl.lib
-
-SOURCEPATH    ../data
-
-// Main resource file
-START RESOURCE  simlockui.rss
-HEADER
-TARGETPATH  /resource/apps
-LANGUAGE_IDS
-END
-
-// Resource registration file
-START RESOURCE  simlockui_reg.rss
-TARGETPATH  /private/10003a3f/apps
-END
-
-
-// End of file.
-
--- a/securitydialogs/simlockui/group/bld.inf	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
-* ============================================================================
-*  Name        : bld.inf
-*  Part of     : SimLockUI Build Information
-*  Description : Build information file for project simlockui
-*  Version     : 
-* Copyright (c) 2005-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:   Build info file for Ado domain appinstall 
-*
-* ============================================================================
-*/
-
-
-#include <platform_paths.hrh>
-
-PRJ_MMPFILES
-
-// Project File
-simlockui.mmp
-
-// Icon File
-
-PRJ_EXPORTS
-// Export IBY files
-../rom/simlockui.iby            CORE_MW_LAYER_IBY_EXPORT_PATH( simlockui.iby) 
-../rom/simlockui_resources.iby  LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(simlockui_resources.iby) 
-
-../inc/simlockui.loc            MW_LAYER_LOC_EXPORT_PATH(simlockui.loc)  
-
-// For EE texts
-../rom/simlockui_resources.iby  CORE_APP_LAYER_IBY_EXPORT_PATH(simlockui_resources.iby)    		
-
-../inc/simlockuikeys.h                  /epoc32/include/oem/simlockuikeys.h
\ No newline at end of file
--- a/securitydialogs/simlockui/inc/SimLockDataHandlingDelegate.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,165 +0,0 @@
-/*
-* ============================================================================
-*  Name         : SimLockDataHandlingDelegate.h     
-*  Part of      : Sim Lock UI Application
-*  Description  : Handles reading and writing of Sim Lock data including
-                  unlocking the Sim Lock.
-*  Version      : 
-*  
-* Copyright (c) 2005-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:   Build info file for Ado domain appinstall 
-* ============================================================================
-*/
-
-#ifndef SIMLOCKDATAHANDLINGDELEGATE_H
-#define SIMLOCKDATAHANDLINGDELEGATE_H
-
-// System Includes
-#include <e32base.h>
-
-// Forward Declarations
-class RMmCustomAPI;
-struct TSimPathStr;
-struct TSimLockHeadStr;
-class CActiveSchedulerWait;
-class TIsiReceiveC;
-class CPeriodic;
-
-/**
- *  CSimLockDataHandlingDelegate
- *
- *  Delegate class to handle communication with lower layers of S60 and Symbian,
- *  and also the native( ISA ) layer.
- *
- *  @lib euser.lib
- *  @lib iscapi.lib
- *  @lib isimessage.lib
- *  @lib etel.lib
- *  @lib etelmm.lib
- *  @lib customapi.lib
- */
-class CSimLockDataHandlingDelegate : public CActive
-    {
-public: // Public Constructor / Destructor
-
-    /**
-     * Two-phased constructor
-     *
-     */
-    static CSimLockDataHandlingDelegate* NewL( RMmCustomAPI& aCustomAPI );
-
-    /**
-     * Destructor
-     *
-     */
-    virtual ~CSimLockDataHandlingDelegate();
-
-public: // Public API
-
-     /**
-      * Open the Sim Lock( type 1 ) given a passcode.
-      *
-      * @param aPassword TDesC of the password to open lock
-      * @return Indicates the result of the Sim Lock open attempt
-      */
-    TInt OpenSimLock( const TDesC& aPassword );
-
-     /**
-      * Determine if the Sim Lock is open.
-      *
-      * @return Indicates if Sim Lock is open
-      */
-    TBool IsSimLockOpen() const;
-
-
-private: // Private Constructors
-
-     /**
-      * C++ constructor.
-      *
-      * @param aCustomAPI ETel custom API object
-      */
-    CSimLockDataHandlingDelegate( RMmCustomAPI& aCustomAPI );
-
-     /**
-      * Symbian OS default constructor.
-      */
-    void ConstructL();
-
-
-private: // From CActive
-
-    /**
-     * Active object run method
-     * @see CActive
-     */
-    virtual void RunL();
-
-    /**
-     * Active object cancel method
-     * @see CActive
-     */
-    virtual void DoCancel();
-    
-private: // Local Member API
-       
-    /**
-     * CPeriodic Callback function for elapsed timer
-     *
-     * @param aUnused requred for interface
-     * @return required but unused
-     */
-    static TInt TimerElapsed(TAny* aUnused);
-
-    /**
-     * Pause execution and allow active scheduler to run until the current outstanding
-     * request complets
-     *
-     */
-    void CompleteRequestWithTimeout();
-
-private:    // Member Data
-    /**
-     * Indicates if the Sim Lock is open per the last read from the Sim Lock
-     * server.
-     */
-    TBool iLockIsOpen;
-
-    /**
-     * Handle to ETel MultiMode Custom API server
-     */
-    RMmCustomAPI& iCustomAPI;
-
-    /**
-     * Help with asynchronous requests
-     */
-    CActiveSchedulerWait* iSchedulerWait;
-
-    /**
-     * Indicates that Sim Lock data has been read
-     */
-    TBool iDataHasBeenRead;
-
-    /**
-     * Timeout handling timer
-     * owns
-     */
-    CPeriodic* iTimer;
-
-    };
-
-#endif //SIMLOCKDATAHANDLINGDELEGATE_H
-
-// End of File
-
--- a/securitydialogs/simlockui/inc/SimLockISAServerDefinitions.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,173 +0,0 @@
-/*
-* ============================================================================
-*  Name         : SimLockISAServerDefinitions.h
-*  Part of      : Sim Lock UI Application
-*  Description  : Definitions for Sim Lock ISA Server
-*  Version      : 
-*  
-* Copyright (c) 2005-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:   Build info file for Ado domain appinstall 
-* ============================================================================
-*/
-
-#ifndef SimLockISAServerDefinitions_H
-#define SimLockISAServerDefinitions_H
-
-// INCLUDES
-#include <e32base.h>
-
-// =============================================    
-// Convert to little endian
-// =============================================    
-
-// Macro to convert big endian to native type
-// EPOC ARM is little endian
-#define BE2INT16( x )     ( ( ( ( x ) & 0xFF00 ) >> 8 ) |( ( ( x ) & 0x00FF ) << 8 ) )
-
-
-// =============================================    
-// From Simlock_lock.h in cellmo: ISA server
-// =============================================
-
-// MACROS
-
-#define SIMLOCK_PROFILE_SIZE 8
-#define SIMLOCK_CONFIG_SIZE  8      
-
-/* Block status */
-typedef TUint8 SL_BLOCK_STATUS;
-#define SL_BLOCK_NOT_DISCARD     0x00
-#define SL_BLOCK_DISCARD         0x01
-#define SL_BLOCK_PERMANENT       0x02
-#define SL_BLOCK_MANDATORY       0x03 
-
-/* Requirement status */
-typedef TUint8 SL_LOCKTYPE;
-#define SL_LOCKTYPE_AUTO   0x01
-#define SL_LOCKTYPE_CLOSED 0x02
-#define SL_LOCKTYPE_OPEN   0x03 
-
-
-/* Criteria */
-typedef TUint8 SL_OPERATOR;
-#define SL_OP_BYTEWISE_DISTINCT_EQ    0x01
-#define SL_OP_BYTEWISE_DISTINCT_GTE   0x02
-#define SL_OP_BYTEWISE_DISTINCT_LTE   0x03
-#define SL_OP_BYTEWISE_DISTINCT_NEQ   0x04
-#define SL_OP_NIBBLEWISE_DISTINCT_EQ  0x05
-#define SL_OP_NIBBLEWISE_DISTINCT_GTE 0x06
-#define SL_OP_NIBBLEWISE_DISTINCT_LTE 0x07
-#define SL_OP_NIBBLEWISE_DISTINCT_NEQ 0x08
-#define SL_OP_BITWISE_DISTINCT_NEQ    0x09
-#define SL_OP_BYTEWISE_UNIFIED_GTE    0x0A
-#define SL_OP_BYTEWISE_UNIFIED_LTE    0x0B
-#define SL_OP_BYTEWISE_UNIFIED_NEQ    0x0C   
-#define SL_OP_NIBBLEWISE_UNIFIED_GTE  0x0D
-#define SL_OP_NIBBLEWISE_UNIFIED_LTE  0x0E
-#define SL_OP_NIBBLEWISE_UNIFIED_NEQ  0x0F
-#define SL_OP_BITWISE_DISTINCT_EQ     0x10
-#define CRITERIA_MAXIMUM 0x10 
-
-
-/* No mask( all data counts ) */
-#define SIMLOCK_MASK_NOT_DEF 0x0000
-
-// DATA TYPES
-
-// Sim Lock data structures 
-struct TSimLockConfigStr
-    {
-    TUint8 Byte[SIMLOCK_CONFIG_SIZE];
-    };
-
-struct TSimLockProfileStr
-    {
-    TUint8 Byte[SIMLOCK_PROFILE_SIZE];
-    };
-
-/* An aboslute path on SIM card */
-struct TSimPathStr
-    {
-    TUint8 ah;
-    TUint8 al;
-    TUint8 bh;
-    TUint8 bl;
-    TUint8 ch;
-    TUint8 cl;
-    TUint8 dh;
-    TUint8 dl;
-    }; /* sizeof( SIM_PATH_STR ) = 8 */
-    
-#define SIM_PATH_SIZE sizeof( TSimPathStr )
-
-/* A match requirement */
-struct TSimLockMRStr
-    {
-    TUint32      ReadSpec;
-    TSimPathStr FileId;
-    TUint16      Mask; 
-    TUint16      Offset; 
-    TUint8        DataSize; 
-    TUint8        UnitLength;
-    SL_OPERATOR Criterion;
-    SL_LOCKTYPE LockType;
-    }; /* sizeof( SL_MR_STR ) = 20  */
-    
-#define SL_MR_STR_SIZE sizeof( TSimLockMRStr )
-
-/* A match block */
-struct TSimLockMBStr
-    {
-    TUint16 Offset; 
-    TUint8  AccessClass;
-    SL_BLOCK_STATUS mbStatus;
-    TUint8  mrCount;
-    TUint8 Reserved1;
-    TUint8 Reserved2;
-    TUint8 Reserved3;
-    }; /* sizeof( SL_MB_STR ) = 8            */
-    
-#define SL_MB_STR_SIZE sizeof( TSimLockMBStr )
-
-/* Sim Lock header */
-struct TSimLockHeadStr
-    {
-    // Use BB5 Head Str
-    TSimLockProfileStr Profile;             //  !!!! 8 TUint8s
-    TSimLockConfigStr ConfigData;           //  !!!! 8 TUint8s
- 
-    TUint16 Offset;  
-    TUint8 mbCount;
-    TUint8 UnlockCount;
-    TUint8 Reserved1;
-    TUint8 Reserved2;
-    
-    TUint8  Reserved3;
-    TUint8  Reserved4; 
-    }; /* sizeof( SL_HEAD_STR ) = 8 or 24 */
-    
-#define SL_HEAD_STR_SIZE  ( ( TInt )sizeof( TSimLockHeadStr ) )
-
-// CONSTANTS
-
-extern TInt KSimLockUnlockAttemptsAvailable;
-
-// FUNCTION PROTOTYPES
-
-// FORWARD DECLARATIONS
-
-
-#endif // SimLockISAServerDefinitions_H
-
-// End of File
--- a/securitydialogs/simlockui/inc/SimLockTelephonyProxy.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,142 +0,0 @@
-/*
-* ============================================================================
-*   Name       : SimLockTelephonyProxy.h
-*  Part of     : Sim Lock UI Telephony Proxy
-*  Description : Wrap asynchronous calls to Core Telephony
-*  Version     : 
-*  
-* Copyright (c) 2005-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:   Build info file for Ado domain appinstall 
-* ============================================================================
-*/
-
-#ifndef SIMLOCK_TELEPHONY_PROXY_H
-#define SIMLOCK_TELEPHONY_PROXY_H
-
-// System Includes
-#include <e32base.h>
-#include <etel3rdparty.h> // CTelephony members
-
-// Forward Declarations
-class CPeriodic;
-
-/**
- *  CSimLockTelephonyProxy
- *
- *  Act as proxy for asynchronous calls to CTelephony
- *
- *  @lib euser.lib
- *  @lib etel3rdparty.lib
- */
-class CSimLockTelephonyProxy : public CActive
-    {
-public: // Public Constructor/Destructor
-
-    /**
-     * NewL
-     * Construct a CSimLockTelephonyProxy
-     * using two phase construction, and return a pointer to the created object
-     * @return a pointer to the created instance of CSimLockTelephonyProxy
-     */
-    static CSimLockTelephonyProxy* NewL();
-
-    /**
-     * Destructor
-     */
-    ~CSimLockTelephonyProxy();
-
-public: // Public API
-
-    /**
-     * Find out if a call is in progress.
-     *
-     * @return Whether or not a call is in progress
-     */
-    TBool IsCallInProgress();
-
-private: // From CActive
-
-    /**
-     * Active object run method
-     */
-    virtual void RunL();
-    
-    /** 
-     * Active object cancel method
-     */
-    virtual void DoCancel();
-
- private: // Private Constructors
-
-    /**
-     * C++ constructor.
-     *     
-     */
-    CSimLockTelephonyProxy();
-
-    /**
-     * Symbian OS default constructor.
-     */
-    void ConstructL();
-
-private: // Private Member Functions
-
-    /**
-     * CPeriodic Callback function for elapsed timer
-     *
-     * @param aClientObject pointer to CSimLockTelephonyProxy client object
-     * @return required but unused
-     */
-    static TInt TimerElapsed(TAny* aClientObject);
-
-    /**
-     * Complete an asynchronous request synchronously with a hardcoded timeout
-     */
-    void CompleteRequestWithTimeout();
-
-private: // Member Data
-
-    /**
-     * Telephony indicators( used to detect ongoing voice call )
-     */
-    CTelephony::TIndicatorV1 iIndicators;
-
-    /**
-     * Telephony indicator package as received from CTelephony
-     */
-    CTelephony::TIndicatorV1Pckg iIndicatorPackage;
-
-     /**
-     * ETel 3rd Party API( used to detect ongoing voice call )
-     * owns
-     */
-    CTelephony* iTelephony;
-
-    /**
-     * Active scheduler wait API
-     * owns
-     */
-    CActiveSchedulerWait* iSchedulerWait;
-
-    /**
-     * Request timeout timer
-     * owns
-     */
-    CPeriodic* iTimer;
-
-    };
-
-#endif // SIMLOCK_TELEPHONY_PROXY_H
-
-// End of file.
--- a/securitydialogs/simlockui/inc/SimLockUI.hrh	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-/*
-* ============================================================================
-*  Name         : SimLockUI.hrh
-*  Part of      : Sim Lock UI Application
-*  Description  : Resource compatible header file
-*  Version      :
-*  
-* Copyright (c) 2005-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:   Build info file for Ado domain appinstall 
-* ============================================================================
-*/
-
-#ifndef __simlockui_HRH__
-#define __simlockui_HRH__
-
-#define SIMLOCK_UI_UID3               0x2000B0FA
-#define SEC_ATT_PASSWORD_MAX_BUFFER   32
-
-#endif // __simLockui_HRH__
-
-// End of file.
--- a/securitydialogs/simlockui/inc/SimLockUI.loc	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,142 +0,0 @@
-/*
-* ============================================================================
-*  Name        : SimLockUI.loc
-*  Part of     : Sim Lock UI Application / Resource Definitions
-*  Description : Resource definitions for Sim Lock UI
-*  Version     :
-*  
-* Copyright (c) 2005-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:   Build info file for Ado domain appinstall 
-* ============================================================================
-*/
-
-//  LOCALISATION STRINGS
-
-// NEW
-
-//d: SIM Unlock Process
-//l: heading_pane_t1
-//r: 3.2
-//
-#define qtn_sim_title_sim_unlock "SIM Unlock Process"
-
-//d: Intro message query giving high level description of the SIM Unlock process
-//l: popup_info_list_pane_t1
-//r: 3.2
-//
-#define qtn_sim_popup_intro_info "You have inserted an invalid SIM. Would you like to SIM unlock your phone? You have a limited number of unsuccessful attempts after which your phone will be permanently locked."
-
-//d: Header during unlock code query showing attempt number, where:  1 <= %0N <= 3; %1N = 3
-//l: main_pane_empty_t1/opt2
-//r: 3.2
-//
-#define qtn_sim_title_unlock_attempt_no "Unlock Attempt %0N of %1N"
-
-//d: Unlock code query prompt
-//l: popup_query_data_window_t3/opt2
-//r: 3.2
-//
-#define qtn_sim_query_enter_code "Enter the unlock code"
-
-//d: Unlock code reentry query prompt
-//l: popup_query_data_window_t3/opt2
-//r: 3.2
-//
-#define qtn_sim_query_reenter_code "Reenter the unlock code"
-
-//d: Header indicating successful SIM unlock
-//l: main_pane_empty_t1/opt2
-//r: 3.2
-//
-#define qtn_sim_title_unlock_complete "Unlock Process Complete"
-
-//d: Info indicating successful SIM unlock. Forewarns that device will reboot.
-//l: popup_note_window/opt2
-//r: 3.2
-//
-#define qtn_sim_info_phone_unlocked "Your phone is unlocked.  The phone will now restart."
-
-//d: Header indicating non-matching codes were entered.
-//l: heading_pane_t1
-//r: 3.2
-//
-#define qtn_sim_title_code_no_match "Codes not matched"
-
-//d: Info indicating that two entered unlock codes were not the same.
-//l: popup_info_list_pane_t1
-//r: 3.2
-//
-#define qtn_sim_info_code_no_match "The unlock codes entered do not match each other. The same unlock code must be entered twice. Try again?"
-
-//d: Header indicating that an incorrect SIM unlock code was entered.
-//l: heading_pane_t1
-//r: 3.2
-//
-#define qtn_sim_title_code_wrong "Incorrect Code Entered"
-
-//d: Info note indicating that the SIM unlock process failed.
-//l: popup_info_list_pane_t1
-//r: 3.2
-//
-#define qtn_sim_urn_code_wrong "The incorrect unlock code was entered. The phone was not unlocked. Try again?"
-
-//d: Header indicating that the SIM unlock process failed.
-//l: heading_pane_t1
-//r: 3.2
-//
-#define qtn_sim_title_unlock_fail "Unlock Process Failed"
-
-//d: Info note that the SIM unlock process failed. Three attempts remain.
-//l: popup_info_list_pane_t1
-//r: 3.2
-//
-#define qtn_sim_info_code_wrong_three "The incorrect unlock code was entered. Only three (3) unlock attempts remain before the phone is permanently locked."
-
-//d: Info note that the SIM unlock process failed. Two attempts remain.
-//l: popup_info_list_pane_t1
-//r: 3.2
-//
-#define qtn_sim_info_code_wrong_two "The incorrect unlock code was entered. Only two (2) unlock attempts remain before the phone is permanently locked."
-
-//d: Info note that the SIM unlock process failed. One attempt remains.
-//l: popup_info_list_pane_t1
-//r: 3.2
-//
-#define qtn_sim_info_code_wrong_one "The incorrect unlock code was entered. Only one (1) unlock attempt remains before the phone is permanently locked."
-
-//d: Info note that the SIM unlock process failed. No attempts remain.
-//l: popup_info_list_pane_t1
-//r: 3.2
-//
-
-#define qtn_sim_info_code_wrong_final "The incorrect unlock code was entered on the final attempt. The phone is permanently locked and cannot be unlocked."
-
-//d: Info note that the SIM has previously been unlocked.
-//l: popup_note_window/opt2
-//r: 3.2
-//
-#define qtn_sim_info_prev_unlock    "The SIM card is already unlocked."
-
-//d: Info note that the phone has previously been permanently locked.
-//l: popup_note_window/opt2
-//r: 3.2
-//
-#define qtn_sim_info_perm_lock  "Phone is permanently locked and cannot be unlocked."
-
-//d: Note to end an ongoing call before entering SIM unlock code (as the phone will reboot upon successful unlock.)
-//l: popup_note_window/opt2
-//r: 3.2
-//
-#define qtn_sim_info_end_call   "End call before entering unlock code."
-
--- a/securitydialogs/simlockui/inc/SimLockUI.pan	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
- /*
-* ============================================================================
-* Name        : SimLockUI.pan
-* Version     : 
-* 
-* Copyright (c) 2005-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:   Build info file for Ado domain appinstall 
-* ============================================================================
-*/
-
-#ifndef __SIMLOCKUI_PAN__
-#define __SIMLOCKUI_PAN__
-
-/** SimLockUI application panic codes */
-enum TSimLockUIPanics 
-    {
-    ESimLockUIBasicUi = 1,
-    ESimLockUIUnableToReadSimLock
-    // add further panics here
-    };
-
-inline void Panic(TSimLockUIPanics aReason)
-    {    
-	_LIT(applicationName,"SimLockUI"); //lint !e1534 static variable OK
-    User::Panic(applicationName, aReason);
-    }
-
-#endif // __SIMLOCKUI_PAN__
--- a/securitydialogs/simlockui/inc/SimLockUIApplication.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
-* ============================================================================
-*  Name         : SimLockUIApplication.h
-*  Part of      : Sim Lock UI Application
-*  Description  : SimLock UI Application header
-*  Version      : 
-*  
-* Copyright (c) 2005-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:   Build info file for Ado domain appinstall 
-* ============================================================================
-*/
-
-#ifndef __SIMLOCKUI_APPLICATION_H__
-#define __SIMLOCKUI_APPLICATION_H__
-
-#include <aknapp.h> // CAknApplication
-  
-/**
- *  CSimLockUIApplication
- *  Sim Lock UI Application class.
- *
- *  An instance of CSimLockUIApplication is the application part of the AVKON
- *  application framework for the SimLockUI example application
- *
- *  @lib avkon.lib
- *  @lib eikcore.lib
- *  @lib eiksrv.lib
- */
-class CSimLockUIApplication : public CAknApplication
-    {
-public:  // from CAknApplication
-
-    /**
-     * From CAknApplication
-     * Utility function to return the application's UID.
-     *
-     * @return Application's UID (KUidPDApplicationApp).
-     */
-    TUid AppDllUid() const;
-
-protected: // from CAknApplication
-
-    /** 
-     * CreateDocumentL
-     *
-     * Create a CApaDocument object and return a pointer to it
-     * @return a pointer to the created document
-     */
-    CApaDocument* CreateDocumentL();
-    };
-
-#endif // __SIMLOCKUI_APPLICATION_H__
-
-// end of file.
--- a/securitydialogs/simlockui/inc/SimLockUIAppui.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,231 +0,0 @@
-/*
-* ============================================================================
-*  Name         : SimLockUIAppUI.h
-*  Part of      : Sim Lock UI Application
-*  Description  : SimLock UI Application UI Header
-*  Version      : 
-*  
-* Copyright (c) 2005-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:   Build info file for Ado domain appinstall 
-* ============================================================================
-*/
-
-#ifndef __SIMLOCKUI_APPUI_H__
-#define __SIMLOCKUI_APPUI_H__
-
-// System includes
-#include <aknappui.h>
-#include <aknnotedialog.h>  // CAknNoteDialog::TTone
-#include <e32property.h>    // RProperty.
-
-
-// FORWARD DECLARATIONS
-class RProperty;
-// User includes
-#include "simlockuibackgroundcontrol.h" // CSimLockUIBackgroundControl::TBackgroundText
-
-// Forward reference
-class CSimLockUIBackgroundControl;
-class CSimLockDataHandlingDelegate;
-class CAknInformationNote;
-class CSimLockTelephonyProxy;
-
-//const TUid KSimLockProperty={0x2000B0FC};
-/**
- *  CSimLockUIAppUi
- *
- *  An instance of class CSimLockUIAppUi is the UserInterface part of the AVKON
- *  application framework for the SimLockUI example application
- *
- *  @lib avkon.lib
- *  @lib eikcore.lib
- *  @lib eiksrv.lib
- */
-class CSimLockUIAppUi : public CAknAppUi
-    {
-public: // Constructor/Destructor
-
-    /**
-     * CSimLockUIAppUi
-     * Perform the first phase of two phase construction.
-     * This needs to be public due to the way the framework constructs the AppUi
-     *
-     * @param aSimLockDelegate Sim Lock UI Delegate (ownership not transferred)
-     */
-    CSimLockUIAppUi( CSimLockDataHandlingDelegate& aSimLockDelegate );
-
-    /**
-     * ConstructL
-     * Perform the second phase construction of a CSimLockUIAppUi object
-     * this needs to be public due to the way the framework constructs the AppUi
-     */
-    void ConstructL();
-
-    /**
-     * ~CSimLockUIAppUi
-     * Destroy the object and release all memory objects
-     */
-    virtual ~CSimLockUIAppUi();
-
-private: // Private Data Type(s)
-
-    /**
-     * Indicate which background text to use
-     */
-    enum TBackgroundText
-        {
-        EBackgroundTextEmpty,
-        EBackgroundTextMain,
-        EBackgroundTextUnlockComplete,
-        EBackgroundTextUnlockFailed,
-        EBackgroundTextUnlockIncorrect
-        };
-
-private: // from CAknAppUi
-    /**
-     * @see CAknAppUi::HandleCommandL
-     */
-    virtual void HandleCommandL( TInt aCommand );
-
-    /**
-     * @see CAknAppUi::HandleForegroundEventL
-     */
-    virtual void HandleForegroundEventL( TBool aForeground );
-
-private: // Private Function Declarations
-
-    /**
-     * ProcessSimUnlockDialogsL
-     * Process the series of dialogs that control the Sim Unlock process
-     *
-     * @return  Indicates whether or not application flow should continue
-     */
-    TBool ProcessSimUnlockDialogsL();
-
-    /**
-     * CreateBackgroundControlL
-     * Create the background control for SimLock UI.  Background contains the default
-     * background image for the current skin and text indicating to the user the
-     * current stage in the unlock process.
-     *
-     */
-    void CreateBackgroundControlL();
-
-    /**
-     * CheckLockStateL
-     * Check the state of the lock and display a dialog if it is either
-     * unlocked or there are no lock attempts remaining.
-     *
-     * @return  Indicates whether or not application flow should continue
-     */
-    TBool CheckLockStateL() const;
-
-    /**
-     * DisplayIntroductionDialogL
-     * Display introduction dialog
-     *
-     * @return  Indicates whether or not application flow should continue
-     */
-    TBool DisplayIntroductionDialogL();
-
-    /**
-     * PromptForPasswordL
-     * Handle scenario where unlock attempt failed.  Prompt user about whether or
-     * not to continue
-     *
-     * @param   aPassword Descriptor to receive password
-     * @return  Indicates whether or not application flow should continue
-     */
-    TBool PromptForPasswordL( TDes& aPassword );
-
-    /**
-     * CompletePromptForPasswordL
-     * Ask for second password and check for call in progress
-     *
-     * @param   aPassword original password entered
-     * @param   aNewPassword Descriptor where 2nd password is to be inserted
-     * @return  Indicates whether or not application flow should continue
-     */
-    TBool CompletePromptForPasswordL( const TDesC& aPassword, TDes& aNewPassword );
-
-    /**
-     * AttemptToUnlockSimL
-     * Ask for second password and check for call in progress
-     *
-     * @param   aPassword the Sim Lock password
-     * @return  Indicates whether or not application flow should continue
-     */
-    TBool AttemptToUnlockSimL( const TDesC& aPassword );
-
-    /**
-     * HandleUnlockFailedL
-     * Handle scenario where unlock attempt failed.  Prompt user about whether or
-     * not to continue
-     *
-     * @return  Indicates whether or not application flow should continue
-     */
-    TBool HandleUnlockFailedL();
-
-    /**
-    /**
-     * ShowInformationNoteL
-     * Show an information note
-     *
-     * @param   aResourceId indicates what resource is displayed
-     * @return  Indicates whether or not application flow should continue 
-     */
-    TInt ShowInformationNoteL( TInt aResourceId ) const;
-
-    /**
-     * SetBackgroundText
-     * Change text in background control
-     *
-     * @param aText indicates type of text
-     */
-    void SetBackgroundTextL( TBackgroundText aText );
-
-private: // Private Member Data
-
-    /**
-     * Control that contains SimLock UI background
-     * owns
-     */
-    CSimLockUIBackgroundControl* iBackgroundControl;
-
-    /**
-     * Pointer to "delegate" class that is responsible for non-UI functions related
-     * to the phone and SimLock.     
-     */
-    CSimLockDataHandlingDelegate& iSimLockDelegate;
-
-    /**
-     * For foreground event handling, indicate first time run
-     */
-    TBool iFirstRun;
-
-    /**
-     * Proxy used to talk to CTelephony in a synchronous fashion
-     * owns
-     */
-    CSimLockTelephonyProxy* iTelephonyProxy;  
-    
-    //RProperty for publish key
-    RProperty iProperty;
-
-    };
-
-
-#endif // __SIMLOCKUI_APPUI_H__
-
-// End of file.
--- a/securitydialogs/simlockui/inc/SimLockUIBackgroundControl.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,148 +0,0 @@
-/*
-* ============================================================================
-*  Name         : SimLockUIBackgroundControl.h
-*  Part of      : Sim Lock UI Application
-*  Description  : SimLock UI Background Control Header
-*  Version      : 
-*  
-* Copyright (c) 2005-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:   Build info file for Ado domain appinstall 
-* ============================================================================
-*/
-
-#ifndef __SIMLOCKUI_BACKGROUNDCONTROL_H__
-#define __SIMLOCKUI_BACKGROUNDCONTROL_H__
-
-// System includes
-#include <e32base.h>
-#include <coecntrl.h>       // CCoeControl
-
-// Forward declarations
-class CAknsBasicBackgroundControlContext;
-class CGraphicsContext;
-
-/**
- *  CSimLockUIBackgroundControl
- *
- *  A CCoeControl object that represents the application background.
- *
- *  @lib cone.lib
- *  @lib aknskins.lib
- *  @lib aknskinsrv.lib
- *  @lib aknswallpaperutils.lib
- */
-class CSimLockUIBackgroundControl : public CCoeControl
-    {
-public: // Public Constructors
-
-    /**
-     * NewL
-     * Create a CSimLockUIBackgroundControl object, which will draw itself to aRect
-     *
-     * @return a pointer to the created instance of CSimLockUIBackgroundControl
-     */
-    static CSimLockUIBackgroundControl* NewL();
-
-    /**
-     * NewLC
-     * Create a CSimLockUIBackgroundControl object, which will draw itself to aRect
-     *
-     * @return a pointer to the created instance of CSimLockUIBackgroundControl
-     */
-    static CSimLockUIBackgroundControl* NewLC();
-
-
-    /**
-     * ~CSimLockUIBackgroundControl
-     * Destroy the object and release all memory objects
-     */
-     virtual ~CSimLockUIBackgroundControl();
-
-public: // Public API
-
-    /**
-     * SetBackgroundText
-     * Set the background text
-     *
-     * @param aText new background text( ownership passed )
-     */
-    void SetBackgroundText( HBufC* aText );
-
-private: // Private Consructors
-
-    /**
-     * ConstructL
-     * Perform the second phase construction of a CSimLockUIBackgroundControl object
-     */
-    void ConstructL();
-
-private: // From CCoeControl
-
-    /**
-     * SizeChanged
-     * Indicate that the control has been resized
-     */
-    virtual void SizeChanged();
-
-    /**
-     * HandleResourceChange
-     */
-    void HandleResourceChange( TInt aType );
-
-    /**
-     * Draw
-     * Draw this CSimLockUIBackgroundControl to the screen
-     *
-     * @param aRect the rectangle of this view that needs updating
-     */
-    virtual void Draw( const TRect& aRect ) const;
-
-    /**
-     * MopSupplyObject
-     * Retrieves an object of the same type as that encapsulated in aId.
-     *
-     * @param aId type of object to retrieve
-     */
-    virtual TTypeUid::Ptr MopSupplyObject( TTypeUid aId );
-
-private: // Private Member API
-
-    /**
-     * DisplayText
-     * Called by Draw() to display the appropriate background text
-     *
-     * @param aGc graphics context which draws the text
-     */
-    void DisplayText( CGraphicsContext& aGc ) const;
-
-private:    // Member data
-
-    /**
-     * Control which represents the background image
-     * owns
-     */
-    CAknsBasicBackgroundControlContext* iBackgroundSkinContext;
-
-    /**
-     * Text to display on background pane
-     * owns
-     */
-    HBufC* iDisplayText;
-    };
-
-
-#endif // __SIMLOCKUI_BACKGROUNDCONTROL_H__
-
-// End of file.
-
--- a/securitydialogs/simlockui/inc/SimLockUIDocument.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
-/*
-* ============================================================================
-*  Name         : SimLockUIDocument.h
-*  Part of      : Sim Lock UI Application
-*  Description  : Create session to ETel and owns SimLock UI Delegate
-*  Version      : 
-*  
-* Copyright (c) 2005-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:   Build info file for Ado domain appinstall 
-* ============================================================================
-*/
-
-#ifndef __SIMLOCKUI_DOCUMENT_H__
-#define __SIMLOCKUI_DOCUMENT_H__
-
-// INCLUDES
-#include <AknDoc.h>
-#include <rmmcustomapi.h> // RMmCustomAPI, RTelServer, RMobilePhone
-
-// CONSTANTS
-
-// MACROS
-
-// DATA TYPES
-
-// FUNCTION PROTOTYPES
-
-// FORWARD DECLARATIONS
-
-class CSimLockUIAppUi;
-class CEikApplication;
-class CSimLockDataHandlingDelegate;
-
-
-/**
- * CSimLockUIDocument
- * An instance of class CSimLockUIDocument is the Document part of the AVKON
- * application framework for the SimLockUI example application
- *
- * @lib avkon.lib
- * @lib eikcore.lib
- * @lib eiksrv.lib
- */
-class CSimLockUIDocument : public CAknDocument
-    {
-public: // Public Constructors/Destructor
-
-    /**
-     * NewL
-     * Construct a CSimLockUIDocument for the AVKON application aApp
-     * using two phase construction, and return a pointer to the created object
-     * @param aApp application creating this document
-     * @return a pointer to the created instance of CSimLockUIDocument
-     */
-    static CSimLockUIDocument* NewL( CEikApplication& aApp );
-
-     /**
-      * NewLC
-      * Construct a CSimLockUIDocument for the AVKON application aApp
-      * using two phase construction, and return a pointer to the created object,
-      * leaving an instance on the Cleanup Stack.
-      *
-      * @param aApp application creating this document
-      * @return a pointer to the created instance of CSimLockUIDocument
-      */
-    static CSimLockUIDocument* NewLC( CEikApplication& aApp );
-
-     /**
-      * ~CSimLockUIDocument
-      * Destroy the object and release all memory objects
-      */
-    virtual ~CSimLockUIDocument();
-
-public: // from CAknDocument
-
-     /**
-      * CreateAppUiL
-      * Create a CSimLockUIAppUi object and return a pointer to it
-      *
-      * @return a pointer to the created instance of the AppUi created
-      */
-    virtual CEikAppUi* CreateAppUiL();
-
-private: // Private Constructors
-
-     /**
-      * ConstructL
-      * Perform the second phase construction of a CSimLockUIDocument object
-      */
-    void ConstructL();
-
-     /**
-      * CSimLockUIDocument
-      * Perform the first phase of two phase construction
-      *
-      * @param aApp application creating this document
-      */
-    CSimLockUIDocument( CEikApplication& aApp );
-
-
-private: // Member Data
-
-     /**
-      * Handle to ETel Server
-      */
-    RTelServer   iServer;
-
-    /**
-     * Handle to ETel Mobile Phone Object
-     */
-    RMobilePhone iPhone;
-
-    /**
-     * Handle to ETel Custom API Object
-     */
-    RMmCustomAPI iCustomPhone;
-
-    /**
-     * Handle to Sim Lock Delegate
-     * owns
-     */
-    CSimLockDataHandlingDelegate* iSimLockDelegate;
-    };
-
-
-#endif // __SIMLOCKUI_DOCUMENT_H__
-
-// end of file.
-
--- a/securitydialogs/simlockui/inc/SimLockUiKeys.h	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
-* ============================================================================
-*  Name         : SimLockUIKeys.h
-*  Part of      : Sim Lock UI Application
-*  Description  : SimLock P&S keys
-*  Version      : 
-*  
-* Copyright (c) 2005-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:   Build info file for Ado domain appinstall 
-* ============================================================================
-*/
-
-#ifndef __SIMLOCKUI_KEYS_H__
-#define __SIMLOCKUI_KEYS_H__
-
-// System includes
-#include <aknappui.h>
-#include <aknnotedialog.h>  // CAknNoteDialog::TTone
-#include <e32property.h>    // RProperty.
-
-
-// FORWARD DECLARATIONS
-class RProperty;
-const TUid KSimLockProperty={0x10003b21};
-
-
-enum TSimLockPropertyKeys  { ESimLockProperty, ESimLockActiveStatus };
-
-/**
- *0: Default value
- *1: Indicates that "function" is done 
-*/
-enum TSimLockActiveStatus
-  {
-   KSimLockStatusUnknown = 0,
-   KSimLockStatusDone
-   };
-
-#endif // __SIMLOCKUI_KEYS_H__
-
-// End of file.
--- a/securitydialogs/simlockui/rom/simlockui.iby	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
-* ============================================================================
-*  Name        : simlockui.iby
-*  Part of     : SimLock UI
-*  Description : SimLock UI iby file
-*  Version     :
-*
-* Copyright (c) 2005-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:   Build info file for Ado domain appinstall 
-* ============================================================================
-*/
-
-
-
-#ifndef _SIMLOCKUI_IBY_
-#define _SIMLOCKUI_IBY_
-
-#include <data_caging_paths_for_iby.hrh>
-#ifdef FF_SIMLOCK_UI
-// Definitions for applications with a UI
-S60_APP_EXE( SimLockUI )
-S60_APP_AIF_RSC( SimLockUI )
-
-#endif  // FF_SIMLOCK_UI
-
-#endif // _SIMLOCKUI_IBY_
--- a/securitydialogs/simlockui/rom/simlockui_resources.iby	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-/*
-* ============================================================================
-*  Name        : simlockui_resources.iby
-*  Part of     : SimLock UI
-*  Description : SimLock UI resources iby file
-*  Version     : 
-*
-* Copyright (c) 2005-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:   Build info file for Ado domain appinstall 
-* ============================================================================
-*/
-
-#ifndef _SIMLOCKUI_RESOURCES_IBY_
-#define _SIMLOCKUI_RESOURCES_IBY_
-
-#include <data_caging_paths_for_iby.hrh>
-#ifdef FF_SIMLOCK_UI
-S60_APP_RESOURCE( SimLockUI )
-#endif  // FF_SIMLOCK_UI
-
-#endif // _SIMLOCKUI_RESOURCES_IBY_
--- a/securitydialogs/simlockui/src/SimLockDataHandlingDelegate.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,175 +0,0 @@
-/*
-* ============================================================================
-*  Name        : SimLockDataHandlingDelegate.cpp
-*  Part of     : Sim Lock UI Application
-*  Description : Implementation of Sim Lock UI Application
-*  Version     :
-*   
-* Copyright (c) 2005-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:   Build info file for Ado domain appinstall 
-* ============================================================================
-*/
-
-// System Include Files
-#include <rmmcustomapi.h>           // RMmCustomAPI, RMobilePhone
-
-// User Include Files
-#include "simlockdatahandlingdelegate.h"
-#include "simlockui.pan"
-#include "simlockisaserverdefinitions.h"
-
-
-TInt KSimLockTimeoutDelay = 5000000;       // 5 seconds
-
-// ===========================================================================
-// PUBLIC CONSTRUCTORS
-// ===========================================================================
-
-// ---------------------------------------------------------------------------
-// CSimLockDataHandlingDelegate::NewL
-// ---------------------------------------------------------------------------
-CSimLockDataHandlingDelegate* CSimLockDataHandlingDelegate::NewL( RMmCustomAPI& aCustomAPI )
-    {
-    CSimLockDataHandlingDelegate* self = new ( ELeave ) CSimLockDataHandlingDelegate( aCustomAPI );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockDataHandlingDelegate::~CSimLockDataHandlingDelegate
-// ---------------------------------------------------------------------------
-CSimLockDataHandlingDelegate::~CSimLockDataHandlingDelegate()
-    {
-    Cancel();
-    delete iTimer;
-    delete iSchedulerWait;
-    }
-
-// ===========================================================================
-// PUBLIC MEMBER FUNCTIONS
-// ===========================================================================
-
-// ---------------------------------------------------------------------------
-// CSimLockDataHandlingDelegate::OpenSimLock
-// ---------------------------------------------------------------------------
-TInt CSimLockDataHandlingDelegate::OpenSimLock( const TDesC& aPassword )
-    {
-    // Use ETel custom API to deactive SimLock
-    return iCustomAPI.DeActivateSimLock( aPassword, RMmCustomAPI::EOperator );
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockDataHandlingDelegate::IsSimLockOpen
-// ---------------------------------------------------------------------------
-TBool CSimLockDataHandlingDelegate::IsSimLockOpen() const
-    {
-
-    ASSERT( iDataHasBeenRead );
-
-    return iLockIsOpen;
-    }
-
-
-// ===========================================================================
-// PRIVATE CONSTRUCTORS
-// ===========================================================================
-
-// ---------------------------------------------------------------------------
-// CSimLockDataHandlingDelegate::CSimLockDataHandlingDelegate
-// ---------------------------------------------------------------------------
-CSimLockDataHandlingDelegate::CSimLockDataHandlingDelegate( RMmCustomAPI& aCustomAPI )
-:   CActive( EPriorityStandard ),
-    iCustomAPI( aCustomAPI )
-    { //lint !e1403 iIndicators initialized in CBase ctor
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockDataHandlingDelegate::ConstructL
-// ---------------------------------------------------------------------------
-void CSimLockDataHandlingDelegate::ConstructL()
-    {
-    CActiveScheduler::Add(this);
-    iSchedulerWait = new ( ELeave ) CActiveSchedulerWait;
-    iTimer = CPeriodic::NewL(EPriorityHigh);
-    }
-
-// ===========================================================================
-// PRIVATE MEMBER FUNCTIONS
-// ===========================================================================
-
-// ---------------------------------------------------------------------------
-// CSimLockDataHandlingDelegate::RunL
-// ---------------------------------------------------------------------------
-void CSimLockDataHandlingDelegate::RunL()
-    {
-
-    // Stop the current run sequence
-    iSchedulerWait->AsyncStop();
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockDataHandlingDelegate::DoCancel
-// ---------------------------------------------------------------------------
-void CSimLockDataHandlingDelegate::DoCancel()
-    {
-  
-    // Cancel timer
-    iTimer->Cancel();
-
-    // Stop the current run sequence so we can continue execution in a
-    // synchronous fashion
-    iSchedulerWait->AsyncStop();
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockTelephonyProxy::TimerElapsed
-// ---------------------------------------------------------------------------
-TInt CSimLockDataHandlingDelegate::TimerElapsed(TAny* /*aUnused*/)
-    {        
-    // Some request did not complete while reading Sim Lock data.
-    // This is not expected, so Panic.
-    Panic( ESimLockUIUnableToReadSimLock );
-    
-    return 0;
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockDataHandlingDelegate::CompleteRequestWithTimeout
-// ---------------------------------------------------------------------------
-void CSimLockDataHandlingDelegate::CompleteRequestWithTimeout()
-    {
-    
-    ASSERT( ! iTimer->IsActive() );
-    
-    if ( ! iTimer->IsActive() )
-        {        
-        iTimer->Cancel();
-        }
-        
-    // Start timer with KSimLockProxyTimeout to protect against requests that
-    // do not complete for some reason.
-    iTimer->Start(KSimLockTimeoutDelay,0,TCallBack(&TimerElapsed));              
-        
-    SetActive();
-
-    // Wait for request to complete.  Response time is expected to be negligible.
-    iSchedulerWait->Start();
-    iTimer->Cancel();
-    }
-
-
-// end of file.
-
--- a/securitydialogs/simlockui/src/SimLockTelephonyProxy.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,157 +0,0 @@
-/*
-* ============================================================================
-*  Name        : SimLockTelephonyProxy.cpp
-*  Part of     : Sim Lock UI Telephony Proxy
-*  Description : Wrap asynchronous calls to Core Telephony
-*  Version     : 
-*  
-* Copyright (c) 2005-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:   Build info file for Ado domain appinstall 
-* ============================================================================
-*/
-
-// System Includes
-#include <etel3rdparty.h>           // CTelephony
-
-// User Includes
-#include "simlocktelephonyproxy.h"
-#include "simlockui.pan"
-
-
-TInt KSimLockProxyTimeout = 5000000;    // 5 seconds
-
-// ---------------------------------------------------------------------------
-// CSimLockDataHandlingDelegate::NewL
-// ---------------------------------------------------------------------------
-CSimLockTelephonyProxy* CSimLockTelephonyProxy::NewL()
-    {
-    CSimLockTelephonyProxy* self = new ( ELeave ) CSimLockTelephonyProxy();
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockTelephonyProxy::CSimLockTelephonyProxy
-// ---------------------------------------------------------------------------
-CSimLockTelephonyProxy::~CSimLockTelephonyProxy()
-    {
-    Cancel();
-    delete iTelephony;
-    delete iSchedulerWait;
-    delete iTimer;
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockTelephonyProxy::IsCallInProgress
-// ---------------------------------------------------------------------------
-TBool CSimLockTelephonyProxy::IsCallInProgress()
-    {
-    iTelephony->GetIndicator( iStatus, iIndicatorPackage );    
-    CompleteRequestWithTimeout();
-
-    if ( iStatus != KErrNone )
-        {
-        // If there is an error obtaining status, assume no call in progress
-        }
-    else if ( iIndicators.iIndicator & CTelephony::KIndCallInProgress )
-        {
-        return ETrue;
-        }
-
-    return EFalse;
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockTelephonyProxy::RunL
-// ---------------------------------------------------------------------------
-void CSimLockTelephonyProxy::RunL()
-    {    
-    // Stop the current run sequence so we can continue execution in a
-    // synchronous fashion
-    iSchedulerWait->AsyncStop();
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockTelephonyProxy::DoCancel
-// ---------------------------------------------------------------------------
-void CSimLockTelephonyProxy::DoCancel()
-    {
-    // Cancel outstanding request
-    iTelephony->CancelAsync( CTelephony::EGetIndicatorCancel );
-    iSchedulerWait->AsyncStop();
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockTelephonyProxy::CSimLockTelephonyProxy
-// ---------------------------------------------------------------------------
-CSimLockTelephonyProxy::CSimLockTelephonyProxy()
-    : CActive( EPriorityStandard ),
-    iIndicatorPackage( iIndicators )
-    {
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockTelephonyProxy::ConstructL
-// ---------------------------------------------------------------------------
-void CSimLockTelephonyProxy::ConstructL()
-    {
-    CActiveScheduler::Add( this );
-    iSchedulerWait = new ( ELeave ) CActiveSchedulerWait;
-    iTelephony = CTelephony::NewL();    
-    iTimer = CPeriodic::NewL(EPriorityHigh);
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockTelephonyProxy::TimerElapsed
-// ---------------------------------------------------------------------------
-TInt CSimLockTelephonyProxy::TimerElapsed(TAny* aClientObject)
-    {
-    CSimLockTelephonyProxy* clientObject = static_cast<CSimLockTelephonyProxy*>(aClientObject);
-    
-    // Timeout timer has elapsed.  An asynchronous request timed out.            
-    ASSERT(0);
-
-    // Cancel original request
-    clientObject->Cancel();        
-    return 0;
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockTelephonyProxy::CompleteRequestWithTimeout
-// ---------------------------------------------------------------------------
-void CSimLockTelephonyProxy::CompleteRequestWithTimeout()
-    {
-                
-    if ( iTimer->IsActive() )
-        {
-        ASSERT(0);
-        iTimer->Cancel();
-        }    
-        
-    // Start timer with KSimLockProxyTimeout to protect against requests that
-    // do not complete for some reason.
-    iTimer->Start(KSimLockProxyTimeout,0,TCallBack(&TimerElapsed, this));  
-        
-    SetActive();
-
-    // Wait for request to complete.  Response time is expected to be negligible.
-    iSchedulerWait->Start();        
-    
-    iTimer->Cancel();        
-    }
-
-// end of file
-
--- a/securitydialogs/simlockui/src/SimLockUI.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
-* ============================================================================
-*  Name        : simlockui.cpp
-*  Part of     : Sim Lock UI Application
-*  Description : Sim Lock UI App framework code
-*  Version     : 
-*  
-* Copyright (c) 2005-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:   Build info file for Ado domain appinstall 
-* ============================================================================
-*/
-
-// System Includes
-#include <eikstart.h>
-
-// User Includes
-#include "simlockuiapplication.h"
-
-// ---------------------------------------------------------------------------
-// NewApplication
-// ---------------------------------------------------------------------------
-CApaApplication* NewApplication()
-    {
-    // Create an application, and return a pointer to it
-    return new CSimLockUIApplication;
-    }
-
-// ---------------------------------------------------------------------------
-// E32Main
-// ---------------------------------------------------------------------------
-TInt E32Main()
-    {
-    return EikStart::RunApplication( NewApplication );
-    }
-
-// End of file
-
-
--- a/securitydialogs/simlockui/src/SimLockUIApplication.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
-* ============================================================================
-*  Name        :simlockuiapplication.cpp
-*  Part of     : Sim Lock UI Application
-*  Description : Implementation of Sim Lock UI Application UI Methods
-*  Version     : 
-*  
-* Copyright (c) 2005-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:   Build info file for Ado domain appinstall 
-* ============================================================================
-*/
-
-// User include files
-#include "simlockuidocument.h"
-#include "simlockuiapplication.h"
-#include "simlockui.hrh"
-
-// UID for the application, this should correspond to the uid defined in the mmp file
-static const TUid KUidSimLockUIApp = {SIMLOCK_UI_UID3};
-
-// ---------------------------------------------------------------------------
-// CSimLockUIApplication::CreateDocumentL
-// ---------------------------------------------------------------------------
-CApaDocument* CSimLockUIApplication::CreateDocumentL()
-    {  
-    // Create an SimLockUI document, and return a pointer to it
-    CApaDocument* document = CSimLockUIDocument::NewL( *this );
-    return document;
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockUIApplication::AppDllUid
-// ---------------------------------------------------------------------------
-TUid CSimLockUIApplication::AppDllUid() const
-    {
-    // Return the UID for the SimLockUI application
-    return KUidSimLockUIApp;
-    }
-
-// End of file
-
--- a/securitydialogs/simlockui/src/SimLockUIAppui.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,411 +0,0 @@
-/*
- * ============================================================================
- *  Name        : SimLockUIAppUi.cpp
- *  Part of     : Sim Lock UI Application
- *  Description : Implementation of Sim Lock UI Application UI Methods
- *  Version     : 
- *  
-* Copyright (c) 2005-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:   Build info file for Ado domain appinstall 
-* ============================================================================
-*/
-
-// Platform Includes
-#include <avkon.hrh>
-#include <aknnotewrappers.h>    // CAknNoteDialog
-#include <StringLoader.h>       // StringLoader
-#include <exterror.h>           // KErrGsm0707OperationNotAllowed
-#include <eikspane.h>     // CEikStatusPane
-#include <aknmessagequerydialog.h> // CAknMessageQueryDialog
-#include <e32base.h>
-#include <e32property.h> //Rproperty
-#include <rmmcustomapi.h>       // TSimLockPassword
-
-// Local Includes
-#include "simlockisaserverdefinitions.h"
-#include "simlockui.pan"
-#include "simlockuiappui.h"
-#include "simlockuibackgroundcontrol.h"
-#include "simlockui.hrh"
-#include "simlockdatahandlingdelegate.h"
-#include "simlocktelephonyproxy.h"
-#include "simlockuikeys.h"
-
-// Resource Includes
-#include <simlockui.rsg>
-
-// ---------------------------------------------------------------------------
-// CSimLockUIAppUi::CSimLockUIAppUi
-// ---------------------------------------------------------------------------
-CSimLockUIAppUi::CSimLockUIAppUi(
-        CSimLockDataHandlingDelegate& aSimLockDelegate) :
-    iSimLockDelegate(aSimLockDelegate), iFirstRun(ETrue)
-    {
-    // no implementation required
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockUIAppUi::ConstructL
-// ---------------------------------------------------------------------------
-void CSimLockUIAppUi::ConstructL()
-    {
-    BaseConstructL(EAknEnableSkin | EAknEnableMSK);
-
-    // Used to get status of phone call
-    iTelephonyProxy = CSimLockTelephonyProxy::NewL();
-    //Define RProperty to Publish Keys for SimLockUi
-    TInt ret = RProperty::Define(KSimLockProperty, ESimLockActiveStatus,
-            RProperty::EInt);
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockUIAppUi::~CSimLockUIAppUi
-// ---------------------------------------------------------------------------
-CSimLockUIAppUi::~CSimLockUIAppUi()
-    {
-
-    delete iTelephonyProxy;
-
-    if (iBackgroundControl)
-        {
-        RemoveFromStack(iBackgroundControl);
-        delete iBackgroundControl;
-        }
-    //Sets SimLock Ui P&S keys to show that SimLock Ui is exiting
-    RProperty::Set(KSimLockProperty, ESimLockActiveStatus, KSimLockStatusDone);
-
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockUIAppUi::HandleCommandL
-// ---------------------------------------------------------------------------
-void CSimLockUIAppUi::HandleCommandL(TInt aCommand)
-    {
-    switch (aCommand)
-        {
-        case EEikCmdExit:
-        case EAknSoftkeyExit:
-            Exit();
-            break;
-
-        default:
-            Panic(ESimLockUIBasicUi);
-            break;
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockUIAppUi::HandleForegroundEventL
-// ---------------------------------------------------------------------------
-void CSimLockUIAppUi::HandleForegroundEventL(TBool aForeground)
-    {
-    CAknAppUi::HandleForegroundEventL(aForeground);
-
-    // When the app switches to the foreground for the first time, display
-    // series of dialogs.
-    if (aForeground && iFirstRun)
-        {
-        iFirstRun = EFalse;   
-        ProcessSimUnlockDialogsL();
-        PrepareToExit();
-        Exit();
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockUIAppUi::ProcessSimUnlockDialogsL
-// ---------------------------------------------------------------------------
-TBool CSimLockUIAppUi::ProcessSimUnlockDialogsL()
-    {
-    TBool keepLooping = ETrue;
-
-    RMmCustomAPI::TSimLockPassword password;
-
-
-    // Loop until flag is set
-    do
-        {
-        // Create background if not already there
-        if (!iBackgroundControl)
-            {
-            CreateBackgroundControlL();
-            }
-        // Display Introduction Dialog/Prompt
-        if (!DisplayIntroductionDialogL())
-            {
-            return EFalse;
-            }
-        // Prompt for password and attempt to unlock Sim
-        if (!PromptForPasswordL(password))
-            {
-            // skip next iteration
-            continue;
-            }        
-        // Set only if no dialogs are ever dismissed
-         keepLooping = AttemptToUnlockSimL(password);
-
-        // Continue to loop while indicated to start over and dialog
-        // has not been dismissed
-        }
-    while (keepLooping);
-    
-  return keepLooping;
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockUIAppUi::CreateBackgroundControlL
-// ---------------------------------------------------------------------------
-void CSimLockUIAppUi::CreateBackgroundControlL()
-    {
-    iBackgroundControl = CSimLockUIBackgroundControl::NewL();
-    AddToStackL(iBackgroundControl);
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockUIAppUi::DisplayIntroductionDialogL
-// ---------------------------------------------------------------------------
-TBool CSimLockUIAppUi::DisplayIntroductionDialogL()
-    {
-    SetBackgroundTextL(EBackgroundTextEmpty);
-
-    HBufC* displayText = StringLoader::LoadLC(R_SIM_INFO_WELCOME_NOTE_TEXT);
-    CAknMessageQueryDialog* query = new (ELeave) CAknMessageQueryDialog(
-            CAknMessageQueryDialog::ENoTone);
-    CleanupStack::PushL(query);
-    query->SetMessageTextL(*displayText);
-    TInt executeResult = query->ExecuteLD(R_SIM_INFO_WELCOME_NOTE);
-    CleanupStack::Pop(query);
-    CleanupStack::PopAndDestroy(displayText);
-    return executeResult;
-
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockUIAppUi::PromptForPasswordL
-// ---------------------------------------------------------------------------
-TBool CSimLockUIAppUi::PromptForPasswordL(TDes& aPassword)
-    {
-    RMmCustomAPI::TSimLockPassword newPassword;
-
-    // Prompt for password twice.  Loop until passwords match.
-    do
-        {
-        aPassword.Zero();
-
-        // Ask for password
-        CAknTextQueryDialog* dialog = CAknTextQueryDialog::NewL(aPassword);
-        if (!dialog->ExecuteLD(R_SIM_INFO_ENTER_PASSWORD))
-            {
-            return EFalse;
-            }
-
-        // Ask to re-enter password and verify there is no call in progress
-        if (!CompletePromptForPasswordL(aPassword, newPassword))
-            {
-            return EFalse;
-            }
-        }
-    while (newPassword.Compare(aPassword));
-
-    return ETrue;
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockUIAppUi::CompletePromptForPasswordL
-// ---------------------------------------------------------------------------
-TBool CSimLockUIAppUi::CompletePromptForPasswordL(const TDesC& aPassword,
-        TDes& aNewPassword)
-    {
-    TBool callInProgress = EFalse;
-
-    aNewPassword.Zero();
-
-    do // Loop until no call in progress
-        {
-        // Display dialog to ask to re-enter password
-        CAknTextQueryDialog* dialog = CAknTextQueryDialog::NewL(aNewPassword);
-        if (!dialog->ExecuteLD(R_SIM_INFO_REENTER_PASSWORD))
-            {
-             return EFalse;
-            }
-
-        // Check to see if passwords match
-        if (aNewPassword.Compare(aPassword))
-            {
-            // Create message query dialog to indicate that codes do not match
-            CAknMessageQueryDialog* query =
-                    new (ELeave) CAknMessageQueryDialog(
-                            CAknMessageQueryDialog::ENoTone);
-            return query->ExecuteLD(R_SIM_INFO_CODES_NOT_MATCH);            
-            }
-
-        // If there is a call in progress, show note and return to "re-enter password" prompt
-        if (!iTelephonyProxy->IsCallInProgress())
-            {
-            return ETrue;
-            }
-
-        // Do not allow Sim unlocking, return to password prompt
-        ShowInformationNoteL(R_SIM_UNLOCK_MESSAGE_END_CALL);
-        callInProgress = ETrue;
-        }
-    while (callInProgress);
-
-    return ETrue;
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockUIAppUi::AttemptToUnlockSimL
-// ---------------------------------------------------------------------------
-TBool CSimLockUIAppUi::AttemptToUnlockSimL(const TDesC& aPassword)
-    {
-    
-const TDesC& password =  aPassword;
-
-#ifdef __WINS__
-    // In WINS (Emulator) builds, call to OpenSimLock will just time out
-    TInt unlockResult = KErrGsm0707IncorrectPassword;
-#else
-    // Attempt to unlock SIM
-    TInt unlockResult = iSimLockDelegate.OpenSimLock( password );
-#endif
-
-    CAknMessageQueryDialog* query = new (ELeave) CAknMessageQueryDialog(
-            CAknMessageQueryDialog::ENoTone);
-
-    switch (unlockResult)
-        {
-        case KErrAlreadyExists:
-            // Should not happen!  This indicates that the phone was already unlocked,
-            // which it shouldn't be if we got this far.
-            ASSERT( 0 );
-
-            // Fall Through
-
-        case KErrNone:
-            SetBackgroundTextL(EBackgroundTextUnlockComplete);
-            ShowInformationNoteL(R_SIM_PHONE_UNLOCKED);
-            return EFalse;
-
-        default:
-            // Oops, we missed one.
-            ASSERT( 0 );
-        case KErrGsm0707OperationNotAllowed:
-        case KErrLocked:
-            // Permanently locked
-            SetBackgroundTextL(EBackgroundTextEmpty);
-            query->ExecuteLD(R_SIM_UNLOCK_FINAL);
-            return EFalse;
-        case KErrTimedOut:
-        case KErrGeneral:        
-        case KErrArgument:
-        case KErrGsm0707IncorrectPassword:
-            // Not permanently locked
-            return HandleUnlockFailedL();
-
-
-        }//switch
-    }
-// ---------------------------------------------------------------------------
-// CSimLockUIAppUi::HandleUnlockFailedL
-// ---------------------------------------------------------------------------
-TBool CSimLockUIAppUi::HandleUnlockFailedL()
-    {
-    RMmCustomAPI::TSimLockPassword password;
-
-    // Otherwise, prompt user to try again
-    SetBackgroundTextL(EBackgroundTextEmpty);
-
-    // Show "Code Incorrect" and prompt user to continue or not
-    CAknMessageQueryDialog* query = new (ELeave) CAknMessageQueryDialog(
-            CAknMessageQueryDialog::ENoTone);
-    if (query->ExecuteLD(R_SIM_INFO_CODE_INCORRECT))
-        {
-        if ( PromptForPasswordL(password) )
-            {
-            return AttemptToUnlockSimL(password);    
-            }
-        else
-            {
-            // Set flag indicating to keep looping            
-            return ETrue;
-            }
-        }
-    else
-        {
-        // display intro popup
-        return ETrue;
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockUIAppUi::ShowInformationNoteL
-// ---------------------------------------------------------------------------
-TInt CSimLockUIAppUi::ShowInformationNoteL(TInt aResourceId) const
-    {
-    TInt executeResult;
-
-    // Show note with the provided resource id
-    HBufC* displayText = StringLoader::LoadLC(aResourceId);
-
-    CAknInformationNote* dialog = new (ELeave) CAknInformationNote(ETrue);
-    executeResult = dialog->ExecuteLD(*displayText);
-    CleanupStack::PopAndDestroy(displayText);
-    return executeResult;
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockUIAppUi::SetBackgroundTextL
-// ---------------------------------------------------------------------------
-void CSimLockUIAppUi::SetBackgroundTextL(TBackgroundText aText)
-    {
-    HBufC* displayText = NULL;
-
-    // Load resource and set text in background control based on provided info
-    switch (aText)
-        {
-        case EBackgroundTextEmpty:
-            displayText = KNullDesC().AllocL();
-            break;
-
-        case EBackgroundTextMain:
-            displayText = StringLoader::LoadL(
-                    R_SIMLOCK_UI_BACKGROUND_TEXT_MAIN);
-            break;
-
-        case EBackgroundTextUnlockComplete:
-            displayText = StringLoader::LoadL(
-                    R_SIMLOCK_UI_BACKGROUND_TEXT_UNLOCK_COMPLETE);
-            break;
-
-        case EBackgroundTextUnlockFailed:
-            displayText = StringLoader::LoadL(
-                    R_SIMLOCK_UI_BACKGROUND_TEXT_UNLOCK_FAILED);
-            break;
-
-        case EBackgroundTextUnlockIncorrect:
-            displayText = StringLoader::LoadL(
-                    R_SIMLOCK_UI_BACKGROUND_TEXT_UNLOCK_INCORRECT);
-            break;
-
-        default:
-            ASSERT( 0 );
-            break;
-        }
-
-    // Transfer ownership to iBackgroundControl
-    iBackgroundControl->SetBackgroundText(displayText);
-    }
-
-// End of file.
--- a/securitydialogs/simlockui/src/SimLockUIBackgroundControl.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,191 +0,0 @@
-/*
-* ============================================================================
-*  Name        : SimLockUIBackgroundControl.cpp
-*  Part of     : Sim Lock UI Application
-*  Description : Implementation of Sim Lock UI Background
-*  Version     :
-*  
-* Copyright (c) 2005-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:   Build info file for Ado domain appinstall 
-* ============================================================================
-*/
-
-
-// System Includes
-#include <coemain.h>
-#include <AknsDrawUtils.h>                      // AknsDrawUtils
-#include <AknsSkinInstance.h>                   // MAknsSkinInstance
-#include <AknsControlContext.h>                 // MAknsControlContext
-#include <AknsBasicBackgroundControlContext.h>  // CAknsBasicBackgroundControlContext
-#include <aknlayoutscalable_avkon.cdl.h>        // AknLayoutScalable_Avkon
-#include <AknUtils.h>                           // AknsUtils
-
-// User Includes
-#include "simlockuibackgroundcontrol.h"
-#include "simlockisaserverdefinitions.h"
-#include <simlockui.rsg>
-
-static const TInt KSkinLayoutOption = 2;
-
-// ---------------------------------------------------------------------------
-// CSimLockUIBackgroundControl::NewL
-// ---------------------------------------------------------------------------
-CSimLockUIBackgroundControl* CSimLockUIBackgroundControl::NewL()
-    {
-    CSimLockUIBackgroundControl* self = CSimLockUIBackgroundControl::NewLC();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockUIBackgroundControl::NewLC
-// ---------------------------------------------------------------------------
-CSimLockUIBackgroundControl* CSimLockUIBackgroundControl::NewLC()
-    {
-    CSimLockUIBackgroundControl* self = new ( ELeave ) CSimLockUIBackgroundControl;
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockUIBackgroundControl::~CSimLockUIBackgroundControl
-// ---------------------------------------------------------------------------
-CSimLockUIBackgroundControl::~CSimLockUIBackgroundControl()
-    {
-    delete iBackgroundSkinContext;
-    delete iDisplayText;
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockUIBackgroundControl::SetBackgroundText
-// ---------------------------------------------------------------------------
-void CSimLockUIBackgroundControl::SetBackgroundText( HBufC* aText )
-    {
-    delete iDisplayText;
-
-    iDisplayText = aText;
-
-    DrawDeferred();
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockUIBackgroundControl::ConstructL
-// ---------------------------------------------------------------------------
-void CSimLockUIBackgroundControl::ConstructL()
-    {
-    // Create a window for this application view
-    CreateWindowL();
-    SetExtentToWholeScreen();
-
-    iBackgroundSkinContext = CAknsBasicBackgroundControlContext::NewL(
-            KAknsIIDQsnBgAreaMain, Rect(), EFalse );
-
-    // Activate the window, which makes it ready to be drawn
-    ActivateL();
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockUIBackgroundControl::SizeChanged
-// ---------------------------------------------------------------------------
-void CSimLockUIBackgroundControl::SizeChanged()
-    {
-    // Background skin.
-    if ( iBackgroundSkinContext )
-        iBackgroundSkinContext->SetRect( Rect() );
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockUIBackgroundControl::HandleResourceChange()
-// ---------------------------------------------------------------------------
-//
-void CSimLockUIBackgroundControl::HandleResourceChange( TInt aType )
-    {
-    CCoeControl::HandleResourceChange( aType );
-
-    if ( aType == KEikDynamicLayoutVariantSwitch )
-        {
-        SetExtentToWholeScreen();
-        }
-    }
-
-
-// ---------------------------------------------------------------------------
-// CSimLockUIBackgroundControl::Draw
-// ---------------------------------------------------------------------------
-void CSimLockUIBackgroundControl::Draw( const TRect& /*aRect*/ ) const
-    {
-    // Draw background skin
-    CWindowGc& graphicsContext = SystemGc();
-    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
-    MAknsControlContext* controlContext = AknsDrawUtils::ControlContext( this );
-    AknsDrawUtils::Background( skin, controlContext, this, graphicsContext, Rect() );
-
-    // Draw background text
-    DisplayText( graphicsContext );
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockUIBackgroundControl::MopSupplyObject
-// ---------------------------------------------------------------------------
-TTypeUid::Ptr CSimLockUIBackgroundControl::MopSupplyObject( TTypeUid aId )
-    {
-    if ( aId.iUid == MAknsControlContext::ETypeId )
-        {
-        // Return the background skin object
-        return MAknsControlContext::SupplyMopObject( aId, iBackgroundSkinContext );
-        }
-
-    return CCoeControl::MopSupplyObject( aId );
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockUIBackgroundControl::DisplayText
-// ---------------------------------------------------------------------------
-void CSimLockUIBackgroundControl::DisplayText( CGraphicsContext& aGc ) const
-    {
-    if ( iDisplayText )
-        {
-        // Set up text and layout
-        TAknLayoutText line;
-        TAknTextLineLayout layout = AknLayoutScalable_Avkon::main_pane_empty_t1( KSkinLayoutOption ).LayoutLine();
-
-        line.LayoutText( Rect(), layout );
-
-        // Get color from skin instance.
-        TRgb color( line.Color() );
-
-        if ( AknsUtils::AvkonSkinEnabled() )
-            {
-            TRgb skinColor;
-
-            MAknsSkinInstance* skin = AknsUtils::SkinInstance();
-
-            TInt err = AknsUtils::GetCachedColor( skin,
-                                                  skinColor,
-                                                  KAknsIIDQsnTextColors,
-                                                  EAknsCIQsnTextColorsCG6 );
-            if ( err == KErrNone )
-                {
-                color = skinColor;
-                }
-            }
-
-        // Actually display the text
-        line.DrawText( aGc, *iDisplayText, ETrue, color );
-        }
-    }
-
-// End of file.
-
--- a/securitydialogs/simlockui/src/SimLockUIDocument.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,157 +0,0 @@
-/*
-* ============================================================================
-*  Name        : SimLockUIDocument.cpp
-*  Part of     : Sim Lock UI Application
-*  Description : Implementation of Sim Lock UI Application
-*  Version     : 
-*  
-* Copyright (c) 2005-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:   Build info file for Ado domain appinstall 
-*
-* ============================================================================
-*/
-
-// System Include Files
-#include <rmmcustomapi.h>           // RMmCustomAPI, RMobilePhone
-#include <mmtsy_names.h>            // KMmTsyModuleName
-
-// User Include Files
-#include "simlockdatahandlingdelegate.h"
-#include "simlockisaserverdefinitions.h"
-#include "simlockuiappui.h"
-#include "simlockuidocument.h"
-
-// Local Constants
-const TInt KTriesToConnectServer( 2 );
-const TInt KTimeBeforeRetryingServerConnection( 50000 );
-static const TInt KPhoneInfoIndex( 0 );
-
-
-// ---------------------------------------------------------------------------
-// CSimLockUIDocument::NewL
-// ---------------------------------------------------------------------------
-CSimLockUIDocument* CSimLockUIDocument::NewL( CEikApplication& aApp )
-    {
-    CSimLockUIDocument* self = NewLC( aApp );
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockUIDocument::NewLC
-// ---------------------------------------------------------------------------
-CSimLockUIDocument* CSimLockUIDocument::NewLC( CEikApplication& aApp )
-    {
-    CSimLockUIDocument* self = new ( ELeave ) CSimLockUIDocument( aApp );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockUIDocument::~CSimLockUIDocument
-// ---------------------------------------------------------------------------
-CSimLockUIDocument::~CSimLockUIDocument()
-    {
-    // Close phone
-    if ( iPhone.SubSessionHandle() )
-        {
-        iPhone.Close();
-        }
-
-    // Close custom phone
-    if ( iCustomPhone.SubSessionHandle() )
-        {
-        iCustomPhone.Close();
-        }
-
-    // Close ETel connection
-    if ( iServer.Handle() )
-        {
-        iServer.UnloadPhoneModule( KMmTsyModuleName );
-        iServer.Close();
-        }
-
-    // Delete simlock delegate
-    delete iSimLockDelegate;
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockUIDocument::CreateAppUiL
-// ---------------------------------------------------------------------------
-CEikAppUi* CSimLockUIDocument::CreateAppUiL()
-    {
-    // Create the application user interface, and return a pointer to it,
-    // the framework takes ownership of this object
-    CEikAppUi* appUi = new(ELeave)CSimLockUIAppUi( *iSimLockDelegate );
-    return appUi;
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockUIDocument::ConstructL
-// ---------------------------------------------------------------------------
-void CSimLockUIDocument::ConstructL()
-    {
-    RTelServer::TPhoneInfo phoneInfo;
-
-    TInt error( KErrGeneral );
-
-    // Connect to ETel server
-    // All server connections are tried to be made KTriesToConnectServer times because occasional
-    // fails on connections are possible, at least on some servers.
-    for ( TInt thisTry=0; thisTry<KTriesToConnectServer; thisTry++ )
-        {
-        error = iServer.Connect();
-        if ( error == KErrNone )
-            {
-            break;
-            }
-            
-        // Very small delay.  Does not have negative impact on UI.  Justifiable as workaround
-        // for potential failure.
-        User::After( KTimeBeforeRetryingServerConnection );
-        }
-    User::LeaveIfError( error );
-
-    // load TSY module
-    error = iServer.LoadPhoneModule( KMmTsyModuleName );
-    if ( error != KErrAlreadyExists )
-        {
-        // May also return KErrAlreadyExists if something else
-        // has already loaded the TSY module. And that is
-        // not an error.
-        User::LeaveIfError( error );
-        }
-
-    // Set TSY paramaters and open RPhone handle, then RMobilePhone handle
-    User::LeaveIfError( iServer.SetExtendedErrorGranularity( RTelServer::EErrorExtended ) );
-    User::LeaveIfError( iServer.GetPhoneInfo( KPhoneInfoIndex, phoneInfo ) );
-    User::LeaveIfError( iPhone.Open( iServer, phoneInfo.iName ) );
-    User::LeaveIfError( iCustomPhone.Open( iPhone ) );
-
-    // Create SimLock Data Handling Delegate
-    iSimLockDelegate = CSimLockDataHandlingDelegate::NewL( iCustomPhone );
-    }
-
-// ---------------------------------------------------------------------------
-// CSimLockUIDocument::CSimLockUIDocument
-// ---------------------------------------------------------------------------
-CSimLockUIDocument::CSimLockUIDocument( CEikApplication& aApp )
-    : CAknDocument( aApp )
-    {
-    // no implementation required
-    }
-
-// end of file.
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitysrv.pro	Tue Aug 31 16:04:40 2010 +0300
@@ -0,0 +1,22 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+# 
+# Description: SecUi notification dialog plugin project.
+#
+
+TEMPLATE = subdirs
+
+SUBDIRS += securitydialogs/securitydialogs.pro
+SUBDIRS += cpsecplugins/cpsecplugins.pro
+SUBDIRS += pkiutilities/pkiutilities.pro
+
--- a/sysdef_1_4_0.dtd	Thu Aug 19 10:45:23 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	Tue Aug 31 16:04:40 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>  
--- a/wim/Scard/src/ScardReaderRegistry.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/wim/Scard/src/ScardReaderRegistry.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -298,7 +298,7 @@
     TLauncherStruct launcher;
     launcher.iGroupID = KGroupID; //This is always 1
     launcher.iReaderID = KReaderID; //This is always 1
-    launcher.iSession.Connect();
+    User::LeaveIfError( launcher.iSession.Connect() );
 
     User::LeaveIfError( launcher.iLibrary.Load( KSwimReaderDLL ) );
 
Binary file wim/WimSoft/armv5/udeb/wimi.lib has changed
Binary file wim/WimSoft/armv5/urel/wimi.lib has changed
Binary file wim/WimSoft/winscw/udeb/WIMI.LIB has changed
Binary file wim/WimSoft/winscw/urel/WIMI.LIB has changed