Catchup to latest Symbian^4 GCC_SURGE
authorWilliam Roberts <williamr@symbian.org>
Thu, 22 Jul 2010 16:43:28 +0100
branchGCC_SURGE
changeset 40 604cd42065d1
parent 29 b63e8c2d8cff (current diff)
parent 38 e0432375ea67 (diff)
Catchup to latest Symbian^4
pkiutilities/CTSecurityDialogs/Group/CTSecDialogImpl.mmp
pkiutilities/CTSecurityDialogs/NotifInc/CTNoTrustQuery.h
pkiutilities/CTSecurityDialogs/NotifSrc/CTNoTrustQuery.cpp
pkiutilities/StubSIS/swipolicy.ini
pkiutilities/StubSIS/tlsproviderpolicy.ini
securitydialogs/Autolock/CenRep/AutolockPrivateCRKeys.h
securitydialogs/Autolock/aif/Autolockaif.rss
securitydialogs/Autolock/conf/autolock.confml
securitydialogs/Autolock/conf/autolock_102824AE.crml
securitydialogs/Autolock/conf/lock.confml
securitydialogs/Autolock/conf/lock_10283322.crml
securitydialogs/Autolock/data/Autolock.rss
securitydialogs/Autolock/data/Autolock_reg.rss
securitydialogs/Autolock/group/Autolock.mmp
securitydialogs/Autolock/group/Autolock_Icons_dc.mk
securitydialogs/Autolock/group/bld.inf
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/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/loc/autolock.loc
securitydialogs/Autolock/rom/AutolockResources.iby
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/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/AutolockSrv/AutolockSrv.loc
securitydialogs/AutolockSrv/AutolockSrv.pro
securitydialogs/AutolockSrv/AutolockSrv.qrc
securitydialogs/AutolockSrv/Keyguard_enabled.svg
securitydialogs/AutolockSrv/autolocksrv.qcrml
securitydialogs/AutolockSrv/autolockuseractivityservice.pro
securitydialogs/AutolockSrv/autolockuseractivityservice/autolockuseractivityservice.pri
securitydialogs/AutolockSrv/autolockuseractivityservice/autolockuseractivityservice.pro
securitydialogs/AutolockSrv/autolockuseractivityservice/autolockuseractivityservice_s60.pri
securitydialogs/AutolockSrv/autolockuseractivityservice/autolockuseractivityservice_stub.pri
securitydialogs/AutolockSrv/autolockuseractivityservice/common.pri
securitydialogs/AutolockSrv/autolockuseractivityservice/inc/autolockuseractivityservice.h
securitydialogs/AutolockSrv/autolockuseractivityservice/inc/autolockuseractivityservice_global.h
securitydialogs/AutolockSrv/autolockuseractivityservice/inc/autolockuseractivityserviceinterface.h
securitydialogs/AutolockSrv/autolockuseractivityservice/s60/inc/autolockuseractivityservice_p.h
securitydialogs/AutolockSrv/autolockuseractivityservice/s60/src/autolockuseractivityservice_p.cpp
securitydialogs/AutolockSrv/autolockuseractivityservice/src/autolockuseractivityservice.cpp
securitydialogs/AutolockSrv/autolockuseractivityservice/stub/inc/autolockuseractivityservice_p.h
securitydialogs/AutolockSrv/autolockuseractivityservice/stub/src/autolockuseractivityservice_p.cpp
securitydialogs/AutolockSrv/bwins/autolockuseractivityserviceu.def
securitydialogs/AutolockSrv/eabi/autolockuseractivityserviceu.def
securitydialogs/AutolockSrv/iconnotifier.svg
securitydialogs/AutolockSrv/indicatorplugin/qmakepluginstubs/indicatortestplugin.qtplugin
securitydialogs/AutolockSrv/qtg_large_device_lock.svg
securitydialogs/AutolockSrv/resources/Keyguard_enabled_test.svg
securitydialogs/AutolockSrv/resources/iconnotifier.svg
securitydialogs/AutolockSrv/resources/qtg_large_device_lock.svg
securitydialogs/AutolockSrv/rom/AutolockSrv.iby
securitydialogs/AutolockSrv/service_conf.xml
securitydialogs/AutolockSrv/service_conf_new.xml
securitydialogs/AutolockSrv/service_conf_old_format.xml
securitydialogs/AutolockSrv/src/AutolockSrv.cpp
securitydialogs/AutolockSrv/src/AutolockSrv.h
securitydialogs/AutolockSrv/src/AutolockSrv.pri
securitydialogs/AutolockSrv/src/keycapturingapplication.cpp
securitydialogs/AutolockSrv/src/keycapturingapplication.h
securitydialogs/AutolockSrv/src/lockapp.hrh
securitydialogs/AutolockSrv/src/main.cpp
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/rom/GSSimSecPlugin.iby
securitydialogs/SecUi/rom/GSSimSecPluginResources.iby
securitydialogs/lockapp/cenrep/AutolockPrivateCRKeys.h
securitydialogs/lockapp/data/lockapp.rss
securitydialogs/lockapp/data/lockapp_reg.rss
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/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/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
--- a/boottimeintegritycheck/TrkDummy/group/TrkDummy.mmp	Thu Jun 17 12:11:51 2010 +0100
+++ b/boottimeintegritycheck/TrkDummy/group/TrkDummy.mmp	Thu Jul 22 16:43:28 2010 +0100
@@ -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 Jun 17 12:11:51 2010 +0100
+++ b/boottimeintegritycheck/TrkDummy/group/TrkDummy1.mmp	Thu Jul 22 16:43:28 2010 +0100
@@ -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 Jun 17 12:11:51 2010 +0100
+++ b/boottimeintegritycheck/TrkDummy/group/TrkDummy2.mmp	Thu Jul 22 16:43:28 2010 +0100
@@ -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
--- a/cpsecplugins/cpadvancedsecplugin/group/advancedsecplugin.pro	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/cpadvancedsecplugin/group/advancedsecplugin.pro	Thu Jul 22 16:43:28 2010 +0100
@@ -40,6 +40,7 @@
 	LIBS += -lcryptography
 	LIBS += -lDevTokenClient
 	LIBS += -lcrypto
+	LIBS += -lefsrv
 
 	PLUGIN_STUB_PATH = /resource/qt/plugins/controlpanel
 		
--- a/cpsecplugins/cpadvancedsecplugin/inc/cpcertpluginloader.h	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/cpadvancedsecplugin/inc/cpcertpluginloader.h	Thu Jul 22 16:43:28 2010 +0100
@@ -18,16 +18,16 @@
 #define	CPCERTPLUGINLOADER_H
 
 #include <qobject.h>
-#include <cppluginplatinterface.h>
+#include <cpplugininterface.h>
 #include <QTranslator>
-class CpCertPluginLoader : public QObject, public CpPluginPlatInterface
+class CpCertPluginLoader : public QObject, public CpPluginInterface
 {
     Q_OBJECT
-    Q_INTERFACES(CpPluginPlatInterface)
+    Q_INTERFACES(CpPluginInterface)
 public:
     CpCertPluginLoader();
     virtual ~CpCertPluginLoader();
-    virtual CpSettingFormItemData *createSettingFormItemData(CpItemDataHelper &itemDataHelper) const;
+      virtual QList<CpSettingFormItemData*>createSettingFormItemData(CpItemDataHelper &itemDataHelper) const;
 private:
 	  QTranslator* mTranslator;
 };
--- a/cpsecplugins/cpadvancedsecplugin/inc/cpcertview.h	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/cpadvancedsecplugin/inc/cpcertview.h	Thu Jul 22 16:43:28 2010 +0100
@@ -24,7 +24,9 @@
 class CpCertDataContainer;
 class CCTCertInfo;
 class HbListView;
-
+class HbAction;
+class HbDialog;
+class HbMessageBox;
 class CpCertView : public CpBaseSettingView
 	{
 	Q_OBJECT
@@ -61,11 +63,14 @@
 		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 deleteCerts( RArray<TInt>& indexList );
+		void deleteCertsL( RArray<TInt>& indexList );
 		void setDetails(CpCertView::TCertificateViews currentView);
 		void moveCertList( RArray<TInt>& indexList );
 
@@ -74,12 +79,18 @@
 		TInt mPos;
 		CpCertDataContainer* mCertDataContainer;
 		TBool mSelectAll;
+		RArray<TInt> mSelectionIndex;
+		RArray<TInt> mIndexList;
 		
+		HbDialog* mPopup;
 		HbView* mPrevView;
 		HbView* mCurrentView;
 		CpBaseSettingView* mRefreshedView;
-		HbListView* mListView;		
+		HbListView* mListView;	
+		HbListView* mSelectAllView;	
 		HbView* mOriginalView;
+		HbMessageBox* mNote;
+		HbMenu* mContextMenu;
 	};
 
 #endif /* CPCERTVIEW_H */
--- a/cpsecplugins/cpadvancedsecplugin/inc/cpmoduleview.h	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/cpadvancedsecplugin/inc/cpmoduleview.h	Thu Jul 22 16:43:28 2010 +0100
@@ -69,6 +69,7 @@
     CpSecModView::TSecModViews mCurrentView;
     CSecModUIModel& mSecModUIModel;
     TInt mPos;
+    HbMenu* mContextMenu;
 };
 
 #endif /* CPMODULEVIEW_H */
--- a/cpsecplugins/cpadvancedsecplugin/inc/cpsecurityview.h	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/cpadvancedsecplugin/inc/cpsecurityview.h	Thu Jul 22 16:43:28 2010 +0100
@@ -27,6 +27,7 @@
 class CSecModUIModel;
 class QModelIndex;
 class CpSecmoduleInfoView;
+class HbMessageBox;
 class CpSecurityView : public CpBaseSettingView
 {
     Q_OBJECT
@@ -45,7 +46,7 @@
     void deleteModule();
     void moduleDetails();
     void displayPreviousFromModInfo();
-    
+    void dialogClosed(HbAction* action);
 private:
     CSecModUIModel* mSecModUIModel;  
     CpSecModView* mSecModView;
@@ -54,6 +55,8 @@
 	CpSecmoduleInfoView* mModuleinfoView;
 	HbView* mCurrentView;
 	TInt mPos;
+	HbMessageBox* mNote;
+	HbMenu* mContextMenu;
 
 };
 
--- a/cpsecplugins/cpadvancedsecplugin/src/cpcertdatacontainer.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/cpadvancedsecplugin/src/cpcertdatacontainer.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -27,7 +27,7 @@
 #include <HbMessageBox>
 
 #include <QErrorMessage>
-
+#include <../../inc/cpsecplugins.h>
 #include "cpcertdatacontainer.h"
 #include "cpcertmanuisyncwrapper.h"
 
@@ -108,6 +108,7 @@
 // Releases Certificate entries.
 void CpCertManUICertData::Release()
     {
+    RDEBUG("0", 0);
     if ( iCAEntry )
         {
         iCAEntry->Release();
@@ -210,6 +211,7 @@
 //
 void CpCertDataContainer::ConstructL()
     {
+    RDEBUG("0", 0);
     // Ensure that file server session is succesfully created
     User::LeaveIfError( iRfs.Connect() );
 
@@ -272,6 +274,7 @@
 //
 void CpCertDataContainer::RefreshCAEntriesL()
     {
+    RDEBUG("0", 0);
     iFilter->SetOwnerType( ECACertificate );
     iCAEntries.Close();
     CUnifiedCertStore*& store = CertManager();
@@ -378,6 +381,7 @@
 //
 void CpCertDataContainer::RefreshPeerCertEntriesL()
     {
+    RDEBUG("0", 0);
     iFilter->SetOwnerType( EPeerCertificate );
     iPeerEntries.Close();
     CUnifiedCertStore*& store = CertManager();
@@ -458,6 +462,7 @@
 //
 void CpCertDataContainer::RefreshUserCertEntriesL()
     {
+    RDEBUG("0", 0);
     iFilter->SetOwnerType( EUserCertificate );
     iUserEntries.Close();
     CUnifiedCertStore*& store = CertManager();
@@ -594,6 +599,7 @@
 //
 void CpCertDataContainer::RefreshDeviceCertEntriesL()
     {
+    RDEBUG("0", 0);
     iFilter->SetOwnerType( EUserCertificate );
     iDeviceEntries.Close();
     CUnifiedCertStore*& store = CertManager();
--- a/cpsecplugins/cpadvancedsecplugin/src/cpcertdetailview.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/cpadvancedsecplugin/src/cpcertdetailview.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -14,7 +14,7 @@
 * Description:  
 *
 */
-#include <CCTCertInfo.h>
+#include <cctcertinfo.h>
 #include <x509cert.h>
 #include <unifiedcertstore.h>
 #include <X509CertNameParser.h>
@@ -35,9 +35,9 @@
 #include <hbdataformmodelitem.h>
 #include <hblabel.h>
 #include <hbpushbutton.h>
-#include <HbMenu.h>
+#include <hbmenu.h>
 #include <hbaction.h>
-#include <HbMessageBox.h>
+#include <hbmessagebox.h>
 #include <HbListWidget>
 #include <HbListWidgetItem>
 #include <HbGroupBox>
@@ -45,7 +45,7 @@
 #include <hbdataform.h>
 #include <hbdataformmodel.h>
 #include <hbdataformmodelitem.h>
-
+#include <../../inc/cpsecplugins.h>
 #include "cpcertdetailview.h"
 #include "cpcertview.h"
 #include "cpcertdatacontainer.h"
@@ -117,7 +117,7 @@
 
 void CpCertDetailView::viewCertificateDetailsL( TInt aIndex, CpCertView::TCertificateViews aType )
 	{
-	
+	RDEBUG("0", 0);
 	QGraphicsLinearLayout *layout = q_check_ptr(new QGraphicsLinearLayout(Qt::Vertical));	
 	setLayout(layout);
 	
@@ -151,7 +151,7 @@
         {
 		addLabel(*entry, *mCertDetails);
         }
-
+		RDEBUG("0", 0);
     // certificate issuer and owner
     if( certificateFormat == EX509Certificate )
         {
@@ -168,7 +168,7 @@
 		TKeyUsagePKCS15 usage = keyUsageAndLocationL( *entry, &keyLocation );
         addCertUsage(usage, *mCertDetails);		
         }
-
+		RDEBUG("0", 0);
     if( certificateFormat == EX509Certificate )
         {
 		addValidityPeriod( *details, *mCertDetails );                
@@ -205,7 +205,7 @@
         {
         // SetUrlCertAlgorihm()
         }
-
+		RDEBUG("0", 0);
     if( certificateFormat != EX509CertificateUrl )
         {
         CleanupStack::PopAndDestroy( details );
@@ -220,6 +220,7 @@
 
 const CCTCertInfo* CpCertDetailView::certInfo( TInt index, CpCertView::TCertificateViews certView )
 	{
+	RDEBUG("0", 0);
 	const CCTCertInfo* certinfo = NULL;
 	
 	if( certView == CpCertView::EAuthorityView )
@@ -243,6 +244,7 @@
 
 void CpCertDetailView::addTrustedSitesL( const CCertificate& certDetails, HbListWidget& certDisplayDetails )
 	{
+	RDEBUG("0", 0);
 	CTrustSitesStore* trustedSitesStore = CTrustSitesStore::NewL();
 	CleanupStack::PushL( trustedSitesStore );
 
@@ -271,6 +273,7 @@
 
 void CpCertDetailView::addLabel( const CCTCertInfo& aCertInfo, HbListWidget& certDisplayDetails )
 	{
+	RDEBUG("0", 0);
 	QString sLabel("Label:");
 	QString sLabelDetails = "(No label)"; 
 	if(aCertInfo.Label().Length()  != 0)
@@ -301,6 +304,7 @@
 void CpCertDetailView::addSubjectL( const CCertificate& aCertDetails, 
 									HbListWidget& certDisplayDetails )
 	{
+	RDEBUG("0", 0);
 	HBufC* subject = NULL;
 	X509CertNameParser::SubjectFullNameL( (CX509Certificate&)aCertDetails, subject );
 	CleanupStack::PushL( subject );
@@ -319,6 +323,7 @@
 
 void CpCertDetailView::addCertUsage( TKeyUsagePKCS15 usage, HbListWidget& certDisplayDetails )
 	{
+	RDEBUG("0", 0);
 	QString strUsage;
 	switch( usage )
 		{
@@ -341,6 +346,7 @@
 void CpCertDetailView::addValidityPeriod( 	const CCertificate& aCertDetails, 
 											HbListWidget& certDisplayDetails)
 	{
+	RDEBUG("0", 0);
 	// Certificate validity period
 	// Hometime's offset to UTC
 	TLocale locale;
@@ -375,6 +381,7 @@
 
 void CpCertDetailView::setURLLocation( HBufC8& urlDetails, HbListWidget& certDisplayDetails )
 	{
+	RDEBUG("0", 0);
 	TPtr8 urlPtr = urlDetails.Des();
 		
 	QString certUrl = "Location:"; 
@@ -389,6 +396,7 @@
 
 void CpCertDetailView::addCertFormat( TCertificateFormat aCertFormat, HbListWidget& certDisplayDetails )
 	{
+	RDEBUG("0", 0);
 	// certificate format
 	QString certFormat = "Certificate format:";
 	QString certFormatDetails = "(Not defined)";
@@ -402,6 +410,7 @@
 void CpCertDetailView::addAlgoDetails( 	const CCertificate& certificate, 
 										HbListWidget& certDisplayDetails )
 	{
+	RDEBUG("0", 0);
 	// certificate algorithms
 	QString sDgstAlgoDetails = "Unknown";
 	// digest algorithm
@@ -440,6 +449,7 @@
 void CpCertDetailView::addSerialNo( const CCertificate& certificate, 
 									HbListWidget& certDisplayDetails )
 	{
+	RDEBUG("0", 0);
 	// certificate serial number
 	QString sCertSerialNo("Serial number:");
 	QString sCertSerialNoDetails = 0;
@@ -457,37 +467,47 @@
 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;
-	QT_TRAP_THROWING(	 finalSha1 = HBufC::NewLC(100));
-	TPtr finalShaPtr = finalSha1->Des();
-	divideIntoBlocks( sha1_fingerprint, finalShaPtr );
-	QString sSha1Details = QString( (QChar*)finalShaPtr.Ptr(), finalShaPtr.Length() );
-	CleanupStack::PopAndDestroy(finalSha1);
+	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());
-	QT_TRAP_THROWING(CleanupStack::PushL( md5 ));
-	TBuf8<20> fingerprint = md5->Hash( certificate.Encoding() );
-	CleanupStack::PopAndDestroy( md5 );
-	HBufC* finalMd5 = NULL;
-	QT_TRAP_THROWING(	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);
+	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):"
         
@@ -574,6 +594,7 @@
 
 QString CpCertDetailView::asymmetricAlgoId( const CCertificate& certificate )
 	{
+	RDEBUG("0", 0);
 	QString sAsymmetricAlgoId = 0;
 	// public-key algorithm
 	TAlgorithmId algorithmId = certificate.SigningAlgorithm().AsymmetricAlgorithm().Algorithm();
@@ -625,7 +646,7 @@
 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
@@ -738,6 +759,7 @@
 
 CArrayFixFlat<TValidationError>* CpCertDetailView::validateX509CertificateL( const CX509Certificate& certDetails )
     {
+    RDEBUG("0", 0);
     TInt poppableItems = 0;
     CArrayFixFlat<TValidationError>* validationError =
         new ( ELeave ) CArrayFixFlat<TValidationError>( 1 );
@@ -774,7 +796,7 @@
                                                         TUid* keyLocation )
     {
     TKeyUsagePKCS15 keyUsage;
-
+		RDEBUG("0", 0);
     // Check whether we have key for this certificate
     RMPointerArray<CCTKeyInfo> keyEntry;
     TCTKeyAttributeFilter filter;
@@ -806,7 +828,7 @@
 //
 void CpCertDetailView::setLocationInfo(TBool certificate, TUid locUid, HbListWidget& certDisplayDetails)
     {
-    
+    RDEBUG("0", 0);
     QString locationDetails = "(Not defined)";
 
     switch ( locUid.iUid )
@@ -847,6 +869,7 @@
 //
 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++ )
--- a/cpsecplugins/cpadvancedsecplugin/src/cpcertmanuisyncwrapper.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/cpadvancedsecplugin/src/cpcertmanuisyncwrapper.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -23,7 +23,7 @@
 #include <mctwritablecertstore.h>
 #include <x509cert.h>
 #include <pkixcertchain.h>
-
+#include <../../inc/cpsecplugins.h>
 #include "cpcertmanuisyncwrapper.h"
 
 // CONSTANTS
@@ -42,7 +42,7 @@
     const CCertAttributeFilter& aFilter,
     const TUid aTokenUid )
     {
-    
+    RDEBUG("0", 0);
     if ( IsActive() )
         {
         // Wrapper is active. Don't go further
@@ -78,7 +78,7 @@
     RMPointerArray<CCTKeyInfo>* aArray,
     const TCTKeyAttributeFilter& aFilter )
     {
-    
+    RDEBUG("0", 0);
     if ( IsActive() )
         {
         // Wrapper is active. Don't go further
@@ -104,7 +104,7 @@
     TUid aTokenUid )
     {
     aCert = NULL;
-    
+    RDEBUG("0", 0);
     HBufC8* buf = HBufC8::NewLC( KMaxCertificateLength );
     iCertPtr.Set( buf->Des() );
 
@@ -156,7 +156,7 @@
 void CpCertManUISyncWrapper::DeleteCertL( CUnifiedCertStore*& aStore,
     const CCTCertInfo& aCertInfo )
     {
-    
+    RDEBUG("0", 0);
     aStore->Remove( aCertInfo, iStatus );
     iOperation = EOperationDelete;
     iStore = aStore;
@@ -174,7 +174,7 @@
     const CCTCertInfo& aCertInfo,
     TUid aTokenUid )
     {
-        
+    RDEBUG("0", 0);
     TInt count = aStore->WritableCertStoreCount();
     for (TInt i = 0; i < count; i++)
         {
@@ -256,7 +256,7 @@
 
 void CpCertManUISyncWrapper::RunL()
     {
-    
+    RDEBUG("0", 0);
     if ( iWait.IsStarted() )
         {
         iWait.AsyncStop();
@@ -271,6 +271,7 @@
 //
 void CpCertManUISyncWrapper::DoCancel()
     {
+    RDEBUG("iOperation", iOperation);
     switch ( iOperation )
         {
         case EOperationInit:
--- a/cpsecplugins/cpadvancedsecplugin/src/cpcertpluginloader.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/cpadvancedsecplugin/src/cpcertpluginloader.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -20,9 +20,11 @@
 #include "cpcertpluginloader.h"
 #include "cpsecurityview.h"
 #include <hbapplication.h>
+#include <../../inc/cpsecplugins.h>
 
 CpCertPluginLoader::CpCertPluginLoader()
 	{
+		RDEBUG("0", 0);
 		mTranslator =q_check_ptr( new QTranslator());
 		// to be uncommented after translation sumission.
 		//  QString lang = QLocale::system().name();
@@ -41,10 +43,11 @@
         }	
 	}
 
-CpSettingFormItemData *CpCertPluginLoader::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const
+QList<CpSettingFormItemData*> CpCertPluginLoader::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const
 		{
-		 return new CpSettingFormEntryItemDataImpl<CpSecurityView>(
-			itemDataHelper,tr("Advanced Security"), QString());    
+		RDEBUG("0", 0);
+  return QList<CpSettingFormItemData*>() 
+           << new CpSettingFormEntryItemDataImpl<CpSecurityView>(itemDataHelper,tr("Advanced Security"), QString());			
 		}
 
 Q_EXPORT_PLUGIN2(cpcertpluginloader, CpCertPluginLoader);
--- a/cpsecplugins/cpadvancedsecplugin/src/cpcerttrustview.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/cpadvancedsecplugin/src/cpcerttrustview.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -35,7 +35,7 @@
 #include <hblistwidget.h>
 
 #include <memory>
-
+#include <../../inc/cpsecplugins.h>
 #include "cpcerttrustview.h"
 #include "cpcertdatacontainer.h"
 #include "cpcertmanuisyncwrapper.h"
@@ -71,6 +71,7 @@
 
 void CpCertTrustView::viewTrustSettings()
 	{
+	RDEBUG("0", 0);
 	mTrustedClients << " \tWAP connection\t\t";
 	mTrustedClients << " \tMail and Image conn.\t\t";
 	mTrustedClients << " \tNative installing\t\t";
@@ -111,6 +112,7 @@
 //
 void CpCertTrustView::updateListBoxL()
     {
+    RDEBUG("0", 0);
     mClientUids.Reset();
 
     TInt clientCount = 0;
@@ -196,7 +198,7 @@
 	certLabel->setText(QString( (QChar*)label.Ptr(),label.Length() ) );
 	mCertLabelList->addItem(certLabel.get());
 	certLabel.release();
-	
+	RDEBUG("0", 0);
 	int count = mTrustedClients.size();
 	for( int index = 0 ;index < count; ++index)
 		{
@@ -226,6 +228,7 @@
 
 void CpCertTrustView::saveTrustSettings()
 	{
+	RDEBUG("0", 0);
 	CCTCertInfo& entry = *( mCertDataContainer.iCALabelEntries[ mCertificateIndex ]->iCAEntry );
 	if ( entry.IsDeletable() )
 		{
@@ -249,6 +252,7 @@
 
 TUid CpCertTrustView::trusterId(const QString& clientDescription) const
 	{
+	RDEBUG("0", 0);
 	TUid retValue = TUid::Uid(0);
 	if( clientDescription ==  " \tWAP connection\t\t" )
 		retValue = KCertManUIViewTrustWapConnectionId;
@@ -273,6 +277,7 @@
 //
 TInt CpCertTrustView::trustIdIndex( TUid trustUid ) const
     {
+    RDEBUG("0", 0);
     TInt resIndex = KErrNotFound;
     
     if ( trustUid == KCertManUIViewTrustApplicationControllerId )
@@ -322,6 +327,7 @@
 TBool CpCertTrustView::checkCertificateClientTrustL(
     const TUid clientUid, const CCTCertInfo& entry ) const
     {
+    RDEBUG("0", 0);
     TBool trustSettingTrusted = EFalse;
     TCertificateFormat format = entry.CertificateFormat();
 
--- a/cpsecplugins/cpadvancedsecplugin/src/cpcertview.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/cpadvancedsecplugin/src/cpcertview.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -25,7 +25,7 @@
 #include <hbdataformmodelitem.h>
 #include <hblabel.h>
 #include <hbpushbutton.h>
-#include <HbMenu.h>
+#include <hbmenu.h>
 #include <hbaction.h>
 #include <HbListWidget>
 #include <HbListWidgetItem>
@@ -37,12 +37,12 @@
 #include <hbabstractviewitem.h>
 #include <hbtextitem.h>
 #include <hbmainwindow.h>
-#include <HbListView.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"
@@ -52,13 +52,16 @@
 
 CpCertView::CpCertView(const QModelIndex& modelIndex, QGraphicsItem *parent /*= 0*/)
 	: CpBaseSettingView(0,parent),
+	  mPopup(NULL),
 	  mPrevView(NULL),
 	  mCurrentView(NULL),
 	  mRefreshedView(NULL),
 	  mListView(NULL),
-	  mOriginalView(NULL)
+	  mSelectAllView(NULL),
+	  mOriginalView(NULL),
+	  mNote(NULL)
 	{
-	
+	RDEBUG("0", 0);
 	mOriginalView = mainWindow()->currentView();
 	
 	HbMenu* menu = this->menu();   
@@ -86,11 +89,15 @@
 		{
 		title = "Move to Personal";  
 		}
-	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();
-			
+	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
@@ -103,7 +110,7 @@
 		HbMessageBox::information(exception.what());
 		throw(exception);
 		}
-	
+	RDEBUG("0", 0);
 	for(int index = 0; index< count; index++)
 		{
 		QString certificateLabel = certLabel(index);
@@ -119,13 +126,18 @@
 	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();
@@ -146,10 +158,29 @@
 		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:
@@ -176,12 +207,13 @@
 
 void CpCertView::indicateLongPress(HbAbstractViewItem *item,QPointF coords)
 	{
-	std::auto_ptr<HbMenu> contextMenu(q_check_ptr(new HbMenu()));
+	RDEBUG("0", 0);
 	mPos = item->modelIndex().row();   // Pos will tell you what is the certificate clicked in particular view.
 	
-	std::auto_ptr<HbAction> open(q_check_ptr(new HbAction(hbTrId("txt_common_menu_open"))));     
-	connect(open.get(), SIGNAL(triggered()), this, SLOT( openCertificate()));    
-	contextMenu->addAction(open.get());			
+	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;
@@ -190,7 +222,7 @@
 		{
 		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()));    
-		contextMenu->addAction(trustSettings.get());
+		mContextMenu->addAction(trustSettings.get());
 		trustSettings.release();
 		}
 	else if(mCertView == EPersonalView)
@@ -201,31 +233,38 @@
 		{
 		moveTitle = hbTrId("txt_certificate_manager_menu_move_to_personal_cert");
 		}	
-	std::auto_ptr<HbAction> moveCert(q_check_ptr(new HbAction(moveTitle)));     
-	connect(moveCert.get(), SIGNAL(triggered()), this, SLOT(moveSelectedCert()));    
-	contextMenu->addAction(moveCert.get());
-	moveCert.release();
-			
+	
+	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()));    
-		contextMenu->addAction(menuDelete.get());
+		mContextMenu->addAction(menuDelete.get());
 		menuDelete.release();
 		}
-	contextMenu->open();
-	contextMenu->setPreferredPos(coords);
+	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();   
@@ -235,6 +274,7 @@
 	
 void CpCertView::displayPreviousView()  
 	{
+	RDEBUG("0", 0);
 	mainWindow()->removeView(mCurrentView);    
 	mCurrentView->deleteLater();
 	mCurrentView= NULL;
@@ -243,22 +283,23 @@
 	
 void CpCertView::deleteCertificate()
 	{
+	RDEBUG("0", 0);
 	RArray<TInt> pos;
 	pos.Append(mPos);
-	QT_TRAP_THROWING(deleteCerts(pos));
+	QT_TRAP_THROWING(deleteCertsL(pos));
 	}		
 	
 void CpCertView::deleteList()
 	{
+	RDEBUG("0", 0);
 	mSelectAll = EFalse;
-	HbDialog popup;
-	popup.setDismissPolicy(HbDialog::NoDismiss);
+	mPopup->setDismissPolicy(HbDialog::NoDismiss);
 	// Set the label as heading widget
-	popup.setHeadingWidget(q_check_ptr(new HbLabel(hbTrId("txt_certificate_manager_setlabel_certificates"))));
+	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)));
 		
-	HbListView* selectAllView = q_check_ptr(new HbListView(this));
+	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()));
@@ -266,10 +307,10 @@
 	selectAllModel->appendRow(selectAllItem.get());
 	selectAllItem.release();
 	
-	connect(selectAllView, SIGNAL(activated(QModelIndex)), this, SLOT(selectAll()));
-	selectAllView->setModel(selectAllModel);
-	selectAllView->setSelectionMode(HbListView::MultiSelection);
-	layout->addItem(selectAllView);
+	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
@@ -279,9 +320,7 @@
 	QStandardItemModel* model = q_check_ptr(new QStandardItemModel(this));
 	TInt count=0;
 	QT_TRAP_THROWING( count = refreshListL());
-	RArray<TInt> selectionIndex;
-	QT_TRAP_THROWING(CleanupClosePushL(selectionIndex));
-	
+	RDEBUG("0", 0);
 	for(TInt index = 0; index < count ; ++index)
 		{
 		const CCTCertInfo* cert = certAt(index);
@@ -292,7 +331,7 @@
 			QString certificateLabel = certLabel(index);
 			certItem->setData( certificateLabel, Qt::DisplayRole);
 			model->appendRow(certItem.get());
-			selectionIndex.Append(index);
+			mSelectionIndex.Append(index);
 			certItem.release();
 			}
 		}	
@@ -304,16 +343,22 @@
 	std::auto_ptr<HbWidget> widget( q_check_ptr(new HbWidget()));
 	widget->setLayout(layout.get());
 	layout.release();
-	popup.setContentWidget(widget.get());
+	mPopup->setContentWidget(widget.get());
 	widget.release();
 	
-	popup.setPrimaryAction(q_check_ptr(new HbAction(hbTrId("txt_common_opt_delete"))));
-	popup.setSecondaryAction(q_check_ptr(new HbAction(hbTrId("txt_common_button_cancel"))));
-	popup.setTimeout(HbPopup::NoTimeout);
-	
+	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
-	HbAction* result = popup.exec();		
-	if(result == popup.primaryAction())
+	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();
@@ -321,50 +366,53 @@
 		// 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( selectionIndex[selectedItemIndex] );
-			}
-		deleteCerts(actualIndex);
-		 CleanupStack::PopAndDestroy(&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
 		}
-	CleanupStack::PopAndDestroy(&selectionIndex);
+	RDEBUG("0", 0);
 	mListView->deleteLater();
 	mListView = NULL;
-	selectAllView->deleteLater();
-	selectAllView = NULL;
+	mSelectAllView->deleteLater();
+	mSelectAllView = NULL; 
 	}
 
 void CpCertView::moveCert()
 	{
+	RDEBUG("0", 0);
 	mSelectAll = EFalse;
-	HbDialog popup;
-	popup.setDismissPolicy(HbDialog::NoDismiss);
+	mPopup->setDismissPolicy(HbDialog::NoDismiss);
 	// Set the label as heading widget
 	if(mCertView == EPersonalView)
 		{
-		popup.setHeadingWidget(q_check_ptr(new HbLabel(tr("Move To Device"))));
+		mPopup->setHeadingWidget(q_check_ptr(new HbLabel(tr("Move To Device"))));
 		}
 	else if(mCertView == EDeviceView)
 		{
-		popup.setHeadingWidget(q_check_ptr(new HbLabel(tr("Move To Personal"))));
+		mPopup->setHeadingWidget(q_check_ptr(new HbLabel(tr("Move To Personal"))));
 		}
 		
 	std::auto_ptr<QGraphicsLinearLayout> layout(q_check_ptr(new QGraphicsLinearLayout(Qt::Vertical)));
 			
-	HbListView* selectAllView = q_check_ptr(new HbListView(this));
+	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(selectAllView, SIGNAL(activated(QModelIndex)), this, SLOT(selectAll()));
-	selectAllView->setModel(selectAllModel);
-	selectAllView->setSelectionMode(HbListView::MultiSelection);
-	layout->addItem(selectAllView);
+	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
@@ -373,9 +421,8 @@
 	// Create a model
 	QStandardItemModel* model = q_check_ptr(new QStandardItemModel(this));
 	TInt count =0;
+	RDEBUG("0", 0);
 	QT_TRAP_THROWING(count = refreshListL());
-	RArray<TInt> selectionIndex;
-	QT_TRAP_THROWING(CleanupClosePushL(selectionIndex));
 	for(TInt index = 0; index < count ; ++index)
 		{
 		// Populate the model with content
@@ -383,7 +430,7 @@
 		QString certificateLabel = certLabel(index);
 		certItem->setData( certificateLabel, Qt::DisplayRole);
 		model->appendRow(certItem.get());
-		selectionIndex.Append(index);
+		mSelectionIndex.Append(index);
 		certItem.release();
 		}	
 	
@@ -395,16 +442,22 @@
 	std::auto_ptr<HbWidget> widget(q_check_ptr(new HbWidget()));
 	widget->setLayout(layout.get());	
 	layout.release();
-	popup.setContentWidget(widget.get());
+	mPopup->setContentWidget(widget.get());
 	widget.release();
-	
-	popup.setPrimaryAction(q_check_ptr(new HbAction(tr("Yes"),&popup)));
-	popup.setSecondaryAction(q_check_ptr(new HbAction(tr("No"),&popup)));
-	popup.setTimeout(HbPopup::NoTimeout);
+	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
-	HbAction* result = popup.exec();		
-	if(result == popup.primaryAction())
+	 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();
@@ -412,24 +465,29 @@
 		// 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(selectionIndex[selectedItemIndex]);	 
-			 }
-		 moveCertList(actualIndex);
-		 CleanupStack::PopAndDestroy(&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);
+			 )
 		}
-	CleanupStack::PopAndDestroy(&selectionIndex); 
 	mListView->deleteLater();
 	mListView = NULL;	
-	selectAllView->deleteLater();
-	selectAllView = NULL;
+	mSelectAllView->deleteLater();
+	mSelectAllView = NULL;
+	RDEBUG("0", 0);
 	}
 
 void CpCertView::selectAll()
 	{
+	RDEBUG("0", 0);
 	if(mSelectAll == EFalse)
 		{
 		mListView->selectAll();
@@ -442,11 +500,16 @@
 		}
 	}
 
-void CpCertView::deleteCerts( RArray<TInt>& indexList )
+void CpCertView::deleteCertsL( RArray<TInt>& indexList )
     {
-	TInt count = indexList.Count();
-	    
-	HbMessageBox note(HbMessageBox::MessageTypeQuestion);
+    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)
@@ -460,65 +523,76 @@
 		deleteMsg = "Delete %1 items?";
 		sCount.setNum(count);
 		}
-	
+	RDEBUG("0", 0);
 	deleteMsg = deleteMsg.arg(sCount);
-	note.setText(deleteMsg);
-	note.setPrimaryAction(q_check_ptr(new HbAction("Yes")));
-	note.setSecondaryAction(q_check_ptr(new HbAction("No")));
-	note.setTimeout(HbPopup::NoTimeout);
-	HbAction* result = note.exec();
+	mNote->setText(deleteMsg);
+	mNote->setTimeout(HbPopup::NoTimeout);
+	mNote->open(this,SLOT(handleDeleteDialog(HbAction*)));
+
+}
 
-	if (result != note.primaryAction() || count == 0 )
+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));
+    QT_TRAP_THROWING(
+    		CleanupClosePushL(errCerts);
     
-    for(TInt index = 0; index < count; ++index)
-    	{
-		const CCTCertInfo* entry = certAt(indexList[index]);
-		
-		if( mCertView == EPersonalView || mCertView == EAuthorityView )
-			{
-			QT_TRAP_THROWING( mCertDataContainer->iWrapper->DeleteCertL( 
-						mCertDataContainer->CertManager(), *entry ));
-			}
-		else if( mCertView == ETrustedView )
-			{
-			QT_TRAP_THROWING( mCertDataContainer->iWrapper->DeleteCertL( 
-						mCertDataContainer->CertManager(),*entry, KCMTrustedServerTokenUid ));
-			}
-		else if( mCertView == EDeviceView )
+		for(TInt index = 0; index < count; ++index)
 			{
-			QT_TRAP_THROWING( mCertDataContainer->iWrapper->DeleteCertL(
-						mCertDataContainer->CertManager(), *entry, KCMDeviceCertStoreTokenUid ));
-			}	
-		QT_TRAP_THROWING( errCerts.AppendL(entry));
-    	}
-    
-    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 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)
 			{
-			const TDesC& certLabel = errCerts[index]->Label();
-			QString certName = QString((QChar*)certLabel.Ptr(),certLabel.Length());
-			message.append(certName).append("\n");
+			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);
 			}
-		HbMessageBox::warning(message);
-    	}
-    QT_TRAP_THROWING( count = refreshListL());
-	refreshView(count);
-	
-	CleanupStack::PopAndDestroy(&errCerts);
-	
+		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)
 		{
@@ -548,6 +622,7 @@
 
 QString CpCertView::certLabel(TInt index) const
 	{
+	RDEBUG("0", 0);
 	CpCertManUICertData* certData = NULL;
 	HBufC* label = NULL;
 	TInt length = 0;
@@ -587,6 +662,7 @@
 
 TInt CpCertView::refreshListL()
 	{
+	RDEBUG("0", 0);
 	TInt count = 0;
 	switch(mCertView)
 		{
@@ -613,6 +689,7 @@
 
 void CpCertView::refreshView( TInt count )
 	{
+	RDEBUG("0", 0);
 	if(mRefreshedView)
 		{
 		mRefreshedView->deleteLater();
@@ -645,7 +722,7 @@
 		}	
 	
 	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());
@@ -664,7 +741,7 @@
 	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)); 
@@ -682,7 +759,7 @@
 	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();   
@@ -690,11 +767,13 @@
 	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;
@@ -702,6 +781,7 @@
 	}
 void CpCertView::showTrustSettings()
 	{
+	RDEBUG("0", 0);
 	mCurrentView = q_check_ptr(new CpCertTrustView(mPos, *mCertDataContainer));    
 	connect(mCurrentView , SIGNAL(aboutToClose()), this, SLOT(saveTrustSettings()));
 	mPrevView = mainWindow()->currentView();   
@@ -717,6 +797,7 @@
 
 void CpCertView::moveSelectedCert()
 	{
+	RDEBUG("0", 0);
 	RArray<TInt> pos;
 	pos.Append(mPos);
 	moveCertList(pos);
@@ -724,47 +805,52 @@
 
 void CpCertView::moveCertList(RArray<TInt>& indexList)
 	{
-	HbMessageBox note(HbMessageBox::MessageTypeQuestion);
-	note.setHeadingWidget(q_check_ptr(new HbLabel(hbTrId("txt_certificate_manager_info_move"))));
+	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 )
 		{
-		note.setText(hbTrId("txt_certificate_manager_info_device_certificates_c"));
+		mNote->setText(hbTrId("txt_certificate_manager_info_device_certificates_c"));
 		}
 	else if( mCertView == EDeviceView )
 		{
-		note.setText("Use of Personal certificates may require user confirmation. Proceed?");
+		mNote->setText("Use of Personal certificates may require user confirmation. Proceed?");
 		}
 	
-	note.setPrimaryAction(q_check_ptr(new HbAction("Yes")));
-	note.setSecondaryAction(q_check_ptr(new HbAction("No")));
-	note.setTimeout(HbPopup::NoTimeout);
-	note.setIconVisible (EFalse);
-	HbAction* result = note.exec();
+	mNote->setTimeout(HbPopup::NoTimeout);
+	mNote->setIconVisible (EFalse);
+	mNote->open(this,SLOT(handleMoveDialog(HbAction*)));
+	RDEBUG("0", 0);
+}
 
-	if (result != note.primaryAction())
+void CpCertView::handleMoveDialog(HbAction* action)
+{
+	RDEBUG("0", 0);
+	if (action != mNote->primaryAction())
 	    {
 		return;
 	    }
 	
-	TInt count = indexList.Count();
+	TInt count = mIndexList.Count();
 	
 	for(TInt index = 0 ; index < count; ++index)
 		{
 		CCTCertInfo* entry = NULL;
 		if(mCertView == EPersonalView)
 			{
-			entry = mCertDataContainer->iUserLabelEntries[ indexList[index] ]->iUserEntry;
+			entry = mCertDataContainer->iUserLabelEntries[ mIndexList[index] ]->iUserEntry;
 			}
 		else if(mCertView == EDeviceView)
 			{
-			entry = mCertDataContainer->iDeviceLabelEntries[ indexList[index] ]->iDeviceEntry;
+			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);
@@ -784,6 +870,7 @@
 			sourceCertStoreUid = KCMDeviceCertStoreTokenUid;
 			targetCertStoreUid = KCMFileCertStoreTokenUid;
 			}
+		RDEBUG("0", 0);
 		try
 			{
 			
@@ -801,7 +888,7 @@
 			QT_TRAP_THROWING(mCertDataContainer->ShowErrorNoteL( error.toInt() ));
 			User::Exit( KErrNone );
 			}
-		
+		RDEBUG("0", 0);
 		try
 			{
 			if(mCertView == EPersonalView)
@@ -828,5 +915,8 @@
 		} // for
 	// Refresh current view
 	QT_TRAP_THROWING(refreshView(refreshListL()));	
+	delete mNote;
+	mNote = NULL;
+	RDEBUG("0", 0);
 	}
 
--- a/cpsecplugins/cpadvancedsecplugin/src/cpmoduleview.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/cpadvancedsecplugin/src/cpmoduleview.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -29,7 +29,7 @@
 #include <hbpushbutton.h>
 #include <hbmenu.h>
 #include <hbaction.h>
-#include <hbmessageBox.h>
+#include <hbmessagebox.h>
 #include <hblistwidget.h>
 #include <hblistwidgetitem.h>
 #include <hbgroupbox.h>
@@ -41,7 +41,7 @@
 #include <hbabstractviewitem.h>
 
 #include <memory>
-
+#include <../../inc/cpsecplugins.h>
 #include "cpmoduleview.h"
 #include "cpsecmodmodel.h"
 #include "cpsecmodview.h"
@@ -53,9 +53,12 @@
   mCurrentView(currentView),
   mSecModUIModel(secModUIModel)
 	{
+	RDEBUG("0", 0);
 	QString title = mSecModUIModel.TokenLabelForTitle();
 	setTitle(title);
 	
+	mContextMenu = (q_check_ptr(new HbMenu()));
+	
 	if(currentView == CpSecModView::EAccessView)
 		{	
 		showAccessView();
@@ -71,6 +74,7 @@
 
 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()));    
@@ -95,7 +99,7 @@
 		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()));
@@ -122,7 +126,7 @@
 		}	
 	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());
@@ -142,10 +146,12 @@
 	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()));
@@ -158,8 +164,7 @@
 		
 	while(authDetailsIter.hasNext())
 		{
-		authDetailsIter.next();
-		QPair<QString, TUint32> pair;
+		QPair<QString, TUint32> pair = authDetailsIter.next();
 		QString label = pair.first;
 		TUint32 status = pair.second;
 		QString blockedDetails = NULL;
@@ -176,7 +181,7 @@
 				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());
@@ -212,13 +217,15 @@
 	form.release();
 	setLayout(layout.get());
 	layout.release();
+	RDEBUG("0", 0);
 	}
 
 void CpModuleView::indicateLongPress(HbAbstractViewItem *item,QPointF coords)
 	{
+	RDEBUG("0", 0);
 	try
 		{
-		std::auto_ptr<HbMenu> contextMenu(q_check_ptr(new HbMenu()));
+		mContextMenu->clearActions();
 		mPos = item->modelIndex().row();   
 		
 		if(mCurrentView == CpSecModView::EAccessView)
@@ -229,21 +236,21 @@
 				{
 				std::auto_ptr<HbAction> changePIN(q_check_ptr(new HbAction("Change")));     
 				connect(changePIN.get(), SIGNAL(triggered()), this, SLOT( handleAccessView()));    
-				contextMenu->addAction(changePIN.get());
+				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()));    
-				contextMenu->addAction(unblockPIN.get());
+				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()));    
-				contextMenu->addAction(closePIN.get());
+				mContextMenu->addAction(closePIN.get());
 				closePIN.release();
 				}
 			}
@@ -253,29 +260,31 @@
 				{
 				std::auto_ptr<HbAction> changePIN(q_check_ptr(new HbAction("Change")));     
 				connect(changePIN.get(), SIGNAL(triggered()), this, SLOT( handleSigViewCommand()));    
-				contextMenu->addAction(changePIN.get());
+				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()));    
-				contextMenu->addAction(unblockPIN.get());
+				mContextMenu->addAction(unblockPIN.get());
 				unblockPIN.release();
 				}
 			}
 				
-		contextMenu->open();
-		contextMenu->setPreferredPos(coords);
+		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();
@@ -289,6 +298,7 @@
 
 void CpModuleView::handleAccessView()
 	{
+	RDEBUG("0", 0);
 	try
 		{
 		if(mPos == EIndexCodeLabel)
@@ -316,6 +326,7 @@
 
 void CpModuleView::handleSigView()
 	{
+	RDEBUG("0", 0);
 	try
 		{
 		QT_TRAP_THROWING(mSecModUIModel.ChangeOrUnblockPinL(KPinNrSettIndex));
@@ -329,6 +340,7 @@
 
 void CpModuleView::handleSigViewCommand()
 	{
+	RDEBUG("0", 0);
 	try
 		{
 		switch(mPos)
--- a/cpsecplugins/cpadvancedsecplugin/src/cpsecmodmodel.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/cpadvancedsecplugin/src/cpsecmodmodel.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -27,7 +27,7 @@
 #include <qstring.h>
 
 #include <hbmessagebox.h>
-
+#include <../../inc/cpsecplugins.h>
 #include "cpsecmodmodel.h"
 #include "cpsecmodsyncwrapper.h"
 
@@ -47,6 +47,7 @@
 //
 CSecModUIModel* CSecModUIModel::NewL()
     {
+    RDEBUG("0", 0);
     CSecModUIModel* self = new( ELeave ) CSecModUIModel();
     CleanupStack::PushL( self );
     self->ConstructL();
@@ -93,6 +94,7 @@
 //
 void CSecModUIModel::ResetAndDestroyAOs()
     {
+    RDEBUG("0", 0);
     if (iAOList)
         {
         iAOList->Release();
@@ -125,6 +127,7 @@
 //
 void CSecModUIModel::InitializeKeyStoreL()
     {
+    RDEBUG("0", 0);
     ResetAndDestroyCTObjects();
     
     // Ensure that file server session is succesfully created
@@ -184,7 +187,7 @@
 //
 QMap<QString,QString> CSecModUIModel::LoadTokenLabelsL()
     {
-	
+		RDEBUG("0", 0);
     TInt keyStoreCount = iAOKeyStores.Count();
     QMap<QString, QString> labelList;
     
@@ -222,6 +225,7 @@
 //
 QString CSecModUIModel::Location( TUid aUid ) const
     {
+    RDEBUG("0", 0);
     QString location = 0;
 
     switch ( aUid.iUid )
@@ -252,7 +256,7 @@
 void CSecModUIModel::ShowErrorNote(TInt aError) const
     {
 	QString sError;
-
+		RDEBUG("aError", aError);
     switch (aError)
         {
         case KErrCancel:
@@ -292,6 +296,7 @@
 //
 void CSecModUIModel::OpenTokenL(TInt aTokenIndex)
     {
+    RDEBUG("0", 0);
     ResetAndDestroyAOs();
     iKeyStore = iAOKeyStores[aTokenIndex];
     }
@@ -316,6 +321,7 @@
 //
 void CSecModUIModel::InitAuthObjectsL()
     {
+    RDEBUG("0", 0);
     TInt err = KErrNone;
     // Symbian's file key store does not support
     // MCTAuthenticationObjectList interface, so we need to use
@@ -369,6 +375,7 @@
 //
 void CSecModUIModel::ListAuthObjectsL()
     {
+    RDEBUG("0", 0);
     if (0 >= iAOArray.Count())
         {
         __ASSERT_ALWAYS(iAOList, Panic(EPanicNullPointer));
@@ -420,6 +427,7 @@
 //
 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();
@@ -486,6 +494,7 @@
 //
 void CSecModUIModel::ChangeOrUnblockPinL(TInt aIndex)
     {
+    RDEBUG("0", 0);
     __ASSERT_ALWAYS(aIndex < iAOArray.Count(), Panic(EPanicIndexOutOfRange));
     TUint32 status = iAOArray[aIndex]->Status();
 
@@ -531,6 +540,7 @@
 //
 void CSecModUIModel::ChangePinL(TInt aIndex)
     {
+    RDEBUG("0", 0);
     __ASSERT_ALWAYS(aIndex < iAOArray.Count(), Panic(EPanicIndexOutOfRange));
     TInt err = KErrNone;
   
@@ -596,6 +606,7 @@
 //
 void CSecModUIModel::DeleteKeysL(TInt aTokenIndex)
     {
+    RDEBUG("0", 0);
     __ASSERT_ALWAYS(aTokenIndex < iAOKeyStores.Count(), Panic(EPanicIndexOutOfRange));
     RMPointerArray<CCTKeyInfo> keyInfos;
 	CleanupClosePushL(keyInfos);
@@ -647,6 +658,7 @@
 //
 QVector< QPair<QString,QString> > CSecModUIModel::GetSecModDetailsL()
     {
+    RDEBUG("0", 0);
     MCTToken& token = iKeyStore->Token();
     QVector< QPair<QString,QString> > securityModDetails;
     
@@ -723,6 +735,7 @@
 									const TDesC& aValue, 
 									QString aNullDescription)
 	{
+	RDEBUG("0", 0);
 	if( aValue.Length() == 0 )
 		{
 		aSecModDetails.append(QPair<QString,QString>(aLabel, aNullDescription));
@@ -785,6 +798,7 @@
 //
 void CSecModUIModel::ChangePinNrL(TInt aIndex)
     {
+    RDEBUG("0", 0);
     ChangePinL(aIndex+1);
     }
 
@@ -826,6 +840,7 @@
 //
 TBool CSecModUIModel::PinChangeable(TInt aIndex) const
     {
+    RDEBUG("0", 0);
     __ASSERT_ALWAYS(aIndex < iAOArray.Count(), Panic(EPanicIndexOutOfRange));
     TUint32 status = iAOArray[aIndex]->Status();
     TBool ret = ETrue;
@@ -875,6 +890,7 @@
 //
 TBool CSecModUIModel::PinRequestChangeable(TInt aIndex) const
     {
+    RDEBUG("0", 0);
     __ASSERT_ALWAYS(aIndex < iAOArray.Count(), Panic(EPanicIndexOutOfRange));
     TUint32 status = iAOArray[aIndex]->Status();
     TBool ret = EFalse;
--- a/cpsecplugins/cpadvancedsecplugin/src/cpsecmodsyncwrapper.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/cpadvancedsecplugin/src/cpsecmodsyncwrapper.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -26,7 +26,7 @@
 #include <mctauthobject.h>
 #include <unifiedkeystore.h>
 #include <mctkeystore.h>
-
+#include <../../inc/cpsecplugins.h>
 
 
 // ============================ MEMBER FUNCTIONS ===============================
@@ -62,6 +62,7 @@
 //
 CSecModUISyncWrapper* CSecModUISyncWrapper::NewL()
     {
+    RDEBUG("0", 0);
     CSecModUISyncWrapper* wrap = CSecModUISyncWrapper::NewLC();
     CleanupStack::Pop(wrap);
     return wrap;
@@ -102,6 +103,7 @@
 TInt CSecModUISyncWrapper::GetAuthObjectInterface(
     MCTToken& aToken, MCTTokenInterface*& aTokenInterface)
     {
+    RDEBUG("0", 0);
     if( !IsActive() && !iWait.IsStarted() )
         {
         iOperation = EOperationGetAOInterface;
@@ -148,6 +150,7 @@
     RMPointerArray<CCTKeyInfo>& aKeysInfos,
     const TCTKeyAttributeFilter& aFilter)
     {
+    RDEBUG("0", 0);
     if( !IsActive() && !iWait.IsStarted() )
         {
         iOperation = EOperationListKeys;
@@ -169,6 +172,7 @@
     CUnifiedKeyStore& aKeyStore,
     TCTTokenObjectHandle aHandle)
     {
+    RDEBUG("0", 0);
     if( !IsActive() && !iWait.IsStarted() )
         {
         iOperation = EOperationDelKey;
@@ -189,6 +193,7 @@
 TInt CSecModUISyncWrapper::ChangeReferenceData(
     MCTAuthenticationObject& aAuthObject)
     {
+    RDEBUG("0", 0);
     if( !IsActive() && !iWait.IsStarted() )
         {
         iOperation = EOperationChangeReferenceData;
@@ -209,6 +214,7 @@
 TInt CSecModUISyncWrapper::UnblockAuthObject(
     MCTAuthenticationObject& aAuthObject)
     {
+    RDEBUG("0", 0);
     if( !IsActive() && !iWait.IsStarted() )
         {
         iOperation = EOperationUnblockAO;
@@ -229,6 +235,7 @@
 TInt CSecModUISyncWrapper::EnableAuthObject(
     MCTAuthenticationObject& aAuthObject)
     {
+    RDEBUG("0", 0);
     if( !IsActive() && !iWait.IsStarted() )
         {
         iOperation = EOperationEnableAO;
@@ -291,6 +298,7 @@
     MCTAuthenticationObject& aAuthObject,
     TInt& aStime )
     {
+    RDEBUG("0", 0);
     if( !IsActive() && !iWait.IsStarted() )
         {
         iOperation = EOperationTimeRemAO;
@@ -311,6 +319,7 @@
 //
 void CSecModUISyncWrapper::DoCancel()
     {
+    RDEBUG("iOperation", iOperation);
     switch ( iOperation )
         {
         case EOperationInit:
--- a/cpsecplugins/cpadvancedsecplugin/src/cpsecmoduleinfoview.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/cpadvancedsecplugin/src/cpsecmoduleinfoview.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -26,9 +26,9 @@
 #include <hbdataformmodelitem.h>
 #include <hblabel.h>
 #include <hbpushbutton.h>
-#include <HbMenu.h>
+#include <hbmenu.h>
 #include <hbaction.h>
-#include <HbMessageBox.h>
+#include <hbmessagebox.h>
 #include <HbListWidget>
 #include <HbListWidgetItem>
 #include <HbGroupBox>
@@ -39,18 +39,19 @@
 #include <hbabstractviewitem.h>
 #include <hbtextitem.h>
 #include <hbmainwindow.h>
-#include <HbListView.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)));
@@ -75,6 +76,7 @@
 	layout->addItem(listSecurityDetails);		
 	setLayout(layout.get());
 	layout.release();
+	RDEBUG("0", 0);
 	}	
 
 CpSecmoduleInfoView::~CpSecmoduleInfoView()
--- a/cpsecplugins/cpadvancedsecplugin/src/cpsecmodview.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/cpadvancedsecplugin/src/cpsecmodview.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -29,7 +29,7 @@
 #include <hbpushbutton.h>
 #include <hbmenu.h>
 #include <hbaction.h>
-#include <hbmessageBox.h>
+#include <hbmessagebox.h>
 #include <hblistwidget.h>
 #include <hblistwidgetitem.h>
 #include <hbgroupbox.h>
@@ -42,7 +42,7 @@
 #include <HbMessageBox>
 
 #include <memory>
-
+#include <../../inc/cpsecplugins.h>
 #include "cpsecmodview.h"
 #include "cpsecmodmodel.h"
 #include "cpmoduleview.h"
@@ -55,6 +55,7 @@
   mAccessView(NULL),
   mPrevView(NULL)
 	{
+	RDEBUG("0", 0);
 	try
 	{
 	QT_TRAP_THROWING(mSecModUIModel.OpenTokenL(mPos));
@@ -72,7 +73,7 @@
 	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()));
@@ -112,6 +113,7 @@
 
 void CpSecModView::showNextView( const QModelIndex& modelIndex )
 	{
+	RDEBUG("0", 0);
 	try
 		{
 		mAccessView = q_check_ptr(new CpModuleView((TSecModViews)modelIndex.row(),mSecModUIModel));
@@ -128,6 +130,7 @@
 
 void CpSecModView::displayPrevious()
 	{
+	RDEBUG("0", 0);
 	try
 		{
 		mainWindow()->removeView(mAccessView);
--- a/cpsecplugins/cpadvancedsecplugin/src/cpsecurityview.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/cpadvancedsecplugin/src/cpsecurityview.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -28,9 +28,9 @@
 #include <hbdataformmodelitem.h>
 #include <hblabel.h>
 #include <hbpushbutton.h>
-#include <HbMenu.h>
+#include <hbmenu.h>
 #include <hbaction.h>
-#include <HbMessageBox.h>
+#include <hbmessagebox.h>
 #include <HbListWidget>
 #include <HbListWidgetItem>
 #include <HbGroupBox>
@@ -41,6 +41,8 @@
 
 #include <memory>
 
+#include <../../inc/cpsecplugins.h>
+
 #include "cpsecurityview.h"
 #include "cpsecmodview.h"
 #include "cpcertview.h"
@@ -54,8 +56,10 @@
 	  mPreView(NULL),
 	  mCertView(NULL),
 	  mCurrentView(NULL),
-	  mPos(0)
+	  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)));
@@ -86,7 +90,7 @@
         
     HbListWidget* listSecView = q_check_ptr(new HbListWidget(this)); 
     QMap<QString,QString> keystoreLabels;
-    
+    RDEBUG("0", 0);
     try
 		{
 		QT_TRAP_THROWING(
@@ -122,7 +126,7 @@
     	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);
@@ -143,6 +147,8 @@
 	layout->addItem(securityModuleList.get());
 	securityModuleList.release();
 	
+	mContextMenu = q_check_ptr(new HbMenu());
+	
 	setLayout(layout.get()); 
 	layout.release();
 	}
@@ -153,33 +159,32 @@
 	if(mSecModView)
 		{
 		mSecModView->deleteLater();
-		mSecModView= NULL;
 		}
 	
 	if(mPreView)
 		{
 		mPreView->deleteLater();
-		mPreView= NULL;
 		}
 	
 	if(mCertView)
 		{
 		mCertView->deleteLater();
-		mCertView= NULL;
 		}
 	
 	if(mCurrentView)
 		{
 		mCurrentView->deleteLater();
-		mCurrentView= NULL;
 		}
 	
 	delete mSecModUIModel;  
-	mSecModUIModel = NULL;
+	
+	delete mNote;
+	delete mContextMenu;
 	}
 
 void CpSecurityView::showCodeView()
 	{
+	RDEBUG("0", 0);
 	try
 		{
 		mSecModView = q_check_ptr(new CpSecModView(mPos, *mSecModUIModel));    
@@ -202,6 +207,7 @@
 
 void CpSecurityView::showWIMview()
 	{
+	RDEBUG("0", 0);
 	try
 		{
 		QObject::connect(mSecModView , SIGNAL(aboutToClose()), this, SLOT(viewDone()));
@@ -232,6 +238,7 @@
 
 void CpSecurityView::displayCert(const QModelIndex& modelIndex)
 	{
+	RDEBUG("0", 0);
 	try
 	{
 	mCertView = q_check_ptr(new CpCertView(modelIndex));    
@@ -248,6 +255,7 @@
 
 void CpSecurityView::displayPrevious()  
 	{
+	RDEBUG("0", 0);
 	try
 		{
 		mainWindow()->removeView(mCertView);    
@@ -263,31 +271,32 @@
 
 void CpSecurityView::indicateLongPress(HbAbstractViewItem *item,QPointF coords)
 	{
+	RDEBUG("0", 0);
 	try
 		{
-		std::auto_ptr<HbMenu> contextMenu(q_check_ptr(new HbMenu()));
+		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()));    
-		contextMenu->addAction(openModule.get());
+		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()));    
-			contextMenu->addAction(deleteModule.get());
+			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()));    
-		contextMenu->addAction(moduleInfo.get());
+		mContextMenu->addAction(moduleInfo.get());
 		moduleInfo.release();
 				
-		contextMenu->open();
-		contextMenu->setPreferredPos(coords);
+		mContextMenu->setPreferredPos(coords);
+		mContextMenu->open();
 		}
 	catch(const std::exception& exception)
 		{
@@ -297,33 +306,53 @@
 
 void CpSecurityView::deleteModule()
 	{
+	RDEBUG("0", 0);
 	try
 		{
-		HbMessageBox note(HbMessageBox::MessageTypeQuestion);
-		note.setHeadingWidget(q_check_ptr(new HbLabel(tr("Delete..."))));
-		note.setText("Delete keystore and password?");
-		note.setPrimaryAction(q_check_ptr(new HbAction("Yes")));
-		note.setSecondaryAction(q_check_ptr(new HbAction("No")));
-		note.setTimeout(HbPopup::NoTimeout);
-		note.setIconVisible (EFalse);
-		HbAction* result = note.exec();
-	
-		if (result != note.primaryAction())
-			{
-			return;
-			}
-	
-		QT_TRAP_THROWING(mSecModUIModel->DeleteKeysL(mPos));
+		
+		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::information(exception.what());
+	    HbMessageBox *box = new HbMessageBox(exception.what());
+    	box->setAttribute(Qt::WA_DeleteOnClose);
+    	box->open();	
 		}
-	// refresh current view
+
+}
+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;
@@ -343,6 +372,7 @@
 
 void CpSecurityView::displayPreviousFromModInfo()  
 	{
+	RDEBUG("0", 0);
 	try
 		{
 		mainWindow()->removeView(mModuleinfoView);    
--- a/cpsecplugins/cpplugincommon.pri	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/cpplugincommon.pri	Thu Jul 22 16:43:28 2010 +0100
@@ -16,7 +16,7 @@
 include (common.pri)
 
 
-LIBS += -lcpframework -lcpcategorymodel
+LIBS += -lcpframework
 
 symbian: plugin { # copy qtstub and manifest
 	
--- a/cpsecplugins/cpsecplugins.pro	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/cpsecplugins.pro	Thu Jul 22 16:43:28 2010 +0100
@@ -17,6 +17,6 @@
 TEMPLATE = subdirs
 
 # temporarilly skip, because too many deprecations
-# SUBDIRS += devicelockplugin/devicelockplugin.pro
-# SUBDIRS += simpincodeplugin/pincodeplugin.pro
-# SUBDIRS += cpadvancedsecplugin/group/advancedsecplugin.pro
+SUBDIRS += devicelockplugin/devicelockplugin.pro
+SUBDIRS += simpincodeplugin/pincodeplugin.pro
+SUBDIRS += cpadvancedsecplugin/group/advancedsecplugin.pro
--- a/cpsecplugins/devicelockplugin/devicelockplugin.pri	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/devicelockplugin/devicelockplugin.pri	Thu Jul 22 16:43:28 2010 +0100
@@ -20,6 +20,5 @@
 
 INCLUDEPATH += ../../seccodeui/src \
 			   ../../seccodeui/inc \
-			   /sf/mw/securitysrv/securitydialogs
-		   
-		
\ No newline at end of file
+			  
+	   
--- a/cpsecplugins/devicelockplugin/devicelockplugin.pro	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/devicelockplugin/devicelockplugin.pro	Thu Jul 22 16:43:28 2010 +0100
@@ -19,8 +19,10 @@
 
 CONFIG += hb plugin		  
 
-LIBS +=  -lseccodeui \
-		 -lsecuinotificationdialogplugin \
+LIBS +=  -lsecuinotificationdialogplugin \
+		 -llockclient \
+		 -lautolockuseractivityservice \
+		 -lIndicatorAutolockPlugin \
 		 -lsecui \
 		 -letelmm \
 		 -letel \
@@ -29,11 +31,14 @@
 		 -lcentralrepository \
 		 -lRLockSettings \
 		 -lflogger
-// TRANSLATIONS += devicelocking.ts
+TRANSLATIONS += devicelocking.ts
 include ( ../cpplugincommon.pri )
 include ( devicelockplugin.pri )
 include ( rom/devicelockplugin_rom.pri )
 
 symbian { 
-    TARGET.UID3 = 0X2002E68
+    TARGET.UID3 = 0X2002E683
+    
+    INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+    
 }
\ No newline at end of file
--- a/cpsecplugins/devicelockplugin/rom/devicelockplugin.iby	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/devicelockplugin/rom/devicelockplugin.iby	Thu Jul 22 16:43:28 2010 +0100
@@ -18,12 +18,7 @@
 #ifndef __DEVICELOCKPLUGIN_IBY__
 #define __DEVICELOCKPLUGIN_IBY__
 
-#include <bldvariant.hrh>
-#include <data_caging_paths_for_iby.hrh>
-
 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
+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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef __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__
--- a/cpsecplugins/devicelockplugin/rom/devicelockplugin_rom.pri	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/devicelockplugin/rom/devicelockplugin_rom.pri	Thu Jul 22 16:43:28 2010 +0100
@@ -17,5 +17,6 @@
 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.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
--- a/cpsecplugins/devicelockplugin/src/cpdevicelockplugin.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/devicelockplugin/src/cpdevicelockplugin.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -17,7 +17,7 @@
 #include "cpdevicelockplugin.h"
 #include "cpdevicelockpluginview.h"
 #include <cpsettingformentryitemdataimpl.h>
-
+#include <../../inc/cpsecplugins.h>
 
 
 /*
@@ -30,6 +30,7 @@
  */
 CpDeviceLockPlugin::CpDeviceLockPlugin()
 {
+	RDEBUG("0", 0);
 }
 
 
@@ -56,6 +57,7 @@
  */
 QList<CpSettingFormItemData*> CpDeviceLockPlugin::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const
 {
+		RDEBUG("0", 0);
     return QList<CpSettingFormItemData*>() 
            << new CpSettingFormEntryItemDataImpl<CpDeviceLockPluginView>(itemDataHelper,tr("Device lock"), QString());
 }
--- a/cpsecplugins/devicelockplugin/src/cpdevicelockpluginview.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/devicelockplugin/src/cpdevicelockpluginview.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -24,10 +24,9 @@
 #include "cpremotelockdataformviewitem.h"
 #include <hblabel.h>
 #include <hbpushbutton.h>
-#include <hbmessagebox>
+#include <HbMessageBox>
 #include <hbdataform.h>
 #include <QGraphicsLinearLayout>
-//#include <seccodeeditdataformviewitem.h>
 #include <secuisecuritysettings.h>
 #include <secuisecurityhandler.h>
 #include <etelmm.h>
@@ -44,6 +43,7 @@
 #include "debug.h"
 #include <qapplication.h>
 #include <qtranslator.h>
+#include <../../inc/cpsecplugins.h>
 
    
         
@@ -57,148 +57,172 @@
  */
 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 *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();
+    QTranslator *commontranslator = new QTranslator();
 
-        fine = commontranslator->load("common_" + lang, path);
-        if (fine)
-            qApp->installTranslator(commontranslator);
+    fine = commontranslator->load("common_" + lang, path);
+    if (fine)
+        qApp->installTranslator(commontranslator);
 
-
-    
     TSecUi::InitializeLibL();
     mUiSecuSettings = CSecuritySettings::NewL();
     mRemoteLockSettings = CRemoteLockSettings::NewL();
-    iALPeriodRep = CRepository::NewL( KCRUidSecuritySettings );  
-    
-    
+    iALPeriodRep = CRepository::NewL(KCRUidSecuritySettings);
+
     mRemoteLockSettingClicked = false;
-    mHack = 0; 
-	if (HbDataForm *form = settingForm()) 
-	    {
-        QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical);
-		QList<HbAbstractViewItem *> protoTypeList = form->itemPrototypes();
-		protoTypeList.append(new CpRemoteLockDataFormViewItem());
+    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));
-		//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));
-		if(lockVal)
-		    {
-            mLockWhenSimChangeItem->setContentWidgetData("text",hbTrId("txt_remotelocking_button_sim_changed_on"));
+        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));
-		mDeviceRemoteLockItem = new HbDataFormModelItem(HbDataFormModelItem::ToggleValueItem,
-                                                            hbTrId("txt_devicelocking_subhead_remote_locking"));
+                    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"));
-	        }		    
+        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);
 
-		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);
-	}
-}
+        //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);
+        }
+    }
 
 
 /*
@@ -210,7 +234,7 @@
  *****************************************************************
  */
 CpDeviceLockPluginView::~CpDeviceLockPluginView()
-{
+    {
     TSecUi::UnInitializeLib();
 }
 
@@ -224,8 +248,9 @@
  *****************************************************************
  */
 void CpDeviceLockPluginView::onLockCodeClicked()
-{
+    {
     Dprint(_L("CpDeviceLockPluginView::onLockCodeClicked()..Enter"));
+    RDEBUG("0", 0);
     mUiSecuSettings->ChangeSecCodeL();
     Dprint(_L("CpDeviceLockPluginView::onLockCodeClicked()..Exit"));
 }
@@ -242,21 +267,27 @@
 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 !!"));
+            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);
@@ -264,6 +295,7 @@
 
         }
     Dprint(_L("CpDeviceLockPluginView::onAutoLockChanged()..Exit"));
+    RDEBUG("0", 0);
 }
 
 
@@ -279,22 +311,29 @@
 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);
+}
 
 
 /*
@@ -313,9 +352,10 @@
 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
 
@@ -331,13 +371,14 @@
     {
     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.
@@ -356,9 +397,13 @@
         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"))
+        if (remLockData.toString() == hbTrId(
+                "txt_devicelocking_button_remote_on"))
             {
             remoteLockStatus = ETrue;
             retVal = mUiSecuSettings->ChangeRemoteLockStatusL(
@@ -370,13 +415,16 @@
             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"));
@@ -385,6 +433,7 @@
                     {
                     RollbackRemoteLockSettingState();
                     Dprint(_L("CpDeviceLockPluginView::onRemoteLockDataChanged..remoteLockSetting->SetEnabledL failed"));
+                    RDEBUG("failed", 0);
                     }
                 }
             else
@@ -392,6 +441,7 @@
                 if (mRemoteLockSettings->SetDisabled())
                     {
                     Dprint(_L("CpDeviceLockPluginView::onRemoteLockDataChanged..remoteLockSetting->SetDisabled success"));
+                    RDEBUG("success", 1);
                     mPrevRemLockData
                             = mDeviceRemoteLockItem->contentWidgetData(
                                     QString("text"));
@@ -400,17 +450,20 @@
                     {
                     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);
 }
 
 
@@ -430,8 +483,10 @@
 
     if ((item->type() == HbDataFormModelItem::ToggleValueItem)
             && (item->data(HbDataFormModelItem::LabelRole).toString()
-                    == hbTrId("txt_devicelocking_formlabel_lock_when_sim_changed")))
+                    == 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.
@@ -446,25 +501,34 @@
         /****************************************************************************************************************/
 
         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"));
+            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);
+            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)));
+            connect(formModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)),
+                    this, SLOT(onSIMLockDataChanged(QModelIndex,QModelIndex)));
             }
         }
-    }
+}
 
 
 /*
@@ -477,29 +541,30 @@
  */
 TInt CpDeviceLockPluginView::GetAutoLockIndex(TInt aValue)
     {
-        TInt index = 0;
-        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;
-            }  
-        
-        return index;    
+    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;
     }
 
 
@@ -514,51 +579,69 @@
  */
 TInt CpDeviceLockPluginView::GetValueAtIndex(TInt aIndex)
     {
-        TInt value = 0;
-        
-        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;
-            }
-        
-        return value;
-    }
+    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)));
+    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);
+    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)));
+    connect(formModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this,
+            SLOT(onRemoteLockDataChanged(QModelIndex,QModelIndex)));
 
-    if (mPrevRemLockData.toString() == hbTrId("txt_devicelocking_button_remote_on"))
+    if (mPrevRemLockData.toString() == hbTrId(
+            "txt_devicelocking_button_remote_on"))
         mRemoteLockMessageItem->setEnabled(true);
     else
         mRemoteLockMessageItem->setEnabled(false);
-
+		RDEBUG("0", 0);
     }
--- a/cpsecplugins/devicelockplugin/src/cpremotelockdataformviewitem.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/devicelockplugin/src/cpremotelockdataformviewitem.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -18,7 +18,7 @@
 #include "cpremotelockdataformviewitem.h"
 #include <hblabel.h>
 #include <QGraphicsSceneMouseEvent>
-
+#include <../../inc/cpsecplugins.h>
 
 
 /*
@@ -58,6 +58,7 @@
  */
 HbAbstractViewItem* CpRemoteLockDataFormViewItem::createItem()
 {
+	RDEBUG("0", 0);
 	return new CpRemoteLockDataFormViewItem(*this);
 }
 
@@ -73,6 +74,7 @@
 bool CpRemoteLockDataFormViewItem::canSetModelIndex(const QModelIndex &index) const
 {
 	int type = index.data(HbDataFormModelItem::ItemTypeRole).toInt();
+	RDEBUG("type", type);
 	return ((type == CpRemoteLockItem) || (type == CpCodeEditItem));
 }
 
@@ -88,6 +90,7 @@
 HbWidget *CpRemoteLockDataFormViewItem::createCustomWidget()
     {
     int type = modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt();
+    RDEBUG("type", type);
     if (type == CpCodeEditItem)
         {
         CpLockEdit *edit = new CpLockEdit("1234");
@@ -140,6 +143,7 @@
  */
 void CpLockEdit::mousePressEvent(QGraphicsSceneMouseEvent *event)
 {
+		RDEBUG("0", 0);
     if (event->button() != Qt::LeftButton) {
         event->ignore();
         return;
--- a/cpsecplugins/devicelockplugin/src/debug.h	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/devicelockplugin/src/debug.h	Thu Jul 22 16:43:28 2010 +0100
@@ -15,44 +15,26 @@
  *
  */
 
-#if 0
-#ifndef DEBUG_H_
-#define DEBUG_H_
-
-#define DL_TRACE( x ) RDebug::Printf( "%s %s (%u) %s", __FILE__, __PRETTY_FUNCTION__, __LINE__, x );
-#define DL_TRACE_NUM( x, y ) RDebug::Printf( "%s %s (%u) %s=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, x, y );
-
-
-#endif /* DEBUG_H_ */
-#endif
+#if defined (_DEBUG)
 
-
-
-
-
-#ifndef SCPDEBUG_H
-#define SCPDEBUG_H
-
-   _LIT( KLogFile, "SCP.log" );
-   _LIT( KLogDir, "tarm" );
-   
-
+_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 );
-            }
+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;
+    #define Dprint(arg...)    FWrite arg;
 #else
-                #define Dprint(arg...)
+    #define Dprint(arg...)
 #endif  // _DEBUG
-       
 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpsecplugins/inc/cpsecplugins.h	Thu Jul 22 16:43:28 2010 +0100
@@ -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
--- a/cpsecplugins/simpincodeplugin/inc/cppincodepluginview.h	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/simpincodeplugin/inc/cppincodepluginview.h	Thu Jul 22 16:43:28 2010 +0100
@@ -24,6 +24,7 @@
 // Forward declarations
 class SecCodeSettings;
 class HbDataFormModelItem;
+class HbDataFormModel;
 
 // Class declaration
 class CpPinCodePluginView : public CpBaseSettingView
@@ -37,10 +38,11 @@
 private slots:
     void changePinCode();
     void changePin2Code();
-    void changePinCodeRequest();
+    void toggleChange(QModelIndex startIn, QModelIndex endIn);
     
 private:
     SecCodeSettings *mSecCodeSettings;
+    HbDataFormModel *mFormModel;
     HbDataFormModelItem *mPinCodeRequestItem;
 };
 
--- a/cpsecplugins/simpincodeplugin/rom/pincodeplugin.iby	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/simpincodeplugin/rom/pincodeplugin.iby	Thu Jul 22 16:43:28 2010 +0100
@@ -21,9 +21,9 @@
 #include <bldvariant.hrh>
 #include <data_caging_paths_for_iby.hrh>
 
-file=ABI_DIR\BUILD_DIR\pincodeplugin.dll    SHARED_LIB_DIR\pincodeplugin.dll
+// 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\pincodeplugin.qtplugin 
-resource\qt\plugins\controlpanel\pincodeplugin.qtplugin
+data=/epoc32/data/c/resource/qt/plugins/controlpanel/cppincodeplugin.qtplugin resource/qt/plugins/controlpanel/cppincodeplugin.qtplugin
 
 #endif
--- a/cpsecplugins/simpincodeplugin/src/cppincodeplugin.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/simpincodeplugin/src/cppincodeplugin.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -17,6 +17,7 @@
 
 // System includes
 #include <cpsettingformentryitemdataimpl.h>
+#include <../../inc/cpsecplugins.h>
 
 // User includes
 #include "cppincodeplugin.h"
@@ -36,6 +37,7 @@
 */
 CpPinCodePlugin::CpPinCodePlugin()
 {
+RDEBUG("0", 0);
 }
 
 /*!
@@ -51,6 +53,7 @@
 QList<CpSettingFormItemData *> CpPinCodePlugin::createSettingFormItemData(
     CpItemDataHelper &itemDataHelper) const
 {
+		RDEBUG("0", 0);
     return  QList<CpSettingFormItemData *>()
         << new CpSettingFormEntryItemDataImpl<CpPinCodePluginView>
         (itemDataHelper, tr("PIN code"), QString());
--- a/cpsecplugins/simpincodeplugin/src/cppincodepluginview.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/simpincodeplugin/src/cppincodepluginview.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -25,6 +25,7 @@
 
 // User includes
 #include "cppincodepluginview.h"
+#include <../../inc/cpsecplugins.h>
 
 /*!
     \class CpPinCodePluginView
@@ -41,14 +42,15 @@
 CpPinCodePluginView::CpPinCodePluginView(QGraphicsItem *parent /*= 0*/)
 	: CpBaseSettingView(0,parent), mSecCodeSettings(new SecCodeSettings())
 {
-    HbDataForm *form = settingForm();
+		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"));
 
-        HbDataFormModel *formModel = new HbDataFormModel();
+        mFormModel = new HbDataFormModel(this);        
         mPinCodeRequestItem = new HbDataFormModelItem(
             HbDataFormModelItem::ToggleValueItem, tr("PIN code requests"));
 
@@ -60,10 +62,10 @@
             mPinCodeRequestItem->setContentWidgetData("text",tr("Off"));
             mPinCodeRequestItem->setContentWidgetData("additionalText", tr("Off"));
         }
-
-        form->addConnection(mPinCodeRequestItem, SIGNAL(clicked()), this,
-        		SLOT(changePinCodeRequest()));
-        formModel->appendDataFormItem(mPinCodeRequestItem);
+				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>
@@ -73,7 +75,7 @@
         pinCodeItem->setContentWidgetData("readOnly", true);
         form->addConnection(pinCodeItem, SIGNAL(clicked()), this,
         		SLOT(changePinCode()));
-        formModel->appendDataFormItem(pinCodeItem);
+        mFormModel->appendDataFormItem(pinCodeItem);
 
         HbDataFormModelItem *pin2CodeItem = new HbDataFormModelItem(
             static_cast<HbDataFormModelItem::DataItemType>
@@ -83,9 +85,9 @@
         pin2CodeItem->setContentWidgetData("readOnly", true);
         form->addConnection(pin2CodeItem, SIGNAL(clicked()), this,
         		SLOT(changePin2Code()));
-        formModel->appendDataFormItem(pin2CodeItem);
-
-        form->setModel(formModel);
+        mFormModel->appendDataFormItem(pin2CodeItem);
+				RDEBUG("form->setModel", 1);
+        form->setModel(mFormModel);
     }
 }
 
@@ -98,10 +100,51 @@
 }
 
 /*!
+   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();
 }
 
@@ -110,26 +153,6 @@
 */
 void CpPinCodePluginView::changePin2Code()
 {
+		RDEBUG("0", 0);
     mSecCodeSettings->changePin2Code();
 }
-
-/*!
-   response for click pin code request
-*/
-void CpPinCodePluginView::changePinCodeRequest()
-{
-    if (mSecCodeSettings->changePinCodeRequest()) {
-        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"));
-        }
-    }
-}
--- a/cpsecplugins/simpincodeplugin/src/seccodeedit.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/simpincodeplugin/src/seccodeedit.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -20,6 +20,7 @@
 
 // User includes
 #include "seccodeedit.h"
+#include <../../inc/cpsecplugins.h>
 
 // ======== MEMBER FUNCTIONS ========
 
@@ -43,6 +44,7 @@
 */
 void SecCodeEdit::mousePressEvent(QGraphicsSceneMouseEvent *event)
 {
+		RDEBUG("0", 0);
     if (event->button() != Qt::LeftButton) {
         event->ignore();
         return;
--- a/cpsecplugins/simpincodeplugin/src/seccodeeditdataformviewitem.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/simpincodeplugin/src/seccodeeditdataformviewitem.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -18,6 +18,7 @@
 // User includes
 #include "seccodeeditdataformviewitem.h"
 #include "seccodeedit.h"
+#include <../../inc/cpsecplugins.h>
 
 // ======== MEMBER FUNCTIONS ========
 
@@ -27,6 +28,7 @@
 SecCodeEditDataFormViewItem::SecCodeEditDataFormViewItem(
     QGraphicsItem *parent): HbDataFormViewItem(parent)
 {
+	RDEBUG("0", 0);
 }
 
 /*!
@@ -41,6 +43,7 @@
 */
 HbAbstractViewItem *SecCodeEditDataFormViewItem::createItem()
 {
+		RDEBUG("0", 0);
     return new SecCodeEditDataFormViewItem( *this);
 }
    
@@ -51,6 +54,7 @@
     const QModelIndex &index) const
 {
     int type = index.data(HbDataFormModelItem::ItemTypeRole).toInt();
+    RDEBUG("type", type);
     return type == SecCodeEditItem;
 }
 
@@ -60,13 +64,15 @@
 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;
 }
--- a/cpsecplugins/simpincodeplugin/src/seccodemodel.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/simpincodeplugin/src/seccodemodel.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -18,6 +18,7 @@
 // User includes
 #include "seccodemodel.h"
 #include "seccodemodel_p.h"
+#include <../../inc/cpsecplugins.h>
 
 // ======== MEMBER FUNCTIONS ========
 
@@ -43,6 +44,7 @@
 */
 bool SecCodeModel::pinCodeRequest() const
 {
+		RDEBUG("0", 0);
     return d_ptr->pinCodeRequest();
 }
 
@@ -51,6 +53,7 @@
 */
 bool SecCodeModel::changePinCodeRequest()
 {
+		RDEBUG("0", 0);
     return d_ptr->changePinCodeRequest();
 }
 
@@ -59,6 +62,7 @@
 */
 int SecCodeModel::changePinCode()
 {
+		RDEBUG("0", 0);
     return d_ptr->changePinCode();
 }
 
@@ -67,5 +71,6 @@
 */
 int SecCodeModel::changePin2Code()
 {
+		RDEBUG("0", 0);
     return d_ptr->changePin2Code();
 }
--- a/cpsecplugins/simpincodeplugin/src/seccodemodel_symbian.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/simpincodeplugin/src/seccodemodel_symbian.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -23,6 +23,7 @@
 // User includes
 #include "seccodemodel_p.h"
 #include "seccodeuiglobal.h"
+#include <../../inc/cpsecplugins.h>
 
 // ======== MEMBER FUNCTIONS ========
 
@@ -50,6 +51,7 @@
 */
 void SecCodeModelPrivate::ConstructL()
 {
+	RDEBUG("0", 0);
 	iSecurity = CSecuritySettings::NewL(); 
 }
 
@@ -68,9 +70,11 @@
 */
 bool SecCodeModelPrivate::pinCodeRequest() const
 {
+	RDEBUG("0", 0);
 	bool isLockEnabled = false;
 	QT_TRAP_THROWING(isLockEnabled = iSecurity->IsLockEnabledL(
 		RMobilePhone::ELockICC));
+	RDEBUG("isLockEnabled", isLockEnabled);
 	return isLockEnabled;
 }
 
@@ -79,8 +83,10 @@
 */
 bool SecCodeModelPrivate::changePinCodeRequest()
 {
+	RDEBUG("0", 0);
     bool result = false;
 	QT_TRAP_THROWING(result =iSecurity->ChangePinRequestL());
+	RDEBUG("result", result);
 	return result;
 }
 
@@ -89,7 +95,9 @@
 */
 int SecCodeModelPrivate::changePinCode()
 {
+	RDEBUG("0", 0);
 	QT_TRAP_THROWING(iSecurity->ChangePinL());
+	RDEBUG("0", 0);
 	return 0;
 }
 
@@ -98,6 +106,8 @@
 */
 int SecCodeModelPrivate::changePin2Code()
 {
+	RDEBUG("0", 0);
 	QT_TRAP_THROWING(iSecurity->ChangePin2L());
+	RDEBUG("0", 0);
 	return 0;
 }
--- a/cpsecplugins/simpincodeplugin/src/seccodemodel_win.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/simpincodeplugin/src/seccodemodel_win.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -17,6 +17,7 @@
 
 // User includes
 #include "seccodemodel_p.h"
+#include <../../inc/cpsecplugins.h>
 
 // ======== MEMBER FUNCTIONS ========
 /*!
@@ -54,6 +55,7 @@
 */
 bool SecCodeModelPrivate::pinCodeRequest() const
 {
+		RDEBUG("0", 0);
     QString information;
     information = QString("Emulator NOT supported!");
     HbMessageBox messageBox(information);
@@ -66,6 +68,7 @@
 */
 bool SecCodeModelPrivate::changePinCodeRequest()
 {
+		RDEBUG("0", 0);
     QString information;
     information = QString("Emulator NOT supported!");
     HbMessageBox messageBox(information);
@@ -78,6 +81,7 @@
 */
 int SecCodeModelPrivate::changePinCode()
 {
+		RDEBUG("0", 0);
     QString information;
     information = QString("Emulator NOT supported!");
     HbMessageBox messageBox(information);
@@ -90,6 +94,7 @@
 */
 int SecCodeModelPrivate::changePin2Code()
 {
+		RDEBUG("0", 0);
     QString information;
     information = QString("Emulator NOT supported!");
     HbMessageBox messageBox(information);
--- a/cpsecplugins/simpincodeplugin/src/seccodesettings.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/cpsecplugins/simpincodeplugin/src/seccodesettings.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -18,6 +18,7 @@
 // User includes
 #include "seccodesettings.h"
 #include "seccodemodel.h"
+#include <../../inc/cpsecplugins.h>
 
 // Class declaration
 class SecCodeSettingsPrivate
@@ -44,7 +45,7 @@
 SecCodeSettings::SecCodeSettings(QObject * parent /*= 0*/)
     : QObject(parent), d_ptr(new SecCodeSettingsPrivate())
 {
-
+RDEBUG("0", 0);
 }
 
 /*!
@@ -60,6 +61,7 @@
 */
 bool SecCodeSettings::pinCodeRequest() const
 {
+		RDEBUG("0", 0);
     return d_ptr->mSecCodeModel->pinCodeRequest();
 }
 
@@ -68,6 +70,7 @@
 */
 bool SecCodeSettings::changePinCodeRequest()
 {
+		RDEBUG("0", 0);
     return d_ptr->mSecCodeModel->changePinCodeRequest();
 }
 
@@ -76,6 +79,7 @@
 */
 void SecCodeSettings::changePinCode()
 {
+		RDEBUG("0", 0);
     d_ptr->mSecCodeModel->changePinCode();
 }
 
@@ -84,5 +88,6 @@
 */
 void SecCodeSettings::changePin2Code()
 {    
+		RDEBUG("0", 0);
     d_ptr->mSecCodeModel->changePin2Code();
 }
--- a/gba/data/gba_license.txt	Thu Jun 17 12:11:51 2010 +0100
+++ b/gba/data/gba_license.txt	Thu Jul 22 16:43:28 2010 +0100
@@ -1,8 +1,2 @@
-End-User License Agreement: 
-By installing or using this software you are confirming acceptance of this software and agree to be bound by the terms and conditions of this Licence.
-
-Grant of License: 
-Nokia grants you a non-exclusive, non-transferable limited end-user right to use this software for the sole purpose of developing and testing applications or middleware software for the Symbian Platform.
-
 Disclaimer of Warranty: 
-THIS SOFTWARE IS PROVIDED TO YOU "AS IS"AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NOKIA, ITS MEMBERS, SUPPLIERS AND LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATE, OR PROFITS; OR INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+THIS SOFTWARE IS PROVIDED TO YOU "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NOKIA, ITS MEMBERS, SUPPLIERS AND LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, OR EXEMPLARY DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATE, OR PROFITS; OR INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--- a/gba/sis/gba.pkg	Thu Jun 17 12:11:51 2010 +0100
+++ b/gba/sis/gba.pkg	Thu Jul 22 16:43:28 2010 +0100
@@ -17,7 +17,7 @@
 &EN
 
 ; Header
-#{"GBA (Beta)"},(0x20029F08), 0, 5, 0, TYPE=SA,RU
+#{"GBA"},(0x20029F08), 1, 0, 0, TYPE=SA,RU
 
 ; Localised Vendor name
 %{"Nokia"}
--- a/layers.sysdef.xml	Thu Jun 17 12:11:51 2010 +0100
+++ b/layers.sysdef.xml	Thu Jul 22 16:43:28 2010 +0100
@@ -21,7 +21,7 @@
     </layer>
     <layer name="api_test_layer">
       <module name="securitysrv_test">
-        <unit unitID="sedo.securitysrv_test" mrp="" bldFile="&layer_real_source_path;/tsrc/group" name="securitysrv_test" />
+        <unit unitID="sedo.securitysrv_test" mrp="" bldFile="&layer_real_source_path;/tsrc/group" name="securitysrv_test" filter="TA_SECURITYSRV" />
       </module>
     </layer>
   </systemModel>
--- a/package_definition.xml	Thu Jun 17 12:11:51 2010 +0100
+++ b/package_definition.xml	Thu Jul 22 16:43:28 2010 +0100
@@ -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	Thu Jul 22 16:43:28 2010 +0100
@@ -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 Jun 17 12:11:51 2010 +0100
+++ b/pkiutilities/CTSecurityDialogs/Group/CTSecDialogImpl.mmp	Thu Jul 22 16:43:28 2010 +0100
@@ -34,15 +34,26 @@
 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
 
@@ -55,7 +66,7 @@
 SOURCE    CTPinPinQueryDialog.cpp
 SOURCE    CTCertificateQuery.cpp
 SOURCE    CTSecurityDialogsAO.cpp
-SOURCE    CTNoTrustQuery.cpp
+SOURCE    CTUntrustedCertQuery.cpp
 SOURCE    CTInvalidCertNote.cpp
 
 LIBRARY   EUSER.LIB
@@ -80,6 +91,9 @@
 LIBRARY   aknlayout.lib
 LIBRARY   X500.lib
 LIBRARY   DevTokenClient.lib
+LIBRARY   HbCore.lib                // CHbDeviceDialog
+LIBRARY   HbWidgets.lib
+LIBRARY   secui.lib
 
 DEBUGLIBRARY     flogger.lib
 
--- a/pkiutilities/CTSecurityDialogs/Group/bld.inf	Thu Jun 17 12:11:51 2010 +0100
+++ b/pkiutilities/CTSecurityDialogs/Group/bld.inf	Thu Jul 22 16:43:28 2010 +0100
@@ -23,6 +23,7 @@
 
 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
--- a/pkiutilities/CTSecurityDialogs/NotifInc/CTNoTrustQuery.h	Thu Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ b/pkiutilities/CTSecurityDialogs/NotifInc/CTSecurityDialogsAO.h	Thu Jul 22 16:43:28 2010 +0100
@@ -170,6 +170,8 @@
 
         void ShowCSRDialogL();
 
+        void ShowInformationNoteL( TInt aResourceID ) const;
+
         /**
         * Saves digital signature receipt
         */
@@ -323,9 +325,6 @@
 
         TBool& iDeleted;
 
-        CAknQueryDialog* iQueryDialog;
-        TBool iQueryDialogDeleted;
-
         CCTPinQueryDialog* iPinQueryDialog;
         TBool iPinQueryDialogDeleted;
         };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/CTSecurityDialogs/NotifInc/CTUntrustedCertQuery.h	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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/CTInvalidCertNote.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/pkiutilities/CTSecurityDialogs/NotifSrc/CTInvalidCertNote.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ b/pkiutilities/CTSecurityDialogs/NotifSrc/CTPinPinQueryDialog.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -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 Jun 17 12:11:51 2010 +0100
+++ b/pkiutilities/CTSecurityDialogs/NotifSrc/CTQueryDialog.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -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 Jun 17 12:11:51 2010 +0100
+++ b/pkiutilities/CTSecurityDialogs/NotifSrc/CTSecurityDialogsAO.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -24,7 +24,7 @@
 #include "CTSelectCertificateDialog.h"
 #include "CTQueryDialog.h"
 #include "CTPinPinQueryDialog.h"
-#include "CTNoTrustQuery.h"
+#include "CTUntrustedCertQuery.h"
 #include "CTInvalidCertNote.h"
 #include <PKIDlg.h>
 #include <badesca.h>
@@ -46,6 +46,11 @@
 #include <TrustedSitesStore.h>
 #include <mctwritablecertstore.h>
 
+#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;
 const TInt KMaxLengthTextDetailsBody = 5000;
@@ -53,8 +58,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;
 
@@ -63,12 +66,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 };
 
@@ -81,6 +80,18 @@
 _LIT( KKeyStoreExportKeyLabel, "Passphrase of the exported key file" );
 _LIT( KPKCS12TokenLabel, "PKCS12");
 
+
+// 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 ===============================
 
 // -----------------------------------------------------------------------------
@@ -106,9 +117,6 @@
 void CCTSecurityDialogsAO::ConstructL()
     {
     iDeleted = EFalse;
-
-    iQueryDialog = NULL;
-    iQueryDialogDeleted = ETrue;
     }
 
 // -----------------------------------------------------------------------------
@@ -184,6 +192,7 @@
     iMessagePtr = aMessage;
 
     WIMSECURITYDIALOGS_WRITE_FORMAT( "CCTSecurityDialogsAO::StartLD iOperation=%d", iOperation );
+    TRACE1( "CCTSecurityDialogsAO::StartLD iOperation=%d", iOperation );
 
     MapTlsProviderOperation( iOperation );
 
@@ -338,6 +347,8 @@
 //
 void CCTSecurityDialogsAO::DoHandleServerAuthFailL( const TDesC8& aBuffer )
     {
+    TRACE( "CCTSecurityDialogsAO::DoHandleServerAuthFailL" );
+
     CServerAuthenticationFailureInput* srvAuthFail =
         CServerAuthenticationFailureInput::NewLC( aBuffer );
     TPtrC8 cert;
@@ -350,33 +361,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() );
         }
@@ -558,6 +567,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
@@ -565,11 +575,13 @@
         {
         HBufC* header = StringLoader::LoadLC(
             R_QTN_CM_HEADING_PHONE_KEYSTORE, CEikonEnv::Static() );
-        iPIN.iMinLength = KMaxKeystorePwLength;
-        DoHandleMessageL( EEnterKeyStorePw, KNullDesC, *header,
-            iPIN.iMinLength, iPIN.iMaxLength );
-        iMultiLineDlgType = EEnterNewKeyStorePw;
-        CleanupStack::PopAndDestroy( header );
+		iPIN.iMinLength = KMaxKeystorePwLength;
+        DoHandleMessageL( EEnterKeyStorePw, KNullDesC, *header,    
+            iPIN.iMinLength, iPIN.iMaxLength );                    
+        iMultiLineDlgType = EEnterNewKeyStorePw;                   
+        CleanupStack::PopAndDestroy( header );                     
+        RunL();
+        
         }
     else if ( iPIN.iPINLabel == KKeyStoreImportKeyLabel )
         {
@@ -586,7 +598,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;
         }
@@ -620,12 +632,36 @@
     TDialogType dlgType = ( TDialogType )aDlgType;
     if ( EEnterNewKeyStorePw == dlgType )
         {
-        dlgText1 = iNotifier->LoadResourceStringLC( dlgType, KNullDesC );
+/*
+        dlgText1 = iNotifier->LoadResourceStringLC( dlgType, KNullDesC );          
         dlgText2 = iNotifier->LoadResourceStringLC( EVerifyKeyStorePw, KNullDesC );
-        dlg = CCTPinPinQueryDialog::NewL( *dlgText1, *dlgText2, iPINValue2,
-            iPINValueVerify, iPIN.iMinLength, iPIN.iMaxLength, iRetValue );
-        dlg->RunDlgLD( iStatus, R_WIM_PWPW_QUERY_DIALOG );
-        CleanupStack::PopAndDestroy( 2, dlgText1 ); // dlgText1, dlgText2
+        dlg = CCTPinPinQueryDialog::NewL( *dlgText1, *dlgText2, iPINValue2,        
+            iPINValueVerify, iPIN.iMinLength, iPIN.iMaxLength, iRetValue );        
+        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 )
         {
@@ -754,16 +790,35 @@
                     }
                 }
                iPinQueryDialogDeleted = EFalse;
-                CCTPinQueryDialog::RunDlgLD( iStatus,
-                                        *dlgText,
-                                        *pinValue,
-                                        aMinLength,
-                                        aMaxLength,
-                                        iRetValue,
-                                        resource,
-                                        iPinQueryDialog,
-                                        iPinQueryDialogDeleted );
+               if(aDlgType!=EEnterKeyStorePw) {
+                    CCTPinQueryDialog::RunDlgLD( iStatus,
+                                            *dlgText,
+                                            *pinValue,
+                                            aMinLength,
+                                            aMaxLength,
+                                            iRetValue,
+                                            resource,
+                                            iPinQueryDialog,
+                                            iPinQueryDialogDeleted );
+			    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:
             {
@@ -771,12 +826,12 @@
             }
 
       }
-
-  if ( dlg )
-      {
-      dlg->ExecuteLD( *dlgText );
-      dlg = NULL;
-      }
+  if ( dlg && aDlgType!=EEnterKeyStorePw)                                                                    
+      {                                                                         
+                                                                                
+      dlg->ExecuteLD( *dlgText );                                               
+      dlg = NULL;                                                               
+      }                                                                         
 
     CleanupStack::PopAndDestroy( dlgText ); // dlgText
     }
@@ -801,6 +856,8 @@
 //
 void CCTSecurityDialogsAO::InitCertStoreL()
     {
+    TRACE( "CCTSecurityDialogsAO::InitCertStoreL" );
+
     switch(iOperation)
         {
         case ESignText:
@@ -936,13 +993,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:
         {
@@ -950,35 +1009,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;
@@ -987,24 +1045,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;
                 }
@@ -1016,11 +1076,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() );
 
@@ -1041,7 +1101,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
@@ -1108,9 +1168,11 @@
             }
         break;
         }
+
       case EAddTrustedSite:
           {
-          if ( iStatus.Int() == KErrNone )
+          TRACE( "CCTSecurityDialogsAO::RunL, EAddTrustedSite" );
+          if( iStatus.Int() == KErrNone )
               {
               //Added server certificate succesfully
               CTrustSitesStore* trustedSitesStore = CTrustSitesStore::NewL();
@@ -1119,7 +1181,7 @@
               TInt status = trustedSitesStore->AddL( *iCertBuf, *iServerName );
 
               CleanupStack::PopAndDestroy( trustedSitesStore );
-              if ( status  == KErrNone )
+              if( status  == KErrNone )
                   {
                   iRetValue = EServerCertAcceptedPermanently;
                   }
@@ -1134,23 +1196,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
@@ -1167,6 +1233,7 @@
               }
           break;
           }
+
       case EOperationSignTextShown:
           {
           if ( iRetValue || iOperation == EUserAuthentication )
@@ -1183,6 +1250,7 @@
           User::RequestComplete( status, KErrNone );
           break;
           }
+
       case EOperationInitCertStore:
           {
           TInt err = KErrNone;
@@ -1200,6 +1268,7 @@
           iNextStep = EOperationRetrieveCertInfos;
           break;
           }
+
       case EOperationRetrieveCertInfos:
           {
           if ( iCertInfo )
@@ -1235,11 +1304,13 @@
               }
           break;
           }
+
       case EOperationSelectCert:
           {
           DoHandleSelectCertificateL();
           break;
           }
+
       case EGetCertInfo:
           {
           iStatus = KRequestPending;
@@ -1249,6 +1320,7 @@
           SetActive();
           break;
           }
+
       case EGetCertificate:
           {
           iStatus = KRequestPending;
@@ -1268,36 +1340,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
       /////////////
@@ -1340,11 +1418,13 @@
               }
           break;
           }
+
       case EVerifyPINs:
           {
           VerifyPinsL();
           break;
           }
+
       default:
           {
           User::Panic( _L("CTestSecDlgNotifier"), 0 );
@@ -1434,84 +1514,40 @@
 //
 void CCTSecurityDialogsAO::ShowNoTrustDialogL()
     {
-    CX509Certificate* cert = CX509Certificate::NewLC( iCertBuf->Des() );
-    TInt resourceid = R_WIM_NO_TRUST_QUERY_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;
-        }
-    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
-                resourceid = R_WIM_NO_TRUST_QUERY_UNTRUSTED;
-                }
-            else if( iServerName->Des() != cn->Des() )
-                {
-                // Domain name doesn't match with CN
-                resourceid = R_WIM_NO_TRUST_QUERY_SITE;
-                }
-            else if( iAuthFailReason == EDateOutOfRange )
-                {
-                // Certificate is out of date
-                resourceid = R_WIM_NO_TRUST_QUERY_OOD;
-                showPermAccept = EFalse;
-                }
-            else
-                {
-                // Otherwise show general untrusted note
-                resourceid = R_WIM_NO_TRUST_QUERY_UNTRUSTED;
-                }
-            }
-        else
-            {
-            // Untrusted certificate
-            resourceid = R_WIM_NO_TRUST_QUERY_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;
-            }
-
-        iQueryDialog = new( ELeave ) CCTNoTrustQuery( *this, iRetValue, iStatus, iServerName,
-                    showPermAccept, iQueryDialogDeleted );
-        iQueryDialog->ExecuteLD( resourceid );
+    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( cert );
+    CleanupStack::PopAndDestroy( untrustedCertDlg );
+    TRACE1( "CCTSecurityDialogsAO::ShowNoTrustDialogL, iRetValue=%d", iRetValue );
 
     iNextStep = EServerCertCheckUserResp;
     iStatus = KRequestPending;
+    TRequestStatus* status = &iStatus;
+    User::RequestComplete( status, KErrNone );
     SetActive();
     }
 
@@ -2028,9 +2064,9 @@
 // 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:
@@ -2312,6 +2348,7 @@
             iMessagePtr.WriteL( iReplySlot, pinValueBufPtr );
             break;
             }
+
         case EChangePIN:
         case EUnblockPIN:
             {
@@ -2322,6 +2359,7 @@
             iMessagePtr.WriteL( iReplySlot, twoPINOutputBuf );
             break;
             }
+
         case ESignText: // flow thru
         case EUserAuthenticationText: // flow thru
         case EUserAuthentication:
@@ -2330,13 +2368,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;
                     }
@@ -2357,12 +2396,14 @@
 
             break;
             }
+
         case EPINBlocked:
         case EUnblockPINInClear:
             {
             User::Leave( KErrNotSupported );
             break;
             }
+
         case ECreateCSR:
         case ECertDetails:
         case ESaveCert:
@@ -2378,6 +2419,7 @@
             {
             break; // Complete is enough
             }
+
         default:
             User::Panic( _L("CTestSecDlgNotifier"), 0 );
         }
@@ -2425,18 +2467,7 @@
 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;
@@ -2469,10 +2500,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;
@@ -2503,3 +2536,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 Jun 17 12:11:51 2010 +0100
+++ b/pkiutilities/CTSecurityDialogs/NotifSrc/CTSelectcertificatedialog.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -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 Jun 17 12:11:51 2010 +0100
+++ b/pkiutilities/CTSecurityDialogs/NotifSrc/CTSigntextdialog.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -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	Thu Jul 22 16:43:28 2010 +0100
@@ -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 Jun 17 12:11:51 2010 +0100
+++ b/pkiutilities/CTSecurityDialogs/NotifSrc/CTpinquerydialog.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -18,6 +18,7 @@
 
 
 // INCLUDE FILES
+#include <platform/e32notif.h>
 #include "CTPinQueryDialog.h"
 #include "CTSecurityDialogsLogger.h"
 #include <CTSecDlgs.rsg>
--- a/pkiutilities/CTSecurityDialogs/ecomsrc/CTSecDlgWrapper.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/pkiutilities/CTSecurityDialogs/ecomsrc/CTSecDlgWrapper.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -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/CertSaver/data/CertSaver.rss	Thu Jun 17 12:11:51 2010 +0100
+++ b/pkiutilities/CertSaver/data/CertSaver.rss	Thu Jul 22 16:43:28 2010 +0100
@@ -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 Jun 17 12:11:51 2010 +0100
+++ b/pkiutilities/CertSaver/group/CertSaver.mmp	Thu Jul 22 16:43:28 2010 +0100
@@ -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 Jun 17 12:11:51 2010 +0100
+++ b/pkiutilities/CertSaver/inc/CertSaverModel.h	Thu Jul 22 16:43:28 2010 +0100
@@ -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 Jun 17 12:11:51 2010 +0100
+++ b/pkiutilities/CertSaver/loc/certsaver.loc	Thu Jul 22 16:43:28 2010 +0100
@@ -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 Jun 17 12:11:51 2010 +0100
+++ b/pkiutilities/CertSaver/src/CertSaverAppUi.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -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 Jun 17 12:11:51 2010 +0100
+++ b/pkiutilities/CertSaver/src/CertSaverDocument.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -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 Jun 17 12:11:51 2010 +0100
+++ b/pkiutilities/CertSaver/src/CertSaverModel.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -18,7 +18,9 @@
 
 // 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
@@ -44,7 +46,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 +65,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 +127,7 @@
             const TCertificateOwnerType& aOwnerType,
             const TCertificateFormat& aCertFormat )
     {
+
     iCertOwnerType = aOwnerType;
     iCertFormat = aCertFormat;
     iNewCert = &aCertificate;
@@ -139,6 +151,7 @@
 //
 void CCertSaverModel::DoSavePrivateKeyL( const TDesC8& aKey )
     {
+
     CheckFSSpaceL( aKey );
 
     TKeyIdentifier keyIdentifier;
@@ -158,7 +171,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 +210,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 +221,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 +268,7 @@
     const TKeyIdentifier& aKeyIdentifier,
     TKeyUsagePKCS15& aKeyUsage )
     {
+
     TBool ret = EFalse;
     TCTKeyAttributeFilter keyFilter;
     keyFilter.iKeyAlgorithm = CKeyInfoBase::EInvalidAlgorithm;
@@ -272,7 +287,7 @@
         case KErrCorrupt:
         case KErrEof:
             {
-            ShowErrorNoteL( R_CERTSAVER_KEYSTORE_CORRUPTED );
+            ShowInformationNoteL( R_CERTSAVER_KEYSTORE_CORRUPTED );
             User::Leave( KErrCancel );
             }
         default:
@@ -304,6 +319,7 @@
     const TKeyIdentifier& aKeyIdentifier )
     {
 
+
     for ( TInt i = 0; i < iParser.UserCertificates().Count(); i++ )
         {
         const CX509Certificate* cert = iParser.UserCertificates().At( i );
@@ -330,6 +346,7 @@
 //
 void CCertSaverModel::CreateKeyLabelL( TDes& aLabel )
     {
+
     TTime time;
     time.UniversalTime();
     TBuf<KPrivaKeyLabelLength> dateBuf;
@@ -349,6 +366,7 @@
 //
 void CCertSaverModel::SavePrivateKeyL()
     {
+
     if ( iParser.Keys().Count() <= 0 )
         {
         return;
@@ -397,6 +415,7 @@
     TAlgorithmId aAlgorithm )
     {
 
+
     TKeyUsagePKCS15 pkcs15KeyUsage = EPKCS15UsageNone;
     TKeyUsageX509 x509Usage = EX509UsageNone;
 
@@ -485,16 +504,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 +518,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 +563,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 +589,7 @@
 //
 void CCertSaverModel::DoSaveCertL()
     {
+
     TInt status = KErrNone;
     CCertAttributeFilter* filter = NULL;
     TCertificateFormat certFormat = EX509Certificate;
@@ -678,7 +692,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 +705,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 +744,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 +801,7 @@
 //
 TInt CCertSaverModel::QueryLabelL( TCertLabel& aLabel, CUnifiedCertStore& aStore )
     {
+
     CCertAttributeFilter* filter = NULL;
     TInt status = KErrNone;
     RMPointerArray<CCTCertInfo> entries;
@@ -793,11 +809,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 +866,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 +911,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 +932,7 @@
     TInt aStringResID,
     TInt aInt ) const
     {
+
     HBufC* promptPtr = NULL;
     promptPtr = StringLoader::LoadL( aStringResID, aInt );
     CleanupStack::PushL( promptPtr );
@@ -922,6 +951,7 @@
 //
 void CCertSaverModel::AddToMessageL( TDes& aMessage, TInt aStringResID ) const
     {
+
     HBufC* promptPtr = NULL;
     promptPtr = StringLoader::LoadL( aStringResID );
     CleanupStack::PushL( promptPtr );
@@ -940,6 +970,7 @@
 //
 void CCertSaverModel::ConstructMessageL( TDes& aMessage ) const
     {
+
     HBufC16* issuerName = NULL;
     HBufC16* subjectName = NULL;
 
@@ -996,6 +1027,7 @@
 //
 void CCertSaverModel::AddKeyUsageL( TDes& aMessage, const CX509Certificate& aCert ) const
     {
+
     TKeyUsageX509 x509Usage = EX509UsageNone;
     TKeyUsagePKCS15 pkcs15KeyUsage = EPKCS15UsageNone;
     const CX509CertExtension* ext = aCert.Extension( KKeyUsage );
@@ -1079,6 +1111,7 @@
 void CCertSaverModel::AddValidityPeriodL(
     TDes& aMessage, const CX509Certificate& aCert ) const
     {
+
     // Hometime's offset to UTC
     TLocale locale;
     TTimeIntervalSeconds offSet = locale.UniversalTimeOffset();
@@ -1108,7 +1141,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 +1153,7 @@
 //
 void CCertSaverModel::AddNewlinesToMessage( TDes& aMessage ) const
     {
+
     aMessage.Append( KDoubleEnter );
     }
 
@@ -1130,6 +1164,7 @@
 //
 TBool CCertSaverModel::CertificateSupported() const
     {
+
     if ( iCertFormat == EX509Certificate &&
        ( iCertOwnerType == ECACertificate ||
          iCertOwnerType == EPeerCertificate ||
@@ -1151,19 +1186,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 +1211,7 @@
 //
 TBool CCertSaverModel::CertNotValidAnymore() const
     {
+
     TTime homeTime;
     homeTime.HomeTime();
     if ( iNewCert->ValidityPeriod().Finish() < homeTime )
@@ -1191,6 +1228,7 @@
 //
 TBool CCertSaverModel::CertNotValidYet() const
     {
+
     TTime homeTime;
     homeTime.HomeTime();
     if ( iNewCert->ValidityPeriod().Start() > homeTime )
@@ -1207,35 +1245,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 +1265,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 +1317,7 @@
 //
 TPtrC CCertSaverModel::CutCertificateField( TPtrC aField ) const
     {
+
     TInt fieldLength = aField.Length();
     if ( fieldLength >= KMaxLengthTextCertIdentifierVisible )
         {
@@ -1314,10 +1334,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,27 +1348,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)
         {
-        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;
     }
 
@@ -1361,6 +1404,7 @@
 //
 TInt CCertSaverModel::QueryTrustedSiteL()
     {
+
     TInt ret = KErrCancel;
     HBufC* label = NULL;
     HBufC* secondaryName = NULL;
@@ -1372,27 +1416,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;
     }
@@ -1407,6 +1443,7 @@
     RArray<TCertificateAppInfo>& aAppsInItemArray,
     CDesCArray& aItemsArray ) const
   {
+
     for ( TInt i = 0; i < aApps.Count(); i++ )
         {
         TCertificateAppInfo appInfo = aApps[ i ];
@@ -1469,6 +1506,7 @@
 //
 void CCertSaverModel::DivideToBlocks( const TDesC8& aInput, TDes& aOutput ) const
     {
+
     _LIT( KBlockSeparator, " " );
     const TInt KBlockLength = 2;
     TInt blockIndex = 0;
@@ -1491,25 +1529,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 )
         {
@@ -1542,42 +1592,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();
+*/
     }
 
 // ----------------------------------------------------------
@@ -1591,6 +1627,7 @@
     TInt aUserCerts,
     TInt aCACerts ) const
     {
+
     if ( aPrivateKeys > 0 )
         {
         if ( aPrivateKeys == 1 )
--- a/pkiutilities/CertSaver/src/certparser.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/pkiutilities/CertSaver/src/certparser.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -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 <aknnotewrappers.h>              // Note dialogs text, TODO: could be removed after localization is ready
 #include <apmrec.h>
 #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/StubSIS/swipolicy.ini	Thu Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-ClientAuthDlgEnabled = true
-
--- a/pkiutilities/group/bld.inf	Thu Jun 17 12:11:51 2010 +0100
+++ b/pkiutilities/group/bld.inf	Thu Jul 22 16:43:28 2010 +0100
@@ -27,19 +27,12 @@
 ../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/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/DevToken.iby             CORE_MW_LAYER_IBY_EXPORT_PATH( DevToken.iby )
--- a/pkiutilities/ocsp/group/securitysrv_ocsp.mrp	Thu Jun 17 12:11:51 2010 +0100
+++ b/pkiutilities/ocsp/group/securitysrv_ocsp.mrp	Thu Jul 22 16:43:28 2010 +0100
@@ -1,19 +1,3 @@
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description: 
-#
-
 component	securitysrv_ocsp
 source	\sf\mw\securitysrv\pkiutilities\ocsp
 binary	\sf\mw\securitysrv\pkiutilities\ocsp\group all
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkiutilities/pkiutilities.pro	Thu Jul 22 16:43:28 2010 +0100
@@ -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/StubSIS.iby	Thu Jun 17 12:11:51 2010 +0100
+++ b/pkiutilities/rom/StubSIS.iby	Thu Jul 22 16:43:28 2010 +0100
@@ -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/untrustedcertificatedialog/inc/untrustedcertificatedefinitions.h	Thu Jul 22 16:43:28 2010 +0100
@@ -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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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	Thu Jul 22 16:43:28 2010 +0100
@@ -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	Thu Jul 22 16:43:28 2010 +0100
@@ -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	Thu Jul 22 16:43:28 2010 +0100
@@ -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	Thu Jul 22 16:43:28 2010 +0100
@@ -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	Thu Jul 22 16:43:28 2010 +0100
@@ -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	Thu Jul 22 16:43:28 2010 +0100
@@ -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	Thu Jul 22 16:43:28 2010 +0100
@@ -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	Thu Jul 22 16:43:28 2010 +0100
@@ -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	Thu Jul 22 16:43:28 2010 +0100
@@ -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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,163 @@
+/*
+* 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>
+#include <QDebug>
+
+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;
+    qDebug() << "fixing Certificatedialog.length() to 63";
+    QString certificateDetails = mCertificateInfo->certificateDetails(mServerName).left(63);
+    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	Thu Jul 22 16:43:28 2010 +0100
@@ -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	Thu Jul 22 16:43:28 2010 +0100
@@ -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	Thu Jul 22 16:43:28 2010 +0100
@@ -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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,189 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,43 @@
+;
+; Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+; 
+; Description:  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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,36 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+# 
+# Description:  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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Thu Jul 22 16:43:28 2010 +0100
@@ -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	Thu Jul 22 16:43:28 2010 +0100
@@ -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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Thu Jul 22 16:43:28 2010 +0100
@@ -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	Thu Jul 22 16:43:28 2010 +0100
@@ -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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,19 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Thu Jul 22 16:43:28 2010 +0100
@@ -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	Thu Jul 22 16:43:28 2010 +0100
@@ -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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,58 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:  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/secsrv_plat/security_code_ui_api/inc/SecUi.h	Thu Jun 17 12:11:51 2010 +0100
+++ b/secsrv_plat/security_code_ui_api/inc/SecUi.h	Thu Jul 22 16:43:28 2010 +0100
@@ -21,6 +21,12 @@
 #ifndef     __SECUI_H
 #define     __SECUI_H
 
+#if defined(__SECUI_H)
+#define RDEBUG( x, y ) RDebug::Printf( "%s %s (%u) %s=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, x, y );
+#else
+#define RDEBUG( x, y )
+#endif
+
 class TSecUi
 	{
 	public:
@@ -36,12 +42,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 +75,7 @@
 	private:
 		TInt iResourceFileOffset;
         TInt iClientCount;
+        TInt iDialogOpened;
 
 	};
 #endif
--- a/secsrv_plat/security_code_ui_api/inc/SecUiCodeQueryDialog.h	Thu Jun 17 12:11:51 2010 +0100
+++ b/secsrv_plat/security_code_ui_api/inc/SecUiCodeQueryDialog.h	Thu Jul 22 16:43:28 2010 +0100
@@ -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 Jun 17 12:11:51 2010 +0100
+++ b/secsrv_plat/security_code_ui_api/inc/SecUiSecurityHandler.h	Thu Jul 22 16:43:28 2010 +0100
@@ -112,7 +112,15 @@
         */
         void RemoveSplashScreenL() const;
         
+        /**
+        *  ShowGenericErrorNoteL
+        */
         void ShowGenericErrorNoteL(TInt aStatus);
+        /**
+        *  CancelOpenQuery
+        */
+			TInt CancelOpenQuery(TInt aStatus);
+
 	private: // DATA
 		/*****************************************************
 		*	Series 60 Customer / ETel
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/Autolock.loc	Thu Jul 22 16:43:28 2010 +0100
@@ -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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,61 @@
+#
+# 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
+
+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
+
+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/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"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/Autolock.qrc	Thu Jul 22 16:43:28 2010 +0100
@@ -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	Thu Jul 22 16:43:28 2010 +0100
@@ -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	Thu Jul 22 16:43:28 2010 +0100
@@ -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	Thu Jul 22 16:43:28 2010 +0100
@@ -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	Thu Jul 22 16:43:28 2010 +0100
@@ -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 Jun 17 12:11:51 2010 +0100
+++ /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	Thu Jul 22 16:43:28 2010 +0100
@@ -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 Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/Autolock/PubSub/SecurityUIsPrivatePSKeys.h	Thu Jul 22 16:43:28 2010 +0100
@@ -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 Jun 17 12:11:51 2010 +0100
+++ /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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,26 @@
+<?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="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>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/autolockuseractivityservice.pro	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,19 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+# 
+# Description: autolockuseractivityservice.pro
+#
+
+TEMPLATE = subdirs
+
+SUBDIRS += autolockuseractivityservice/autolockuseractivityservice.pro
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/autolockuseractivityservice/autolockuseractivityservice.pri	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,26 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+# 
+# Description: 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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,32 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+# 
+# Description: 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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,24 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+# 
+# Description: 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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,24 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+# 
+# Description: 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	Thu Jul 22 16:43:28 2010 +0100
@@ -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	Thu Jul 22 16:43:28 2010 +0100
@@ -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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,66 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 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	Thu Jul 22 16:43:28 2010 +0100
@@ -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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,143 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,58 @@
+// ============================================================================
+// * Makefile for building: Autolock
+// * Generated by qmake (2.01a) (Qt 4.6.3) on: 2010-05-24T09:03:29
+// * This file is generated by qmake and should not be modified by the
+// * user.
+// * Project:  Autolock.pro
+// * Template: app
+// ============================================================================
+
+#define BLD_INF_AUTOLOCK_04D5822F
+
+
+prj_platforms
+
+WINSCW GCCE ARMV5 ARMV6
+
+
+prj_mmpfiles
+
+Autolock_0x100059B5.mmp
+
+prj_extensions
+
+START EXTENSION qt/qmake_extra_pre_targetdep.export
+OPTION PREDEP_TARGET E:/sf/mw/securitysrv/securitydialogs/Autolock/moc_Autolock.cpp
+OPTION DEPS E:/sf/mw/securitysrv/securitydialogs/SecUi/Inc/SecQueryUi.h E:/sf/mw/securitysrv/securitydialogs/Autolock/src/Autolock.h 
+OPTION COMMAND /epoc32/tools/moc  -DSYMBIAN  -DUNICODE -DQT_KEYPAD_NAVIGATION -DQT_SOFTKEYS_ENABLED -DQT_USE_MATH_H_FLOATS -DHB_GESTURE_FW -DHB_EFFECTS -DHB_TEXT_MEASUREMENT_UTILITY -DQT_SVG_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB  -I"E:/epoc32/include/mw/QtCore"  -I"E:/epoc32/include/mw/QtNetwork"  -I"E:/epoc32/include/mw/QtGui"  -I"E:/epoc32/include/mw/QtSvg"  -I"E:/epoc32/include/mw"  -I"E:/epoc32/include/mw/QtPublishSubscribe"  -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"  -I"E:/sf/mw/securitysrv/securitydialogs/Autolock/inc"  -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/platform/loc"  -I"E:/epoc32/include/platform/mw/loc"  -I"E:/epoc32/include/platform/loc/sc"  -I"E:/epoc32/include/platform/mw/loc/sc"  -I"E:/epoc32/include/mw/hb/hbcore"  -I"E:/epoc32/include/mw/hb/hbwidgets"  -I"E:/epoc32/include/mw/hb/hbutils"  -I"E:/epoc32/include/stdapis/stlportv5"  -I"E:/epoc32/include/app"  -I"E:/epoc32/include/platform/app"  -I"E:/epoc32/include/platform/app/loc"  -I"E:/epoc32/include/platform/app/loc/sc"  -I"E:/sf/mw/securitysrv/securitydialogs/Autolock/src" -DSYMBIAN e:/sf/mw/securitysrv/securitydialogs/Autolock/src/Autolock.h -o e:/sf/mw/securitysrv/securitydialogs/Autolock/moc_Autolock.cpp
+END
+START EXTENSION qt/qmake_extra_pre_targetdep.export
+OPTION PREDEP_TARGET E:/sf/mw/securitysrv/securitydialogs/Autolock/qrc_Autolock.cpp
+OPTION DEPS E:/sf/mw/securitysrv/securitydialogs/Autolock/Autolock.qrc 
+OPTION COMMAND /epoc32/tools/rcc -name Autolock e:/sf/mw/securitysrv/securitydialogs/Autolock/Autolock.qrc -o e:/sf/mw/securitysrv/securitydialogs/Autolock/qrc_Autolock.cpp
+END
+
+#if defined(WINSCW)
+START EXTENSION qt/qmake_emulator_deployment
+OPTION DEPLOY_SOURCE e:/sf/mw/securitysrv/securitydialogs/Autolock/autolock.qcrml
+OPTION DEPLOY_TARGET E:/epoc32/winscw/c/resource/qt/crml/autolock.qcrml
+END
+#endif
+START EXTENSION qt/qmake_emulator_deployment
+OPTION DEPLOY_SOURCE e:/sf/mw/securitysrv/securitydialogs/Autolock/autolock.qcrml
+OPTION DEPLOY_TARGET E:/epoc32/data/z/resource/qt/crml/autolock.qcrml
+END
+
+START EXTENSION qt/qmake_store_build
+END
+
+
+START EXTENSION qt/qtextensions_pre_targetdep.export
+OPTION PREDEP_TARGET Autolock_reg.rss
+OPTION COMMAND xqsreg.exe Autolock 0x100059B5 service_conf.xml Autolock_reg.rss embeddable hidden
+END
+
+
+prj_exports
+
+./rom/Autolock.iby CORE_APP_LAYER_IBY_EXPORT_PATH(Autolock.iby)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/bwins/autolockuseractivityserviceu.def	Thu Jul 22 16:43:28 2010 +0100
@@ -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/CI_Autolock.confml has changed
Binary file securitydialogs/Autolock/conf/autolock.confml has changed
Binary file securitydialogs/Autolock/conf/autolock_102824AE.crml has changed
Binary file securitydialogs/Autolock/conf/lock.confml has changed
Binary file securitydialogs/Autolock/conf/lock_10283322.crml has changed
--- a/securitydialogs/Autolock/data/Autolock.rss	Thu Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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	Thu Jul 22 16:43:28 2010 +0100
@@ -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 Jun 17 12:11:51 2010 +0100
+++ /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 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   secui.lib 
-
-
-SMPSAFE
--- a/securitydialogs/Autolock/group/Autolock_Icons_dc.mk	Thu Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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	Thu Jul 22 16:43:28 2010 +0100
@@ -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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +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 CAutoKeyguardObserver : public CBase
-	{
-	public:
-		/**
-        * Creates instance of the CAutoKeyguardObserver class.
-        *
-		* @return Returns the instance just created.
-        */
-		static CAutoKeyguardObserver* NewL();
-		/**
-        * 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(); 
-	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;
-	};
-#endif
-// END OF FILE
--- a/securitydialogs/Autolock/inc/AutoLockCenRepI.h	Thu Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +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;
-        RTelServer      iServer; // EMKK-7N3G7R
-        CWait*			 		wait;	// EMKK-7N3G7R
-    };
-
-#endif 
-// End of file
--- a/securitydialogs/Autolock/inc/AutoLockModelPS.h	Thu Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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/AutolockAppUiPS.h	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,268 +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"
-
-// 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 MAutolockGripStatusObserver,
-                       public MAutolockFpsStatusObserver
-    {
-    public: // // Constructors and destructor
-
-        /**
-        * Symbian OS default constructor.
-        */      
-        void ConstructL();
-
-        /**
-        * Destructor.
-        */      
-        ~CAutolockAppUi();
-        
-        /**
-         * From MAutolockGripStatusObserver
-         */
-        TBool DeviceLockQueryStatus();
-        
-        TBool DeviceLockStatus();
-
-        /**
-         * 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;
-	};
-
-	inline CAutoLockModel* CAutolockAppUi::Model() const
-		{return iModel;}
-
-#endif
-
-// End of File
--- a/securitydialogs/Autolock/inc/AutolockContainer.h	Thu Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +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>
-
-//CONSTANTS
-const TInt KCancelKeyCode( 165 );
-
-class MAutolockGripStatusObserver
-    {
-    public:
-        /**
-         * Implement this method to be notified when grip status
-         * changes.
-         */
-        IMPORT_C virtual TInt DeviceLockQueryStatus() = 0;
-        IMPORT_C virtual TInt DeviceLockStatus() = 0;
-    };
-
-class CAutolockGripStatusObserver : public CActive
-    {
-    public:
-        IMPORT_C static CAutolockGripStatusObserver* NewL( MAutolockGripStatusObserver* aObserver, RWsSession& aSession );
-
-        void RunL();
-        void DoCancel();
-        ~CAutolockGripStatusObserver();
-    
-    private:
-        void ConstructL( MAutolockGripStatusObserver* aObserver );   
-        CAutolockGripStatusObserver( RWsSession& aSession );
-        void GripStatusChangedL( TInt aGripStatus );
-
-    private:
-        MAutolockGripStatusObserver* iObserver;
-        RProperty iGripStatus;
-        RWsSession& iSession;
-    };
-
-
-#endif 
--- a/securitydialogs/Autolock/inc/AutolockView.h	Thu Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,1 @@
+This file is a Qt plugin stub file. The real Qt plugin is located in /sys/bin. Created:2010-05-17T09:17:32
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/Autolock/indicatorplugin/rom/indicatorautolockplugin.iby	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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 Jun 17 12:11:51 2010 +0100
+++ /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	Thu Jul 22 16:43:28 2010 +0100
@@ -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	Thu Jul 22 16:43:28 2010 +0100
@@ -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	Thu Jul 22 16:43:28 2010 +0100
@@ -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	Thu Jul 22 16:43:28 2010 +0100
@@ -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 Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/Autolock/rom/Autolock.iby	Thu Jul 22 16:43:28 2010 +0100
@@ -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_RESOURCE(Autolock)
 
-#endif
+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
+
+// 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=ZPRIVATE\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 Jun 17 12:11:51 2010 +0100
+++ /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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,22 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#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	Thu Jul 22 16:43:28 2010 +0100
@@ -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	Thu Jul 22 16:43:28 2010 +0100
@@ -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	Thu Jul 22 16:43:28 2010 +0100
@@ -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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,441 +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"
-
-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()
-	{
-	#ifdef RD_AUTO_KEYGUARD
-	#if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutoKeyguardObserver::NewL() BEGIN"));
-    #endif
-	CAutoKeyguardObserver* self = new (ELeave) CAutoKeyguardObserver();
-	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()	
-	{
-	}
-
-//
-// ----------------------------------------------------------
-// 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;
-    //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;
-		/* This is not used any more because screensavers are removed now
-	  RProperty::Get(KPSUidScreenSaver, KScreenSaverOn, value);
-    screenSaverOn = (value == KSsOn);
-    */
-    screenSaverOn = ETrue;
-    
-		/* This is not used any more because screensavers are removed now
-    value = 0;
-    RProperty::Get(KPSUidScreenSaver, KScreenSaverActivatedFromIdle, value);
-    screenSaverStertedFromIdle = (value == KSsStartedFromIdle);
-    */
-    screenSaverStertedFromIdle = ETrue;
-    
-    //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
-    if (startupOver)
-        {
-        // 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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,145 +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 <SCPClient.h>	// EMKK-7N3G7R
-#include		<startupdomainpskeys.h>	// EMKK-7N3G7R
-#include <mmtsy_names.h>	// EMKK-7N3G7R 
-#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();
-#ifdef FF_STARTUP_OMA_DM_SUPPORT	// New booting order	Start	EMKK-7N3G7R			
-		delete wait;
-		if (iServer.Handle())
-			{						
-				iServer.UnloadPhoneModule(KMmTsyModuleName);
-				iServer.Close();
-			}
-#endif	// End EMKK-7N3G7R	
-		}
-//
-// ----------------------------------------------------------
-// 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 Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,445 +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 == EAutolockStatusUninitialized )
-	{
-			RProperty::Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus,	EAutolockStatusUninitialized);
-	}
-	else
-	{
-	    RProperty::Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus,	EAutolockOff);
-  }
-       
-    #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;
-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;
-    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();
-		// 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
-        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 Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,131 +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"
-
-
-// ================= 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();
-    return KErrNone;
-    }
-//
-// ----------------------------------------------------------
-// CValueObserver::Stop()
-// Stops listening KUidCurrentCall event 
-// ----------------------------------------------------------
-//
-void CValueObserver::Stop()
-	{
-	Cancel();
-	}
-//
-// ----------------------------------------------------------
-// CLockObserver::CLockObserver()
-// C++ constructor
-// ----------------------------------------------------------
-// 
-CValueObserver::CValueObserver(CAutolockAppUi* aAppUi) : CActive(0), iAppUi(aAppUi)
-	{                            
-    }
-//
-// ----------------------------------------------------------
-// CLockObserver::ConstructL()
-// Symbian OS default constructor
-// ----------------------------------------------------------
-// 
-void CValueObserver::ConstructL()
-    {
-    // Add this active object to the scheduler.
-	CActiveScheduler::Add(this);	
-    }
-//
-// ----------------------------------------------------------
-// CValueObserver::RunL()
-// 
-// ----------------------------------------------------------
-// 
-void CValueObserver::RunL()
-	{
-    TInt callState;
-    iProperty.Get( callState );
-    if (callState == EPSCTsyCallStateNone && !iAppUi->IsForeground())
-        {
-		// app back to foreground
-		iAppUi->BringAppToForegroundL();
-		}
-    else
-		{
-		Start();
-		}
-	
-	}
-//
-// ----------------------------------------------------------
-// CValueObserver::DoCancel()
-// Cancels event listening
-// ----------------------------------------------------------
-// 
-void CValueObserver::DoCancel()
-    {
-    iProperty.Cancel();
-    }
-
-// End of file
--- a/securitydialogs/Autolock/src/AutoLockView.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ /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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,1658 @@
+/*
+* 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 <QCoreApplication>
+#include <QKeyEvent>
+#include <QEvent>
+#include <QLabel>
+#include <QVBoxLayout>
+#include <QStackedWidget>
+#include <QImageReader>
+#include <QTimer>
+#include <QPushButton>
+#include <QLineEdit>
+#include <QListView>
+#include <QMessageBox>
+#include <QToolButton>
+#include <QSymbianEvent>
+#include <QMainWindow>
+#include <qvaluespacesubscriber.h>
+#include <qvaluespacepublisher.h>
+
+QTM_USE_NAMESPACE
+
+#include <HbIndicator>
+#include <hbdevicemessagebox.h>
+
+#include <lockappclientserver.h>
+
+#include <xqsharablefile.h>
+
+#include <QGraphicsLinearLayout>
+
+#include <hblabel.h>
+
+#include "Autolock.h"
+#include <xqserviceutil.h>
+
+#include "autolockuseractivityservice.h"
+
+#include <settingsinternalcrkeys.h>		// CenRep keys
+#include <w32std.h>
+#include <eikenv.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 <hbdevicedialog.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";
+static const int KSnsrViewTypeValueActive = 1;
+static const int KSnsrViewTypeValueStandby = 2;
+static const char *KSnsrCmdUnlock = "unlock";
+
+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, readPolicy,
+            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;
+
+    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()));
+
+
+    // 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);
+    groupWin.CaptureKey(EKeyDeviceF, 0, 0);
+    groupWin.CaptureKey(EKeyBell, 0, 0);
+    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();
+
+    // screensaver standby mode timer
+    mScreensaverModeTimer = new QTimer( this );
+    mScreensaverModeTimer->setInterval( 5*1000 ); // milliseconds, TODO: read from cenrep
+    connect( mScreensaverModeTimer, SIGNAL(timeout()), SLOT(switchScreensaverToPowerSaveMode()) );
+    }
+
+Autolock::~Autolock()
+    {
+    RDEBUG("0", 0);
+    delete mService;
+    delete mScreensaverModeTimer;
+    RDEBUG("1", 1);
+    }
+
+void Autolock::adjustInactivityTimers(int aReason)
+    {
+    RDEBUG("aReason", aReason);
+    TInt keyguardTime = 0;
+    TInt lockTime = 0;
+    CRepository* repository = NULL;
+    TInt cRresult = 0;
+
+    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);
+    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);
+        QT_TRAP_THROWING( validCode = handler->AskSecCodeInAutoLockL() ); // this returns true/false
+        // 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 for 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 (secUiOriginatedQuery
+                    != ESecurityUIsSecUIOriginatedUninitialized
+                    && secUiOriginatedQuery
+                            != ESecurityUIsSystemLockOriginated)
+                {
+                // PIN on top and trying to display unlock-code. This is valid
+                }
+            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:
+                    return KErrPermissionDenied;
+                }
+            }
+            break;
+        default:
+            {
+            RDEBUG("default iLockStatus", iLockStatus);
+            return KErrPermissionDenied;
+            }
+            // break;
+        } // switch
+    return KErrPermissionDenied;
+    }
+
+int Autolock::publishStatus(int aReason)
+    {
+    RDEBUG("aReason", aReason);
+    TInt 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;
+    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);
+		// These do nothing. The reason are:
+		// - the screensaver already displays/hides
+		// - the notes are shown behing the icon because they have lower priorities
+		// - they are annoying
+    if (aReason == ELockNotActive)
+        {
+        if (iShowKeyguardNote == 1)
+            {
+            // HbDeviceMessageBox::information("Keyguard deactivated");
+            }
+        }
+    else if (aReason == EKeyguardActive)
+        {
+        if (iShowKeyguardNote == 1)
+            {
+            // HbDeviceMessageBox::information("Keyguard activated");
+            }
+        }
+    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;
+		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)
+                {
+                setLabelIcon( EKeyguardActive);
+                updateIndicator(EKeyguardActive);
+                publishStatus(EKeyguardActive);
+                showNoteIfRequested(EKeyguardActive);
+                setLockDialog(aReason, 1);
+                }
+            }
+            break;
+        case ELockAppDisableKeyguard: // 2
+            {
+            errorInProcess = CheckIfLegal(ret);
+            DebugError(errorInProcess);
+            if (errorInProcess == KErrNone)
+                {
+                setLabelIcon( ELockNotActive);
+                updateIndicator(ELockNotActive);
+                publishStatus(ELockNotActive);
+                showNoteIfRequested(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
+        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);
+            disconnect( iDeviceDialog, SIGNAL(dataReceived(QVariantMap)), this, SLOT(handleMessageFromScreensaver(QVariantMap)) );
+            RDEBUG("signal disconnected", err);
+            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);
+            RDEBUG("deleting iDeviceDialog", 0);
+            delete iDeviceDialog;
+            RDEBUG("deleted iDeviceDialog", 1);
+            iDeviceDialog = NULL;
+            }
+        }
+    else if (status == 1) // show
+        {
+        // 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)) );
+            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);
+        err = iDeviceDialog->show(KScreensaverDeviceDialog, params); // and continue processing
+        RDEBUG("post show. err", err);
+        err = iDeviceDialog->error();
+        RDEBUG("iDeviceDialog->error", err);
+        if(!err)
+        	{
+        	iDeviceDialogCreated = EDeviceDialogScreenSaver;
+        	RDEBUG("new iDeviceDialogCreated", iDeviceDialogCreated);
+        	switchScreensaverToActiveMode();	// this is needed in case the dialog was existing.
+        	}
+        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 );
+				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
+        {
+        ret = TryChangeStatus(ELockAppEnableKeyguard);
+        RDEBUG("ret", ret);
+        }
+    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)
+        	switchScreensaverToActiveMode();
+        }
+    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;
+    DebugStatus( iLockStatus);
+    if (iLockStatus == ELockNotActive || iLockStatus == EKeyguardActive) // not possible if it's locked
+        {
+        ret = TryChangeStatus(ELockAppEnableDevicelock);
+        }
+    RDEBUG("ret", ret);
+
+    }
+
+void Autolock::switchScreensaverToActiveMode()
+    {
+    RDEBUG("0", 0);
+    if ( iDeviceDialog )
+        {
+        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, KSnsrViewTypeValueActive );
+        
+        // when screesanver triggers, set the lights. DeviceDialogs does it only on creation, not on update.
+		    TInt err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsLights, ESecurityUIsLightsQueryOnRequest);
+				RDEBUG("KSecurityUIsLights err", err);
+
+        iDeviceDialog->update(params);
+        
+        // (re)start timer to switch to the power save mode
+        if ( mScreensaverModeTimer )
+            {
+            RDEBUG("start mScreensaverModeTimer", 0);
+            mScreensaverModeTimer->start();
+            }
+        }
+    RDEBUG("1", 1);
+    }
+
+void Autolock::switchScreensaverToPowerSaveMode()
+    {
+    RDEBUG("0", 0);
+    if ( iDeviceDialog )
+        {
+        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, KSnsrViewTypeValueStandby );
+        iDeviceDialog->update(params);
+        
+        if ( mScreensaverModeTimer )
+            {
+            RDEBUG("stop mScreensaverModeTimer", 0);
+            mScreensaverModeTimer->stop();
+            }
+        }
+    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();
+        }
+    }
+
+// 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());
+            if ( keyEvent->nativeScanCode() == EStdKeyApplication0 || keyEvent->nativeScanCode() == EStdKeyDevice2 )
+              {
+              // 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
+              switchScreensaverToActiveMode();
+              }
+            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
+    return QWidget::event(ev);
+    }
+
+void Autolock::handleLockSwitch()
+    {
+    
+    int ret = KErrNone;
+    DebugStatus( iLockStatus);
+    if (iLockStatus == ELockNotActive)
+        {
+        iShowKeyguardNote = 1; // note on enable keyguard
+        callerHasECapabilityWriteDeviceData = 1;
+        ret = TryChangeStatus(ELockAppEnableKeyguard); // this should not ask confirmation
+        }
+    else if (iLockStatus == EKeyguardActive)
+        {
+        iShowKeyguardNote = 1; // note on disable keyguard
+        callerHasECapabilityWriteDeviceData = 1;
+        ret = TryChangeStatus(ELockAppDisableKeyguard);
+        }
+    else if (iLockStatus == EDevicelockActive)
+        {
+        callerHasECapabilityWriteDeviceData = 1;
+        ret = TryChangeStatus(ELockAppDisableDevicelock);
+        }
+    else
+        {
+        RDEBUG("unknown iLockStatus", iLockStatus);
+        }
+    RDEBUG("ret", 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;
+    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 = 1; // note on disable keyguard
+          ret = TryChangeStatus(ELockAppDisableKeyguard);
+          }
+      else if (iLockStatus == EDevicelockActive)
+          {
+          ret = TryChangeStatus(ELockAppDisableDevicelock);
+          }
+      }
+    else if( aGripStatus == EPSHWRMGripClosed )
+    	{
+      if (iLockStatus == ELockNotActive)
+          {
+          iShowKeyguardNote = 1; // note on enable keyguard
+          ret = TryChangeStatus(ELockAppEnableKeyguard);
+          }
+    	}
+    }
+// 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);
+    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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,237 @@
+/*
+* 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 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 subscriberKSecurityUIsDismissDialogChanged();
+
+private slots:
+    void activeKeyguard();
+    void notActiveKeyguard();
+    void activeDevicelock();
+    void notActiveDevicelock();
+    void switchScreensaverToActiveMode();
+    void switchScreensaverToPowerSaveMode();
+    void handleMessageFromScreensaver( const QVariantMap &data );
+    void 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 *subscriberKSecurityUIsDismissDialog;
+
+		AutolockUserActivityService* serviceKeyguard;
+		AutolockUserActivityService* serviceDevicelock;
+		
+		int iLockStatus;
+		int iLockStatusPrev;
+		CSecQueryUi *iSecQueryUi;
+		int iSecQueryUiCreated;
+		HbDeviceDialog *iDeviceDialog;
+		int iDeviceDialogCreated;
+    TInt32 mPowerKeyCaptureHandle;
+    TInt32 mApplicationKeyCaptureHandle;
+    TInt32 mApplicationLongKeyCaptureHandle;
+    
+    QTimer *mScreensaverModeTimer;
+};
+
+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	Thu Jul 22 16:43:28 2010 +0100
@@ -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 Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +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>
-#include <apgcli.h>
-#include <apgtask.h>
-#include <coemain.h>
-#include <apacmdln.h>
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ---------------------------------------------------------
-// CAutolockApp::AppDllUid()
-// Returns application UID
-// ---------------------------------------------------------
-//
-TUid CAutolockApp::AppDllUid() const
-    {
-    return KUidAutolock;
-    }
-
-// ---------------------------------------------------------
-// CAutolockApp::CreateDocumentL()
-// Creates CAutolockDocument object
-// ---------------------------------------------------------
-//
-CApaDocument* CAutolockApp::CreateDocumentL()
-    {
-    RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-    return CAutolockDocument::NewL( *this );
-    }
-
-// ================= OTHER EXPORTED FUNCTIONS ==============
-//
-
-LOCAL_C CApaApplication* NewApplication()
-    {
-    	RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-
-    TInt use_old_autolock=1;
-    if(use_old_autolock)
-    	{
-			// start autolocksrv instead of autolock . This is a backup solution to use in case that not all SysAp and Avkon changes are implemented
-	 	  RDebug::Printf( "%s %s (%u) 1=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0x1 );
-	 	  CCoeEnv *env = CCoeEnv::Static();
-	    TApaTaskList taskList( env->WsSession() );
-	    RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-    	const TUid KAutolockSrvAppUid = { 0xE0022E73 };
-	    TApaTask task( taskList.FindApp( KAutolockSrvAppUid ) );
-	    RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-	    if ( !task.Exists() )
-	        {
-	    		RDebug::Printf( "%s %s (%u) no KAutolockSrvAppUid found. Creating=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-	        RApaLsSession ls;                   
-	        User::LeaveIfError(ls.Connect());   
-	        CleanupClosePushL(ls);         
-	        
-	        CApaCommandLine* commandLine = CApaCommandLine::NewLC();
-	        commandLine->SetExecutableNameL( _L("autolocksrv.exe" ) );     
-	        commandLine->SetCommandL( EApaCommandRun );
-	        
-		    // Try to launch the application.        
-	        User::LeaveIfError(ls.StartApp(*commandLine));
-	    	  RDebug::Printf( "%s %s (%u) autolocksrv.exe created=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0x7 );
-	        
-	        CleanupStack::PopAndDestroy(2); // commandLine, ls
-			}
-	   }
-		RDebug::Printf( "%s %s (%u) exiting=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0x1 );
-    return new CAutolockApp;
-    }
-
-GLDEF_C TInt E32Main()
-    {
-    RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-
-    return EikStart::RunApplication(NewApplication);
-    }
-
-// End of File  
-
--- a/securitydialogs/Autolock/src/AutolockAppUi.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1060 +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>
-
-//  LOCAL CONSTANTS AND MACROS  
-#define KSysApUid TUid::Uid(0x100058F3)
-
-const TInt KTriesToConnectServer( 2 );
-const TInt KTimeBeforeRetryingServerConnection( 50000 );
-const TInt PhoneIndex( 0 );
-
-// ================= MEMBER FUNCTIONS =======================
-//
-// ----------------------------------------------------------
-// CAutolockAppUi::ConstructL()
-// ?implementation_description
-// ----------------------------------------------------------
-//
-void CAutolockAppUi::ConstructL()
-    {
-    	RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-    		
-	#if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::ConstructL"));
-    #endif
-    
-   	RDebug::Printf( "%s %s (%u) EAutolockOff=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, EAutolockOff );
-    RProperty::Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, EAutolockOff);
-
-    BaseConstructL( EAknEnableSkin | EAknEnableMSK );
-    
-	}
-// ----------------------------------------------------
-// CAutolockAppUi::~CAutolockAppUi()
-// Destructor
-// Frees reserved resources
-// ----------------------------------------------------
-//
-CAutolockAppUi::~CAutolockAppUi()
-    {
-    RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-    #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();
-        }
-  RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-	delete iModel;
-	delete iPhoneObserver;
-	delete iIncallBubble;
-RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-	#ifdef RD_AUTO_KEYGUARD
-	delete iKeyguardObserver;
-#endif
-
-    delete iEcsDetector;
-    delete iEcsNote; // Ecs change
-	RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-	  delete iWait;
-    FeatureManager::UnInitializeLib();
-    delete iGripStatusObserver;
-    delete iFpsStatusObserver;
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(AUTOLOCK)CAutolockAppUi::~CAutolockAppUi() END"));
-    #endif
-RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-		}
-// ----------------------------------------------------
-// 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();			
-			}
-		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
-			TApaTask self(iCoeEnv->WsSession());
-			self.SetWgId(iCoeEnv->RootWin().Identifier());
-			self.BringToForeground();		
-			}
-		else
-			{
-			// unlock voice key while there is active call
-			UnLockSideKey();
-			}
-		}
-
-	CAknAppUi::HandleForegroundEventL(aForeground);
-	
-	}
-	
-
-// ----------------------------------------------------
-// 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 )
-        {        
-        // 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;
-                  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)
-    {
-    RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-		}
-// ----------------------------------------------------
-// CAutolockAppUi::HandleKeyEventL(
-//     const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
-// ----------------------------------------------------
-//
-TKeyResponse CAutolockAppUi::HandleKeyEventL(
-    const TKeyEvent& aKeyEvent,TEventCode aType)
-    {
-	if ( aKeyEvent.iCode == EKeyBell)
- 		{
- 		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);
-        }
-    }
-
-// ----------------------------------------------------
-// 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)
-// ----------------------------------------------------
-//
-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:
-			{
-			RDebug::Printf( "%s %s (%u) ESecUiCmdUnlock is not longer handled by Autolock=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, ESecUiCmdUnlock );
-
-			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 (callState != EPSCTsyCallStateNone )
-                {
-    		    iModel->SetLockedL(EFalse);
-    		    iModel->ResetInactivityTimeout();
-    		    UnLockKeys();
-    		    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"));
-		#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());
-   			#define KPhoneAppUid TUid::Uid(0x100058B3)
-
-   			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();
-       	}
-			}	
-	
-	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)
-	  {
-	  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();
-		#if defined(_DEBUG)
-		RDebug::Printf( "%s %s (%u) searching for popupclock.exe =%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0x0 );
-		#endif
-		TApaTaskList taskList( CCoeEnv::Static()->WsSession() );
-		const TUid KBigClockUid = { 0x2000FDC3 };
-		TApaTask task( taskList.FindApp( KBigClockUid ) );
-		if ( task.Exists() )
-			{
-			#if defined(_DEBUG)
-			RDebug::Printf( "%s %s (%u) popupclock.exe is running. Not capturing EStdKeyApplication0=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, EStdKeyApplication0 );
-			#endif
-			}
-		else
-			{
-			#if defined(_DEBUG)
-			RDebug::Printf( "%s %s (%u) popupclock.exe not running. Not capturing EStdKeyApplication0=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, EStdKeyApplication0 );
-			#endif
-			iAppKey = groupWin.CaptureKeyUpAndDowns(EStdKeyApplication0, 0, 0); // Capture app key
-			}
-		}
-	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(EKeySide,0,0);
-		iSideKey2 = groupWin.CaptureKeyUpAndDowns(EStdKeyDevice6, 0, 0);
-		}
-	}
-
-// -------------------------------------------------------------------------------------------------------------
-// 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();
-    	
-    	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                      
-		                iIncallBubble->SetIncallBubbleAllowedInIdleL( ETrue );
-		            }
-		    	break;	
-    	    case EEventWindowGroupListChanged:
-    	        HandleWindowGroupListChange();
-    	        break;
-    	    case EEventPointer:
-    	    case EEventDragDrop:
-    	    		{
-    	    		TInt callState = 0;
-    	    		RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallState, callState );
-			        if ( 1==1 || callState == EPSCTsyCallStateNone || callState == EPSCTsyCallStateUninitialized )
-			        	{
-	    	        TPointerEvent *pointer = aEvent.Pointer();
-	    	          CAknView* view = View(KAutoLockViewId);
-								  if(view)
-								    {	
-								        STATIC_CAST(CAutolockView*, view)->ScreenDeviceChanged();
-								    	TRect aCallRect;
-								        STATIC_CAST(CAutolockView*, view)->HandleCall(1, aCallRect);
-   								    	if(aCallButtonRect.iBr.iX==0)
-   								    		aCallButtonRect = TRect (aCallRect);
-								    }
-	    	        if(pointer->iType==TPointerEvent::EButton1Up)
-	    	        	{
-		    	        TPoint iPosition = pointer->iPosition;
-						if(aCallButtonRect.iBr.iX<iPosition.iX && iPosition.iX<aCallButtonRect.iBr.iX+aCallButtonRect.iTl.iX && iPosition.iY<400 )
-	    		        	{
-	    		        		#define KPhoneAppUid1 TUid::Uid(0x100058B3)
-	    		        		TApaTaskList tasklist( iCoeEnv->WsSession() );
-                      TApaTask phonetask = tasklist.FindApp( KPhoneAppUid1 );
-	    		        		if ( phonetask.Exists() )
-                        {
-										    TRawEvent event;
-										    event.Set(TRawEvent::EKeyDown, EStdKeyNo);
-										    iEikonEnv->WsSession().SimulateRawEvent(event);
-                        					User::After(1000);
-										    event.Set(TRawEvent::EKeyUp, EStdKeyNo);
-										    iEikonEnv->WsSession().SimulateRawEvent(event);
-                        }
-	    		        	}
-	    		        }
-	    		      }
-    		      }
-    	        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)
-	    	        SendMessageToSysAp( EEikSecurityQueryLights );
-	    	        break;
-		    default:
-		    	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);    	
-    }
-
-TBool CAutolockAppUi::DeviceLockQueryStatus()
-    {
-    return iDeviceLockQueryStatus;
-    }
-
-TBool CAutolockAppUi::DeviceLockStatus()
-    {
-    return iLocked;
-    }
-
-TBool CAutolockAppUi::DeviceFpsLock(TInt iStatus)
-    {
-		if(iStatus)
-			HandleCommandL(ESecUiCmdUnlock);
-		else
-			iModel->SetLockedL(ETimerLocked);
-    return ETrue;
-    }
-void CAutolockAppUi::HandleWindowGroupListChange()
-    {
-    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 aCallRect;
-								        STATIC_CAST(CAutolockView*, view)->HandleCall(10, aCallRect);
-												if(aCallButtonRect.iBr.iX==0)
-   								    		aCallButtonRect = TRect (aCallRect);
-								    }
-        // 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
-            }                    
-        }  
-
-}
-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 Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,355 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-
-// 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 <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
-				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 callState = 0;
-  	  RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallState, callState );
-    if ( callState == EPSCTsyCallStateNone || callState == EPSCTsyCallStateUninitialized )
-    	{
-    	}
-    else
-    	{
-    	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
-    	  	{
-   	    	aCallRect_x=Rect().Width()/2 - iBitmapCall->SizeInPixels().iWidth/2;
-		    	aCallRect_y=Rect().Height() * 0.75;
-		    	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);
-    	  	aCallRect_y+=100;	// coordinates are realtive to TRect, not to Screen
-        	}
-        }
-    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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,139 +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"
-
-
-EXPORT_C CAutolockGripStatusObserver* CAutolockGripStatusObserver::NewL( MAutolockGripStatusObserver* aObserver, RWsSession& aSession )
-    {
-    CAutolockGripStatusObserver* self = new (ELeave) CAutolockGripStatusObserver( aSession );
-    CleanupStack::PushL( self );
-    self->ConstructL( aObserver );
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-void CAutolockGripStatusObserver::ConstructL( MAutolockGripStatusObserver* 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 
-    	if( !iObserver->DeviceLockQueryStatus() && iObserver->DeviceLockStatus() )
-    		{
-            #if defined(_DEBUG)
-        	RDebug::Print(_L("(AUTOLOCK)CAutolockGripStatusObserver::::GripStatusChangedL => send command"));
-        	#endif
-    	    //Grip opened
-        	TApaTaskList tasklist( iSession );
-        	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 );
-        	    }
-
-    		}
-        }
-    else
-        {
-        #if defined(_DEBUG)
-    	RDebug::Print(_L("(AUTOLOCK)CAutolockGripStatusObserver::::GripStatusChangedL => Grip closed"));
-    	#endif 
-        //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
-        	TRawEvent rawEvent;
-        	rawEvent.Set( TRawEvent::EKeyDown, KCancelKeyCode );
-        	iSession.SimulateRawEvent( rawEvent );        	
-            }
-        }
-    }
-
-// End of File
--- a/securitydialogs/Autolock/src/AutolockWait.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ /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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,96 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  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	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,66 @@
+/*
+* 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, readPolicy,
+            writePolicy);
+		qDebug() << "KSecurityUIsLockInitiatorUID ret=" << ret;
+		int 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/AutolockSrv/AutolockSrv.loc	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-// ============================================================================
-// * Generated by qmake (2.01a) (Qt 4.6.3) on: 2010-06-16T14:44:51
-// * This file is generated by qmake and should not be modified by the
-// * user.
-// ============================================================================
-
-#ifdef LANGUAGE_SC
-#define STRING_r_short_caption "AutolockSrv"
-#define STRING_r_caption "AutolockSrv"
-#else
-#define STRING_r_short_caption "AutolockSrv"
-#define STRING_r_caption "AutolockSrv"
-#endif
--- a/securitydialogs/AutolockSrv/AutolockSrv.pro	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-#
-# 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=AutolockSrv
-
-CONFIG += service
-
-CONFIG += Hb
-
-CONFIG += mobility
-MOBILITY = publishsubscribe
-
-symbian:TARGET.UID3 = 0xE0022E73
-
-XQSERVICE_ROOT=../..
-include(../../xqservicebase.pri)
-include(src/AutolockSrv.pri)
-
-symbian: TARGET.CAPABILITY = CAP_APPLICATION
-
-LIBS+=-lxqservice -lxqserviceutil -lflogger
-LIBS += -L../../../../../bin/release -lautolockuseractivityservice
-
-LIBS+=-lsecui -letelmm -letel -lcustomapi -lcentralrepository
-
-SERVICE.FILE = service_conf.xml
-SERVICE.OPTIONS = embeddable
-SERVICE.OPTIONS += hidden
-
-libFiles.sources = AutolockSrv.exe 
-libFiles.path = "!:\sys\bin"
-DEPLOYMENT += libFiles
-
-RESOURCES += AutolockSrv.qrc
-
-RSS_RULES += \
-  "datatype_list = " \
-  "      {" \
-  "      DATATYPE" \
-  "          {" \
-  "          priority = EDataTypePriorityNormal;" \
-  "          type = \"text/plain\";" \
-  "          }" \
-  "      };" \
-
-symbian:crml.sources = autolocksrv.qcrml
-symbian:crml.path = c:/resource/qt/crml
-symbian:DEPLOYMENT += crml
-
-symbian:BLD_INF_RULES.prj_exports += "./rom/AutolockSrv.iby CORE_APP_LAYER_IBY_EXPORT_PATH(AutolockSrv.iby)"
--- a/securitydialogs/AutolockSrv/AutolockSrv.qrc	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-<RCC>
-    <qresource prefix="/AutolockSrv_hbicon" >
-    <file alias="iconnotifier.svg">iconnotifier.svg</file>
-    <file alias="qtg_large_device_lock.svg">qtg_large_device_lock.svg</file>
-    </qresource>
-</RCC>
--- a/securitydialogs/AutolockSrv/Keyguard_enabled.svg	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1949 +0,0 @@
-<?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/AutolockSrv/autolocksrv.qcrml	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?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>
--- a/securitydialogs/AutolockSrv/autolockuseractivityservice.pro	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +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: autolockuseractivityservice.pro
-#
-
-TEMPLATE = subdirs
-
-SUBDIRS += autolockuseractivityservice/autolockuseractivityservice.pro
--- a/securitydialogs/AutolockSrv/autolockuseractivityservice/autolockuseractivityservice.pri	Thu Jun 17 12:11:51 2010 +0100
+++ /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: autolockuseractivityservice.pri
-#
-
-HEADERS += ./inc/*.h
-
-SOURCES += ./src/*.cpp
-
-INCLUDEPATH += . \
-               inc 
-               
-DEPENDPATH += . \
-              inc \
-              src
--- a/securitydialogs/AutolockSrv/autolockuseractivityservice/autolockuseractivityservice.pro	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +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: 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)
--- a/securitydialogs/AutolockSrv/autolockuseractivityservice/autolockuseractivityservice_s60.pri	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +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: autolockuseractivityservice_s60.pri
-#
-
-HEADERS += ./s60/inc/*.h
-
-SOURCES += ./s60/src/*.cpp
-
-INCLUDEPATH += ./s60/inc
-
-DEPENDPATH += ./s60/inc \
-              ./s60/src
--- a/securitydialogs/AutolockSrv/autolockuseractivityservice/autolockuseractivityservice_stub.pri	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +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: autolockuseractivityservice_stub.pri
-#
-
-HEADERS += ./stub/inc/*.h
-
-SOURCES += ./stub/src/*.cpp
-
-INCLUDEPATH += ./stub/inc
-
-DEPENDPATH += ./stub/inc \
-              ./stub/src
--- a/securitydialogs/AutolockSrv/autolockuseractivityservice/common.pri	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +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: 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)"
-}
--- a/securitydialogs/AutolockSrv/autolockuseractivityservice/inc/autolockuseractivityservice.h	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 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
--- a/securitydialogs/AutolockSrv/autolockuseractivityservice/inc/autolockuseractivityservice_global.h	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 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
--- a/securitydialogs/AutolockSrv/autolockuseractivityservice/inc/autolockuseractivityserviceinterface.h	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +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: 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
--- a/securitydialogs/AutolockSrv/autolockuseractivityservice/s60/inc/autolockuseractivityservice_p.h	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 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
--- a/securitydialogs/AutolockSrv/autolockuseractivityservice/s60/src/autolockuseractivityservice_p.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,143 +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: 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();
-}
--- a/securitydialogs/AutolockSrv/autolockuseractivityservice/src/autolockuseractivityservice.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +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: 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();
-}
--- a/securitydialogs/AutolockSrv/autolockuseractivityservice/stub/inc/autolockuseractivityservice_p.h	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +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: 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
--- a/securitydialogs/AutolockSrv/autolockuseractivityservice/stub/src/autolockuseractivityservice_p.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 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());
-}
-
-
--- a/securitydialogs/AutolockSrv/bwins/autolockuseractivityserviceu.def	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-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
-
--- a/securitydialogs/AutolockSrv/eabi/autolockuseractivityserviceu.def	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-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/AutolockSrv/iconnotifier.svg	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,260 +0,0 @@
-<?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/AutolockSrv/indicatorplugin/qmakepluginstubs/indicatortestplugin.qtplugin	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-This file is a Qt plugin stub file. The real Qt plugin is located in /sys/bin. Created:2010-03-19T16:43:28
--- a/securitydialogs/AutolockSrv/qtg_large_device_lock.svg	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
-<?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/AutolockSrv/resources/Keyguard_enabled_test.svg	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1949 +0,0 @@
-<?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/AutolockSrv/resources/iconnotifier.svg	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,260 +0,0 @@
-<?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/AutolockSrv/resources/qtg_large_device_lock.svg	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
-<?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/AutolockSrv/rom/AutolockSrv.iby	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +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 __AUTOLOCKSRV_IBY__
-#define __AUTOLOCKSRV_IBY__
-
-/*
-#include <data_caging_paths_for_iby.hrh>
-*/
-
-S60_APP_EXE(AutolockSrv)
-S60_APP_BITMAP(AutolockSrv)
-S60_APP_AIF_RSC(AutolockSrv)
-S60_APP_RESOURCE(AutolockSrv)
-
-file=ABI_DIR\BUILD_DIR\autolockuseractivityservice.dll             SHARED_LIB_DIR\autolockuseractivityservice.dll
-file=ABI_DIR\BUILD_DIR\IndicatorAutolockPlugin.dll             SHARED_LIB_DIR\IndicatorAutolockPlugin.dll
-
-data=\epoc32\data\z\private\10003a3f\import\apps\AutolockSrv_reg.rsc \epoc32\data\z\private\10003a3f\apps\AutolockSrv_reg.rsc
-
-file=\epoc32\data\z\private\10003a3f\import\apps\AutolockSrv_reg.rsc \epoc32\data\z\private\10003a3f\apps\AutolockSrv_reg.rsc
-data=ZPRIVATE\10003a3f\import\apps\AutolockSrv_reg.rsc          private\10003a3f\apps\AutolockSrv_reg.rsc
-
-#endif // __AUTOLOCKSRV_IBY__
--- a/securitydialogs/AutolockSrv/service_conf.xml	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-<?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 to AutolockSrv</description>
-   </interface>
-</service>
\ No newline at end of file
--- a/securitydialogs/AutolockSrv/service_conf_new.xml	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<service>
-  <name>com.nokia.services.AutolockSrv</name>
-  <filepath>No path</filepath>
-  <description>AutolockSrv service</description>
-  <interface>
-     <name>AutolockSrv</name>
-     <version>2.0</version>
-     <description>Interface to AutolockSrv</description>
-     <customproperty key="txt_aiw_action_text">Dial now</customproperty>
-   </interface>
-</service>
\ No newline at end of file
--- a/securitydialogs/AutolockSrv/service_conf_old_format.xml	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<service name="com.nokia.services.AutolockSrv"  filepath="must-not-be-empty" >
-  <description>AutolockSrv</description>
-  <interface name="AutolockSrv" version="1.0" capabilities="">
-    <description>Dial interface</description>
-  </interface>
-</service>
\ No newline at end of file
--- a/securitydialogs/AutolockSrv/src/AutolockSrv.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1475 +0,0 @@
-/*
-* 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 <QApplication>
-#include <QKeyEvent>
-#include <QEvent>
-#include <QLabel>
-#include <QVBoxLayout>
-#include <QStackedWidget>
-#include <QImageReader>
-#include <QDebug>
-#include <QTimer>
-#include <QPushButton>
-#include <QLineEdit>
-#include <QListView>
-#include <QMessageBox>
-#include <QToolButton>
-#include <QSymbianEvent>
-#include <QMainWindow>
-#include <qvaluespacesubscriber.h>
-#include <qvaluespacepublisher.h>
-
-QTM_USE_NAMESPACE
-
-#include <HbIndicator>
-#include <hbdevicemessagebox.h>
-
-#include <lockappclientserver.h>
-
-#include <xqsharablefile.h>
-
-#include <QGraphicsLinearLayout>
-
-#include <hblabel.h>
-
-#include "AutolockSrv.h"
-#include <xqserviceutil.h>
-
-#include "autolockuseractivityservice.h"
-
-#include <settingsinternalcrkeys.h>		// CenRep keys
-#include <W32STD.H>
-#include <eikenv.h>
-
-#include <qapplication.h>
-
-#include <secuisecuritysettings.h>
-#include <secui.h>
-#include <secuisecurityhandler.h>
-#include <etelmm.h>
-#include <rmmcustomapi.h>
-
-#include <qvaluespacesubscriber.h>
-
-#include <hwrmlightdomaincrkeys.h>
-#include <ProfileEngineSDKCRKeys.h>
-#include <e32property.h>
-#include <coreapplicationuisdomainpskeys.h>
-#include "../../../inc/securityuisprivatepskeys.h"
-#include <avkondomainpskeys.h>
-
-#include <hbdevicedialog.h>
-
-const TInt KPhoneIndex(0);
-const TInt KTriesToConnectServer(2);
-const TInt KTimeBeforeRetryingServerConnection(50000);
-
-#define ESecUiTypeLock					0x00100000
-
-_LIT( KMmTsyModuleName, "PhoneTsy");
-
-#define XQSERVICE_DEBUG_PRINT(a) qDebug() << (a)
-
-AutolockSrv::AutolockSrv(QWidget *parent, Qt::WFlags f) :
-    QWidget(parent, f), mService(NULL)
-    {
-    XQSERVICE_DEBUG_PRINT("AutolockSrv::AutolockSrv");
-    RDEBUG("start", 0);
-    mService = new AutolockSrvService(this);
-
-    /* Adjust the palette */
-#if defined(Q_WS_S60)
-    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
-
-    QPushButton *unlockButton = new QPushButton(tr("Unlock"));
-    QPushButton *unguardButton = new QPushButton(tr("Unguard"));
-    QPushButton *lockButton = new QPushButton(tr("Lock"));
-    QPushButton *quitButton = new QPushButton(tr("Quit"));
-    QPushButton *test1Button = new QPushButton(tr("Autolock 10 seconds"));
-    QPushButton *test2Button = new QPushButton(tr("Autolock never"));
-    connect(quitButton, SIGNAL(clicked()), this, SLOT(quit()));
-    connect(lockButton, SIGNAL(clicked()), this, SLOT(lockAction()));
-    connect(unlockButton, SIGNAL(clicked()), this, SLOT(unlockAction()));
-    connect(unguardButton, SIGNAL(clicked()), this, SLOT(unguardAction()));
-    connect(test1Button, SIGNAL(clicked()), this, SLOT(test1Action()));
-    connect(test2Button, SIGNAL(clicked()), this, SLOT(test2Action()));
-    RDEBUG("connect", 1);
-
-    /* there's no use for this */
-    /*
-     bool isService = XQServiceUtil::isService();
-     
-     QString t = "SERVICEAPP:\n";
-     t = t + (isService ?  "    LAUNCHED AS SERVICE\n" : "    LAUNCHED NORMALLY\n");
-     t = t + (XQServiceUtil::isEmbedded() ? "    EMBEDDED\n" : "    NOT EMBEDDED\n");
-     
-     QStringList args = QApplication::arguments();
-     foreach (QString arg, args)
-     {
-     t += "cmdline arg=" + arg + "\n";
-     }
-     
-     QLabel *title = new QLabel(t);
-     */
-
-    mLabel = new QLabel("");
-    mNumberEdit = new QLineEdit("");
-
-    QVBoxLayout *vl = new QVBoxLayout;
-    RDEBUG("QVBoxLayout", 1);
-
-    vl->setMargin(0);
-    vl->setSpacing(0);
-    RDEBUG("setSpacing", 1);
-
-    vl->addWidget(lockButton);
-    vl->addWidget(unlockButton);
-    vl->addWidget(unguardButton);
-    vl->addWidget(quitButton);
-    vl->addWidget(test1Button);
-    vl->addWidget(test2Button);
-    RDEBUG("added test2Button", 1);
-
-    mLabelIcon = new QToolButton;
-    mLabelIcon->setIcon(QIcon(
-            ":/AutolockSrv_hbicon/qtg_large_device_lock.svg"));
-    mLabelIcon->setIconSize(QSize(300, 300));
-
-    vl->addWidget(mLabelIcon);
-    RDEBUG("added mLabelIcon", 1);
-
-    /*    vl->addItem(title);
-     vl->addWidget(mLabel);
-     vl->addWidget(mNumberEdit);
-     */
-    setLayout(vl);
-
-#if defined(Q_WS_X11) || defined(Q_WS_WIN)
-    setFixedSize(QSize(360,640)); // nHD
-#elif defined(Q_WS_S60)
-    // showMaximized();
-    showFullScreen();
-#endif
-    mLabelIcon_visible = 1;
-    serviceKeyguard = new AutolockUserActivityService();
-    serviceDevicelock = new AutolockUserActivityService();
-
-    TInt lockValue = 0;
-    TInt lightsTimeout = 0;
-    CRepository* repository;
-    TInt cRresult = 0;
-
-    iLockStatusPrev = ELockNotActive;
-    iLockStatus = ELockNotActive;
-    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);
-
-    repository = CRepository::NewL(KCRUidProfileEngine);
-    cRresult = repository->Get(KProEngActiveProfile, lightsTimeout);
-    delete repository;
-
-    repository = CRepository::NewL(KCRUidLightSettings);
-    cRresult = repository->Get(KDisplayLightsTimeout, lightsTimeout);
-    delete repository;
-
-    // TODO flip
-
-    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()));
-
-    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);
-
-    ret = RProperty::Define(KPSUidAvkonDomain, KAknKeyguardStatus,
-            RProperty::EInt, TSecurityPolicy(TSecurityPolicy::EAlwaysPass),
-            KWritePolicy);
-    RDEBUG("defined KAknKeyguardStatus", ret);
-
-    ret = RProperty::Define(KPSUidSecurityUIs,
-            KSecurityUIsLockInitiatorUID, RProperty::EInt, readPolicy,
-            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);
-
-    // 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);
-    // TODO if I want to release, I should do:   mKeyCaptureHandle = env->RootWin().CaptureKey(EKeyBackspace, 0, 0);
-    groupWin.CaptureKey(EKeyBackspace, 0, 0);
-    groupWin.CaptureKey(EKeyDeviceF, 0, 0);
-    groupWin.CaptureKey(EKeyBell, 0, 0);
-    groupWin.CaptureKey(EKeyTab, 0, 0);
-    groupWin.CaptureKey(EKeyInsert, 0, 0);
-    RDEBUG("got mKeyCaptureHandle", 1);
-
-    iSecQueryUiCreated = -1;
-    iDeviceDialogCreated = -1;
-    // TODO for now, always starts unlocked
-    // TryChangeStatus(iLockStatus);
-    TryChangeStatus( ELockNotActive);
-    lower();
-    hide();
-    // not needed:   new AutolockSrvService(this);
-    }
-
-AutolockSrv::~AutolockSrv()
-    {
-    RDEBUG("0", 0);
-    delete mService;
-    }
-
-void AutolockSrv::adjustInactivityTimers(int aReason)
-    {
-    RDEBUG("aReason", aReason);
-    TInt keyguardTime = 0;
-    TInt lockTime = 0;
-    CRepository* repository;
-    TInt cRresult = 0;
-
-    repository = CRepository::NewL(KCRUidSecuritySettings);
-    cRresult = repository->Get(KSettingsAutoLockTime, lockTime);	// in minutes, handled internally as seconds
-    lockTime *= 60;
-    RDEBUG("KSettingsAutoLockTime", KSettingsAutoLockTime);
-    RDEBUG("cRresult", cRresult);
-    RDEBUG("lockTime", lockTime);
-    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
-        }
-
-    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);
-        }
-    delete repository;
-    }
-void AutolockSrv::quit()
-    {
-    RDEBUG("0", 0);
-    qApp->quit();
-    }
-
-// from the button
-void AutolockSrv::unlockAction()
-    {
-    RDEBUG("0", 0);
-    TryChangeStatus( ELockAppDisableDevicelock);
-    }
-
-void AutolockSrv::unguardAction()
-    {
-    RDEBUG("0", 0);
-    TryChangeStatus( ELockAppDisableKeyguard);
-    }
-
-void AutolockSrv::test1Action()
-    {
-    RDEBUG("Set(KSettingsAutoLockTime, 2)", 2);
-
-    CRepository* repositorySet = CRepository::NewL(KCRUidSecuritySettings);
-    repositorySet->Set(KSettingsAutoLockTime, 2);	// in minutes
-    delete repositorySet;
-    }
-
-void AutolockSrv::test2Action()
-    {
-    RDEBUG("Set(KSettingsAutoLockTime, 0)", 0);
-
-    CRepository* repositorySet = CRepository::NewL(KCRUidSecuritySettings);
-    repositorySet->Set(KSettingsAutoLockTime, 0);	// minutes
-    delete repositorySet;
-    }
-
-int AutolockSrv::AskValidSecCode(int aReason)
-    {
-    RDEBUG("aReason", aReason);
-    RMobilePhone iPhone; // NULL in emulator
-
-#ifdef __WINS__1
-    return KErrNone;
-#endif
-
-
-    TInt err(KErrGeneral);
-    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("err", err);
-    err = iTelServer.SetExtendedErrorGranularity(RTelServer::EErrorExtended);
-    RDEBUG("err", err);
-    err = iTelServer.GetPhoneInfo(KPhoneIndex, PhoneInfo);
-    RDEBUG("err", err);
-    err = iPhone.Open(iTelServer, PhoneInfo.iName);
-    RDEBUG("err", err);
-    err = iCustomPhone.Open(iPhone);
-    RDEBUG("err", err);
-
-    RDEBUG("CSecurityHandler", 0);
-    CSecurityHandler* handler = new (ELeave) CSecurityHandler(iPhone);
-    if (aReason == ELockAppDisableDevicelock)
-        {
-        RDEBUG("calling AskSecCodeInAutoLockL", 0);
-        validCode = handler->AskSecCodeInAutoLockL(); // this returns true/false
-        // 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;
-                iWait = CWait::NewL();
-                iWait->SetRequestType(EMobilePhoneSetLockSetting);
-                iPhone.SetLockSetting(iWait->iStatus, lockType, lockChange); // ask for PassPhraseRequiredL
-                RDEBUG("WaitForRequestL", 0);
-                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
-                validCode = 0x20;
-            }
-        else
-            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 );
-         */
-        }
-    // TODO this doesn't wait on WINS , so how do I get the Acceptation?
-    RDEBUG("validCode (true/false)", validCode);
-    if (validCode)
-        return KErrNone;
-
-		// no valid code -> switch off the lights
-    err = RProperty::Set(KPSUidSecurityUIs,
-            KSecurityUIsLights, ESecurityUIsLightsLockOffRequest);
-		RDEBUG("KSecurityUIsLights err", err);
-    return KErrCancel;
-    }
-
-void AutolockSrv::lockAction()
-    {
-    RDEBUG("0", 0);
-
-    XQSERVICE_DEBUG_PRINT("AutolockSrv::lockAction");
-    TryChangeStatus( ELockAppOfferDevicelock);
-
-    }
-
-void AutolockSrv::handleAnswerDelivered()
-    {
-    RDEBUG("0", 0);
-    // quit();
-
-    }
-
-void AutolockSrv::endCall()
-    {
-    RDEBUG("This should never be called", 0);
-    //QVBoxLayout *vl = qobject_cast<QVBoxLayout *>(layout()) ;
-    //vl->removeWidget(mEndCallButton);
-
-    //XQServiceUtil::toBackground(true);
-    }
-
-void AutolockSrv::setLabelNumber(QString label, QString number)
-    {
-    RDEBUG("0", 0);
-    mLabel->setText("mLabel=" + label);
-    mNumberEdit->setText("mNumberEdit=" + number);
-    }
-
-void AutolockSrv::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 AutolockSrv::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 AutolockSrv::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 AutolockSrv::CheckIfLegal(int aReason)
-    {
-    RDEBUG("aReason", aReason);
-    // check whether a dialog is already displayed. This is to prevent timeout-lock and timeout-keyguard for activated on top of a PIN query, in particular at boot-up (TODO 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 (1 == 0) // !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 (secUiOriginatedQuery
-                    != ESecurityUIsSecUIOriginatedUninitialized
-                    && secUiOriginatedQuery
-                            != ESecurityUIsSystemLockOriginated)
-                {
-                // PIN on top and trying to display unlock-code. This is valid
-                }
-            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:
-                    return KErrPermissionDenied;
-                }
-            }
-            break;
-        default:
-            {
-            RDEBUG("default iLockStatus", iLockStatus);
-            return KErrPermissionDenied;
-            }
-            // break;
-        } // switch
-    return KErrPermissionDenied;
-    }
-
-int AutolockSrv::publishStatus(int aReason)
-    {
-    RDEBUG("aReason", aReason);
-    TInt err;
-    const TUid KCRUidCoreApplicationUIsSysAp = { 0x101F8765 };
-    const TUint32 KSysApKeyguardActive = 0x00000001;
-    CRepository* repositoryDevicelock;
-    CRepository* repositoryKeyguard;
-    repositoryDevicelock = CRepository::NewL(KCRUidSecuritySettings);
-    repositoryKeyguard = CRepository::NewL(KCRUidCoreApplicationUIsSysAp);
-    TInt cRresult = KErrNone;
-    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);
-            // lights are required ?
-
-            // 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); // not EKeyguardLocked, not 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 AutolockSrv::showNoteIfRequested(int aReason)
-    {
-    RDEBUG("aReason", aReason);
-
-    if (aReason == ELockNotActive)
-        {
-        if (iShowKeyguardNote == 1)
-            {
-            HbDeviceMessageBox::information("Keyguard deactivated");
-            }
-        }
-    else if (aReason == EKeyguardActive)
-        {
-        if (iShowKeyguardNote == 1)
-            {
-            HbDeviceMessageBox::information("Keyguard activated");
-            }
-        }
-    else if (aReason >= EDevicelockActive) // this doesn't happen, but we are prepared nevertheless
-        {
-        if (iShowKeyguardNote == 1)
-            {
-            HbDeviceMessageBox::information("Devicelock activated");
-            }
-        }
-    return KErrNone;
-    }
-/***********************/
-int AutolockSrv::TryChangeStatus(int aReason)
-    {
-    RDEBUG("aReason", aReason);
-    int ret = aReason;
-    int errorInProcess = KErrNone;
-    DebugRequest(ret);
-
-    switch (ret)
-        {
-        case ELockAppEnableKeyguard: // 1
-            {
-            errorInProcess = CheckIfLegal(ret);
-            DebugError(errorInProcess);
-            if (errorInProcess == KErrNone)
-                {
-                setLabelIcon( EKeyguardActive);
-                updateIndicator(EKeyguardActive);
-                publishStatus(EKeyguardActive);
-                showNoteIfRequested(EKeyguardActive);
-                }
-            }
-            break;
-        case ELockAppDisableKeyguard: // 2
-            {
-            errorInProcess = CheckIfLegal(ret);
-            DebugError(errorInProcess);
-            if (errorInProcess == KErrNone)
-                {
-                setLabelIcon( ELockNotActive);
-                updateIndicator(ELockNotActive);
-                publishStatus(ELockNotActive);
-                showNoteIfRequested(ELockNotActive);
-                }
-            }
-            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)
-                {
-                RDEBUG(" calling HbDeviceMessageBox::question", 0);
-                bool value = HbDeviceMessageBox::question("Disable Lock?");
-                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);
-                publishStatus(ELockNotActive);
-                }
-            if (errorInProcess != KErrNone)
-                { // re-lock. For example, if password is wrong
-                setLockDialog(aReason, 1);
-                }
-            // this never shows a note
-            }
-            break;
-        case ELockAppOfferKeyguard: // 5
-            {
-            errorInProcess = CheckIfLegal(ret);
-            DebugError(errorInProcess);
-            if (errorInProcess == KErrNone)
-                {
-                bool value = HbDeviceMessageBox::question("Enable Keyguard?");
-                // TODO 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);
-            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)
-                {
-                errorInProcess = TryChangeStatus(ELockAppEnableDevicelock);
-                }
-            // this never shows a note. Perhaps ELockAppEnableDevicelock does.
-            }
-            break;
-        case ELockAppShowKeysLockedNote:
-            {
-            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 AutolockSrv::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);
-
-    if (status == 0) // hide
-        {
-        // secUiOriginatedQuery should be ESecurityUIsSystemLockOriginated . If not, this is not correctly setting it
-        if (iDeviceDialogCreated > 0)
-            {
-            iDeviceDialogCreated = 0;
-            iDeviceDialog->cancel();
-            err = iDeviceDialog->error();
-            RDEBUG("err", err);
-            TInt err = RProperty::Set(KPSUidSecurityUIs,
-                    KSecurityUIsSecUIOriginatedQuery,
-                    ESecurityUIsSecUIOriginatedUninitialized);
-            RDEBUG("err", err);
-            }
-        }
-    else if (status == 1) // show
-        {
-        // 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 == EKeyguardActive)
-            params.insert("type", ESecUiTypeKeyguard);
-        else if (aReason >= EDevicelockActive)
-            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 <= 0)
-            {
-            RDEBUG("creating iDeviceDialog", 0);
-            iDeviceDialog = new HbDeviceDialog(HbDeviceDialog::NoFlags, this);
-            iDeviceDialogCreated = 1;
-            }
-        else
-            {
-            RDEBUG("raising iDeviceDialog", 0);
-            // confirm that dialog is present
-            err = iDeviceDialog->error();
-            RDEBUG("err", err);
-            iDeviceDialogCreated = 2;
-            }
-        const QString KSecQueryUiDeviceDialog(
-                "com.nokia.secuinotificationdialog/1.0");
-        RDEBUG("pre show", aReason);
-        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);
-        RDEBUG("err", err);
-
-        }
-    else
-        {
-        RDEBUG("unknown status", status);
-        return KErrNotSupported;
-        }
-    return KErrNone;
-    }
-void AutolockSrv::setLabelIcon(int aReason)
-    {
-    RDEBUG("aReason", aReason);
-
-    if (aReason == ELockNotActive)
-        {
-        mLabelIcon->setVisible(false);
-        setLockDialog(aReason, 0); // TODO isn't this done already at TryChangeStatus ???
-        lower();
-        hide();
-        }
-    else if (aReason == EKeyguardActive)
-        {
-        mLabelIcon->setVisible(true);
-        setLockDialog(aReason, 1);
-        raise(); // not repaint(), not show() , not setVisible(true), not showFullScreen() , not ???
-        show();
-        }
-    else if (aReason == EDevicelockActive)
-        {
-        mLabelIcon->setVisible(true);
-        raise();
-        show();
-        }
-    else
-        {
-        RDEBUG("error: aReason", aReason);
-        }
-    }
-
-int AutolockSrv::updateIndicator(int aReason)
-    {
-    RDEBUG("aReason", aReason);
-    QList<QVariant> list;
-    list.insert(0, 1);
-    list.insert(1, "aaa");
-    list.insert(2, 2);
-
-    HbIndicator indicator;
-    bool success;
-    if (aReason == ELockNotActive)
-        success = indicator.deactivate(
-                "com.nokia.hb.indicator.autolocksrv.autolocksrv_8/1.0"); // maybe it's already deactivated. Not a problem
-    else if (aReason == EKeyguardActive)
-        success = indicator.activate(
-                "com.nokia.hb.indicator.autolocksrv.autolocksrv_8/1.0");
-    else if (aReason == EDevicelockActive)
-        success = indicator.activate(
-                "com.nokia.hb.indicator.autolocksrv.autolocksrv_8/1.0"); // same. We have just 1 indicator
-    else
-        success = 0;
-    RDEBUG("success", success);
-    return success;
-    }
-
-void AutolockSrv::activeKeyguard()
-    {
-    // activity while keyguarded. Nothing to do
-    RDEBUG("0", 0);
-    }
-
-void AutolockSrv::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
-        {
-        ret = TryChangeStatus(ELockAppEnableKeyguard);
-        }
-    RDEBUG("ret", ret);
-    }
-/* Some activity detected while the deviceLock is enabled */
-void AutolockSrv::activeDevicelock()
-    {
-    // nothing to do
-    RDEBUG("0", 0);
-    }
-
-void AutolockSrv::notActiveDevicelock()
-    {
-    // inactivity. Devicelock should be activated
-    RDEBUG("0", 0);
-    int ret = KErrNone;
-    DebugStatus( iLockStatus);
-    if (iLockStatus == ELockNotActive || iLockStatus == EKeyguardActive) // not possible if it's locked
-        {
-        ret = TryChangeStatus(ELockAppEnableDevicelock);
-        }
-    RDEBUG("ret", ret);
-
-    }
-
-// some key is pressed
-bool AutolockSrv::event(QEvent *ev)
-    {
-    if (ev)
-        {
-        int isSwitchKey = 0;
-        // on device, this doesn't seem to get the EKeyDeviceF key: only 1ffffff
-        if (ev->type() == QEvent::KeyPress)
-            {
-            QKeyEvent *keyEvent = static_cast<QKeyEvent *> (ev);
-            qDebug() << QString("KeyPress:%1\n").arg(keyEvent->key(), 0, 16);
-            qDebug() << keyEvent->key();
-            qDebug() << EKeyInsert;
-            qDebug() << (keyEvent->key() & 0xFF);
-            qDebug() << (EKeyInsert & 0xFF);
-            if ((keyEvent->key() & 0xFF) == (EKeyInsert & 0xFF))
-                {
-                qDebug() << "pressed EKeyInsert";
-                // only reacts on release, not on press
-                isSwitchKey = 1;
-                }
-            if ((keyEvent->key() & 0xFF) == (EKeyTab & 0xFF))
-                {
-                qDebug() << "pressed EKeyTab";
-                }
-            if ((keyEvent->key() & 0xFF) == (EKeyDeviceF & 0xFF))
-                {
-                qDebug() << "pressed EKeyDeviceF";
-                }
-            if (keyEvent->key() == 0x1ffffff)
-                {
-                qDebug() << "pressed EKeyDeviceF-1ffffff";
-                isSwitchKey = 1;
-                }
-            }
-        else if (ev->type() == QEvent::KeyRelease)
-            {
-            QKeyEvent *keyEvent = static_cast<QKeyEvent *> (ev);
-            qDebug()
-                    << QString("KeyRelease:%1\n").arg(keyEvent->key(), 0, 16);
-            if (keyEvent->key() == 0x1ffffff)
-                {
-                RDEBUG("released EKeyDeviceF-1ffffff", 1);
-                // isSwitchKey=1; this should happen is   pressed  was not processed (hint: if it is/was in background)
-                }
-            }
-        RDEBUG("isSwitchKey", isSwitchKey);
-        if (isSwitchKey)
-            {
-            int ret = KErrNone;
-            DebugStatus( iLockStatus);
-            if (iLockStatus == ELockNotActive)
-                {
-                iShowKeyguardNote = 1; // note on enable keyguard
-                ret = TryChangeStatus(ELockAppEnableKeyguard); // this should not ask confirmation
-                }
-            else if (iLockStatus == EKeyguardActive)
-                {
-                iShowKeyguardNote = 1; // note on disable keyguard
-                ret = TryChangeStatus(ELockAppDisableKeyguard);
-                }
-            else if (iLockStatus == EDevicelockActive)
-                {
-                ret = TryChangeStatus(ELockAppDisableDevicelock);
-                }
-            else
-                {
-                RDEBUG("unknown iLockStatus", iLockStatus);
-                }
-            RDEBUG("ret", ret);
-            } // isSwitchKey
-        } // ev
-    // Process if not done before. For example, redraw or quit
-    return QWidget::event(ev);
-    }
-
-bool AutolockSrv::eventFilter(QObject *o, QEvent *ev)
-    {
-    // this never happens
-    RDEBUG("0", 0);
-    return QWidget::eventFilter(o, ev);
-
-    }
-
-void AutolockSrv::subscriberKSettingsAutolockStatusChanged()
-    {
-    RDEBUG("0", 0);
-    QVariant v = subscriberKSettingsAutolockStatus->value(
-            "/KCRUidSecuritySettings/KSettingsAutolockStatus");
-    adjustInactivityTimers( KSettingsAutolockStatus);
-    qDebug() << "AutolockSrv::subscriberKSettingsAutolockStatusChanged" << v;
-    }
-void AutolockSrv::subscriberKSettingsAutoLockTimeChanged()
-    {
-    RDEBUG("0", 0);
-    QVariant v = subscriberKSettingsAutoLockTime->value(
-            "/KCRUidSecuritySettings/KSettingsAutoLockTime");
-    adjustInactivityTimers( KSettingsAutoLockTime);
-    qDebug() << "AutolockSrv::subscriberKSettingsAutoLockTimeChanged" << v;
-    }
-void AutolockSrv::subscriberKSettingsAutomaticKeyguardTimeChanged()
-    {
-    RDEBUG("0", 0);
-    QVariant v = subscriberKSettingsAutomaticKeyguardTime->value(
-            "/KCRUidSecuritySettings/KSettingsAutomaticKeyguardTime");
-    adjustInactivityTimers( KSettingsAutoLockTime);
-    qDebug()
-            << "AutolockSrv::subscriberKSettingsAutomaticKeyguardTimeChanged"
-            << v;
-    }
-void AutolockSrv::subscriberKDisplayLightsTimeoutChanged()
-    {
-    RDEBUG("0", 0);
-    QVariant v = subscriberKDisplayLightsTimeout->value(
-            "/KCRUidLightSettings/KDisplayLightsTimeout");
-    // nothing to do
-    qDebug() << "AutolockSrv::subscriberKDisplayLightsTimeoutChanged" << v;
-    }
-void AutolockSrv::subscriberKProEngActiveProfileChanged()
-    {
-    RDEBUG("0", 0);
-    QVariant v = subscriberKProEngActiveProfile->value(
-            "/KCRUidProfileEngine/KProEngActiveProfile");
-    // nothing to do
-    qDebug() << "AutolockSrv::subscriberKProEngActiveProfileChanged" << v;
-    }
-
-// ----------AutolockSrvService---------------
-
-AutolockSrvService::AutolockSrvService(AutolockSrv* parent) :
-    XQServiceProvider(QLatin1String(
-            "com.nokia.services.AutolockSrv.AutolockSrv"), parent),
-            mAutolockSrv(parent), mAsyncReqId(-1), mAsyncAnswer(false)
-    {
-    RDEBUG("0", 0);
-    publishAll();
-    connect(this, SIGNAL(returnValueDelivered()), parent, SLOT(
-            handleAnswerDelivered()));
-    }
-
-AutolockSrvService::~AutolockSrvService()
-    {
-    RDEBUG("0", 0);
-    }
-
-void AutolockSrvService::complete(QString number)
-    {
-    RDEBUG("0", 0);
-    if (mAsyncReqId == -1)
-        return;
-    XQSERVICE_DEBUG_PRINT("AutolockSrvService::complete");
-    completeRequest(mAsyncReqId, number.toInt());
-    }
-
-// gor API request
-int AutolockSrvService::service(const QString& number,
-        const QString& aParam1, const QString& aParam2)
-    {
-    RDEBUG("0", 0);
-    TInt err = KErrNone;
-    qDebug() << "number=" << number;
-    qDebug() << "aParam1=" << aParam1;
-    qDebug() << "aParam2=" << aParam2;
-    mAsyncAnswer = false;
-    XQRequestInfo info = requestInfo();
-    QSet<int> caps = info.clientCapabilities();
-
-    mAutolockSrv->callerHasECapabilityWriteDeviceData = 0;
-    if (caps.contains(ECapabilityWriteDeviceData))
-        {
-        RDEBUG("callerHasECapabilityWriteDeviceData",
-                ECapabilityWriteDeviceData);
-        mAutolockSrv->callerHasECapabilityWriteDeviceData = 1;
-        }
-
-    QString label = "AutolockSrv::service:\n";
-    label += QString("number=%1\n").arg(number);
-
-    mNumber = number;
-    mAutolockSrv->setLabelNumber(label, number);
-    int ret = 0;
-    ret = number.toInt();
-
-    mAutolockSrv->mParam1 = aParam1.toInt();
-    mAutolockSrv->iShowKeyguardNote = aParam1.toInt();
-    mAutolockSrv->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 = myTime.Int64() >> 16;
-    myTimeLow = myTime.Int64() & 0xFFFFFFFF ;
-    RDEBUG("myTimeHigh", myTimeHigh);
-    RDEBUG("myTimeLow", myTimeLow);
-    err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsLockInitiatorTimeHigh, myTimeHigh );
-    err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsLockInitiatorTimeLow, myTimeLow );
-
-
-    ret = mAutolockSrv->TryChangeStatus(ret);
-    RDEBUG("ret", ret);
-    return ret;
-    }
-
-void AutolockSrvService::handleClientDisconnect()
-    {
-    RDEBUG("0", 0);
-    // Just quit service application if client ends
-    mAsyncAnswer = false;
-    RDEBUG("0", 0);
-    // mAutolockSrv->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;
-    }
-
--- a/securitydialogs/AutolockSrv/src/AutolockSrv.h	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,222 +0,0 @@
-/*
-* 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 AUTOLOCKSRV_H
-#define AUTOLOCKSRV_H
-
-#define RDEBUG( x, y ) RDebug::Printf( "%s %s (%u) %s=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, x, y );
-// #define RDEBUG( x, y )
-
-#include <QWidget>
-#include <QEvent>
-#include <QModelIndex>
-#include <QMap>
-#include <QStringList>
-#include <xqserviceprovider.h>
-#include <xqsharablefile.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
-	};
-
-
-class QLineEdit;
-class QPushButton;
-class AutolockSrvService;
-class QLabel;
-class HbLabel;
-class XQSharableFile;
-
-class AutolockSrv : public QWidget
-{
-    Q_OBJECT
-
-public:
-    AutolockSrv( QWidget *parent = 0, Qt::WFlags f = 0 );
-    ~AutolockSrv();
-
-    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 endCall();
-    void quit();
-    void unlockAction();
-    void unguardAction();
-    void lockAction();
-    void test1Action();
-    void test2Action();
-    void handleAnswerDelivered();
-    void subscriberKSettingsAutolockStatusChanged();
-    void subscriberKSettingsAutoLockTimeChanged();
-    void subscriberKSettingsAutomaticKeyguardTimeChanged();
-    void subscriberKDisplayLightsTimeoutChanged();
-    void subscriberKProEngActiveProfileChanged();
-
-private slots:
-    void activeKeyguard();
-    void notActiveKeyguard();
-    void activeDevicelock();
-    void notActiveDevicelock();
-
-private:
-    QLabel *mLabel;
-    QLineEdit *mNumberEdit;
-    QToolButton *mLabelIcon;
-    int mLabelIcon_visible;
-    //QPushButton *mEndCallButton;
-    AutolockSrvService* mService;
-    // int mKeyCode;
-    // int mKeyCaptureHandle;
-    QValueSpaceSubscriber *subscriberKSettingsAutolockStatus;
-    QValueSpaceSubscriber *subscriberKSettingsAutoLockTime;
-    QValueSpaceSubscriber *subscriberKSettingsAutomaticKeyguardTime;
-    QValueSpaceSubscriber *subscriberKDisplayLightsTimeout;
-    QValueSpaceSubscriber *subscriberKProEngActiveProfile;
-
-		AutolockUserActivityService* serviceKeyguard;
-		AutolockUserActivityService* serviceDevicelock;
-		
-		int iLockStatus;
-		int iLockStatusPrev;
-		CSecQueryUi *iSecQueryUi;
-		int iSecQueryUiCreated;
-		HbDeviceDialog *iDeviceDialog;
-		int iDeviceDialogCreated;
-};
-
-class AutolockSrvService : public XQServiceProvider
-{
-    Q_OBJECT
-public:
-    AutolockSrvService( AutolockSrv *parent = 0 );
-    ~AutolockSrvService();
-    
-    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:
-    AutolockSrv* mAutolockSrv;
-    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 // AUTOLOCKSRV_H
--- a/securitydialogs/AutolockSrv/src/AutolockSrv.pri	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-#
-# 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/AutolockSrv.cpp
-
-HEADERS=\
-    src/AutolockSrv.h
-
--- a/securitydialogs/AutolockSrv/src/keycapturingapplication.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-#include <QSymbianEvent>
-#include <QFile>
-#include <QTextStream>
-#include <QDebug>
-
-#include <W32STD.H>
-#include <eikenv.h>
-
-#include "keycapturingapplication.h"
-
-/*!
-    
- */
-void writeDebug(const QString &message)
-{
-    QFile file("c:/keycapturingapplication.log");
-    if (!file.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append)) {
-        qDebug() << "DialogLauncherView::writeDebug - file open failed";
-        return;
-    }
-    
-    QTextStream out(&file);
-    out << message << "\n";
-    
-    file.close();
-}
-
-/*!
-    
- */
-KeyCapturingApplication::KeyCapturingApplication(int &argc, char *argv[], int keyCode) : 
-    HbApplication(argc, argv), mKeyCode(keyCode), mKeyCaptureHandle(-1)
-{
-    CEikonEnv *env = CEikonEnv::Static();
-    mKeyCaptureHandle = env->RootWin().CaptureKey(keyCode, 0, 0);
-}
-
-/*!
-    
- */
-KeyCapturingApplication::~KeyCapturingApplication()
-{
-    CEikonEnv *env = CEikonEnv::Static();
-    env->RootWin().CancelCaptureKey(mKeyCaptureHandle);
-}
-    
-bool KeyCapturingApplication::symbianEventFilter(const QSymbianEvent *event)
-{
-    if (event->type() == QSymbianEvent::WindowServerEvent) {
-        const TWsEvent* wsEvent = event->windowServerEvent();
-        if (wsEvent->Type() == EEventKey) {
-            writeDebug(QString("Key Event:"));
-            writeDebug(QString("\tkey code: %1").arg(wsEvent->Key()->iCode));
-            writeDebug(QString("\tscan code: %1").arg(wsEvent->Key()->iScanCode));
-            if (wsEvent->Key()->iCode == mKeyCode)
-            {
-                emit capturedKeyEvent();
-            }
-        }
-    }
-    return HbApplication::symbianEventFilter(event);
-}
--- a/securitydialogs/AutolockSrv/src/keycapturingapplication.h	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-#ifndef KEYCAPTURINGAPPLICATION_H
-#define KEYCAPTURINGAPPLICATION_H
-
-#include <HbApplication>
-
-class KeyCapturingApplication : public HbApplication
-{
-
-    Q_OBJECT
-    
-signals:
-
-    void capturedKeyEvent();
- 
-public:
-    
-    KeyCapturingApplication(int &argc, char *argv[], int keyCode);
-    ~KeyCapturingApplication();
-    virtual bool symbianEventFilter(const QSymbianEvent *event);
-    
-private:
-
-    int mKeyCode;
-    int mKeyCaptureHandle;
-    
-};
-
-#endif // KEYCAPTURINGAPPLICATION_H
--- a/securitydialogs/AutolockSrv/src/lockapp.hrh	Thu Jun 17 12:11:51 2010 +0100
+++ /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/AutolockSrv/src/main.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
-* 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 "AutolockSrv.h"
-
-#include <hbapplication.h>
-#include <hbmainwindow.h>
-
-int main(int argc, char **argv)
-{
-    // qInstallMsgHandler(XQSERVICEMESSAGEHANDLER);
-    // XQSERVICE_DEBUG_PRINT(" ================== xxxx AutolockSrv::main");
-    qDebug() << "================== xxxx AutolockSrv::main";
-    QApplication a( argc, argv );
-    AutolockSrv *cl = new AutolockSrv();
-    qDebug() << " ================== xxxx cl->show";
-    // cl->show();
-    qDebug() << " ================== xxxx cl->hide";
-    cl->hide();
-    qDebug() << " ================== xxxx cl->lower";
-    cl->lower();
-    int rv = a.exec();
-    delete cl;
-    return rv;
-}
-
--- a/securitydialogs/SecUi/BWinsCw/SECUI_EKA2U.def	Thu Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/SecUi/BWinsCw/SECUI_EKA2U.def	Thu Jul 22 16:43:28 2010 +0100
@@ -68,4 +68,5 @@
 	?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 Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/SecUi/EABI/Secuiu.def	Thu Jul 22 16:43:28 2010 +0100
@@ -99,4 +99,5 @@
 	_ZN17CSecuritySettings27ChangeAutoLockPeriodParamsLEi4TBufILi10EEiR6TDes16i @ 98 NONAME
 	_ZTI11CSecQueryUi @ 99 NONAME
 	_ZTV11CSecQueryUi @ 100 NONAME
+	_ZN17CSecuritySettings17AskSecCodeParamsLER4TBufILi10EEiR6TDes16i @ 101 NONAME
 
--- a/securitydialogs/SecUi/GSSimSecPlugin/Data/10207438.rss	Thu Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,806 +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 );
-    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 );
-    
-        if ( dlg->ExecuteLD( R_CUG_INDEX ) )
-            {
-            // 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 );
-    }
-
-
-// ---------------------------------------------------------------------------
-// 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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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
--- a/securitydialogs/SecUi/Inc/SecQueryUi.h	Thu Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/SecUi/Inc/SecQueryUi.h	Thu Jul 22 16:43:28 2010 +0100
@@ -25,6 +25,7 @@
 #include <e32property.h>
 
 #define ESecUiTypeMask  0x0FFFFFF
+#define ESecUiBasicTypeMask    0x00F0000
 
 #define ESecUiCancelSupported  0x1000000
 #define ESecUiCancelNotSupported  0x0000000
@@ -38,6 +39,9 @@
 #define ESecUiSecretSupported  0x8000000
 #define ESecUiSecretNotSupported  0x0000000
 
+#define ESecUiBasicTypeCheck   0x0010000
+#define ESecUiBasicTypeMultiCheck   0x0020000
+
 class MSecQueryUiCertificateDetailsProvider;
 class MSecQueryUiDrmDetailsProvider;
 class CHbDeviceDialogSymbian;
@@ -45,6 +49,34 @@
 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).
@@ -53,6 +85,8 @@
  * @lib SecQueryUi.lib
  * @since 10.1
  */
+typedef TBuf<80> TSecUiPassword;
+
 class CSecQueryUi : public CActive, public MHbDeviceDialogObserver
     {
     public:  // constructor and destructor
@@ -206,7 +240,8 @@
         TInt iCompletionCode;
         TInt iReturnValue;
 public:
-	      RMobilePhone::TMobilePassword iPassword;
+	   // previoulsy it was RMobilePhone::TMobilePassword iPassword; but this was only 10 bytes
+        TSecUiPassword iPassword;
     };
 
 
--- a/securitydialogs/SecUi/Inc/SecUiAutoLockSettingPage.h	Thu Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/SecUi/Inc/SecUiAutoLockSettingPage.h	Thu Jul 22 16:43:28 2010 +0100
@@ -23,7 +23,7 @@
 #include    <aknradiobuttonsettingpage.h>
 #include    <eikmobs.h>
 
-class CAutoLockSettingPage : public CAknRadioButtonSettingPage
+class CAutoLockSettingPage : public CBase
 	{
 	public:
 		/**
@@ -59,7 +59,7 @@
     	void HandlePointerEventL(const TPointerEvent& aPointerEvent);
     	
 	private: // data
-		CEikButtonGroupContainer* iPopoutCba;
+		// CEikButtonGroupContainer* iPopoutCba;
 		TInt& iAutoLockValue;
 		TInt iMaximum;
 		TInt iOriginalIndex;
--- a/securitydialogs/SecUi/Inc/SecUiWait.h	Thu Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/SecUi/Inc/SecUiWait.h	Thu Jul 22 16:43:28 2010 +0100
@@ -20,12 +20,6 @@
 #ifndef     __SECUIWAIT_H
 #define     __SECUIWAIT_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
-
 //  INCLUDES
 
 #include    <e32base.h>
@@ -82,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();
--- a/securitydialogs/SecUi/Src/SecQueryUi.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/SecUi/Src/SecQueryUi.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -22,19 +22,9 @@
 #include <apgicnfl.h>                           // CApaMaskedBitmap
 #include <securityuisprivatepskeys.h>
 
-#include <CPhCltEmergencyCall.h>
+#include <cphcltemergencycall.h>
 #include <SCPClient.h>
-#include "SecUiWait.h"
-
-// Variant map keys for notification device dialog
-_LIT( KNotifDeviceDialogKeyTimeOut, "timeout" );
-_LIT( KNotifDeviceDialogKeyIconName, "iconName" );
-_LIT( KNotifDeviceDialogKeyText, "text" );
-_LIT( KNotifDeviceDialogKeyTitle, "title" );
-_LIT( KNotifDeviceDialogKeyTouchActivation, "touchActivation" );
-_LIT( KNotifDeviceDialogKeyActivated, "result" );
-_LIT( KNotifDeviceDialogKeyActivatedValue, "activated" );
-_LIT( KNotifDeviceDialogKeyTitleTextWrapping, "titleTextWrapping" );
+#include "SecUi.h"
 
 const TUid KSWInstHelpUid =
     {
@@ -109,22 +99,30 @@
     TInt err = RProperty::Get(KPSUidSecurityUIs,
             KSecurityUIsSecUIOriginatedQuery, secUiOriginatedQuery);
     RDEBUG("secUiOriginatedQuery", secUiOriginatedQuery);
-    if (secUiOriginatedQuery != ESecurityUIsSecUIOriginatedUninitialized)
-        {
-        // 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.
-        // What to do? Can't dismiss the dialog because it's not owned. Can't device-unlock without asking code. Only can disable keyguard
-        RDEBUG("!!!! warning: secUiOriginatedQuery", secUiOriginatedQuery);
-        }
-    else
+    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);
 
@@ -134,9 +132,22 @@
     AddParamL(_L("MinLength"), aMinLength);
     AddParamL(_L("MaxLength"), aMaxLength);
 
-    _LIT(KCodeTop, "codeTop");
-    _LIT(KCodeTopValue, "codeTop");
-    AddParamL(KCodeTop, KCodeTopValue);
+    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)
         {
@@ -154,10 +165,12 @@
 
     RDEBUG("0", 0);
     DisplayDeviceDialogL();
+    TSecUi::UnInitializeLib();	// the counterpart is at DisplayDeviceDialogL
     TInt error = WaitUntilDeviceDialogClosed();
     RDEBUG("error", error);
     User::LeaveIfError(error);
-
+    RDEBUG("iPassword", 0);
+		RDebug::Print(iPassword);
     aDataText.Copy(iPassword);
 
     err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery,
@@ -349,8 +362,6 @@
             {
             _LIT(KInvalidNewLockCode, "invalidNewLockCode");
             _LIT(KInvalidNewLockCode0, "invalidNewLockCode#0");
-            _LIT(KInvalidNewLockCode1, "invalidNewLockCode#1");
-            _LIT(KInvalidNewLockCode2, "invalidNewLockCode#2");
             AddParamL(KInvalidNewLockCode, KInvalidNewLockCode0); // for starter
             RSCPClient scpClient;
             TSCPSecCode newCode;
@@ -358,7 +369,6 @@
             RDEBUG("scpClient.Connect", 0);
             if (scpClient.Connect() == KErrNone)
                 {
-                /*
                  RArray<TDevicelockPolicies> aFailedPolicies;
                  TDevicelockPolicies failedPolicy;
                  TInt retLockcode = KErrNone;
@@ -374,7 +384,6 @@
                  KInvalidNewLockCodeX.AppendNum(failedPolicy);
                  AddParamL( KInvalidNewLockCode, KInvalidNewLockCodeX );
                  }
-                 */
                 // TODO this should be able to modify MinLenght, MaxLenght
                 scpClient.Close();
                 }
@@ -534,14 +543,6 @@
     iVariantMap->Add(aKey, variant);
     }
 
-TInt strlen(const char* aStr)
-    {
-    TInt len = 0;
-    while (*aStr++ != 0)
-        ++len;
-    return len;
-    }
-
 // ---------------------------------------------------------------------------
 // CSecQueryUi::DisplayDeviceDialogL()
 // ---------------------------------------------------------------------------
@@ -549,19 +550,26 @@
 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);
-        iDeviceDialog->Show(KSecQueryUiDeviceDialog, *iVariantMap, this);
+        err = iDeviceDialog->Show(KSecQueryUiDeviceDialog, *iVariantMap, this);
+        RDEBUG("err", err);
+        TSecUi::InitializeLibL();
         RDEBUG("iIsDisplayingDialog", iIsDisplayingDialog);
         iIsDisplayingDialog = ETrue;
         RDEBUG("iIsDisplayingDialog", iIsDisplayingDialog);
@@ -580,6 +588,7 @@
     iReturnValue = KErrUnknown;
     if (!IsActive() && iWait && !iWait->IsStarted())
         {
+        RDEBUG("KRequestPending", KRequestPending);
         iStatus = KRequestPending;
         SetActive();
         RDEBUG("Start", 0);
--- a/securitydialogs/SecUi/Src/SecUi.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/SecUi/Src/SecUi.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -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 Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/SecUi/Src/SecUiAutoLockSettingPage.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -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,11 +45,6 @@
 // 
 void CAutoLockSettingPage::ConstructL()
 	{
-	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));
-	FeatureManager::InitializeLibL();
 	}
 
 //
@@ -76,8 +55,6 @@
 // 
 CAutoLockSettingPage::~CAutoLockSettingPage()
 	{
-	delete iPopoutCba;
-	FeatureManager::UnInitializeLib();
 	}
 
 //
@@ -88,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;
-		}
-
+	
 	}
 //
 // ----------------------------------------------------------
@@ -145,10 +75,6 @@
 // 
 void CAutoLockSettingPage::SetPeriodMaximumValue(TInt aMaximumValue)
 	{
-	if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw ))
-	{
-		iMaximum = aMaximumValue;
-}
 	}
 	
 //---------------------------------------------------------------------------------------
@@ -160,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 Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/SecUi/Src/SecUiCodeQueryControl.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -16,7 +16,7 @@
 *
 *
 */
-
+#include <e32notif.h>
 #include <aknQueryControl.h>
 #include <aknsoundsystem.h>
 #include <aknappui.h>
--- a/securitydialogs/SecUi/Src/SecUiCodeQueryDialog.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/SecUi/Src/SecUiCodeQueryDialog.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -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 Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/SecUi/Src/SecUiManualSecuritySettings.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -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,20 +370,14 @@
     *    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
-
-    if(aLockCode.Length() <= KSimLockMaxPasswordSize)
+    RDEBUG("length", length);
+		// from now on, it accepts all lenghts, because some locks are 20, others are 13
+    // if(aLockCode.Length() <= KSimLockMaxPasswordSize)
     {
     if (aType.CompareF(Operator) == 0)
         {
@@ -438,9 +416,7 @@
         }
     }
 
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CManualSecuritySettings::LockSimL() RESULT: %d"), ret);
-    #endif
+    RDEBUG("ret", ret);
     switch (ret)
         {
         case KErrNone:
@@ -475,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;    
     }    
@@ -493,17 +467,14 @@
     *    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
-    if(aUnlockCode.Length() <= KSimLockMaxPasswordSize)
+    RDEBUG("length", length);
+		// from now on, it accepts all lenghts, because some locks are 20, others are 13
+    // if(aUnlockCode.Length() <= KSimLockMaxPasswordSize)
     {
     if (aType.CompareF(Operator) == 0)
         {
@@ -547,9 +518,7 @@
         }    
         
     }
-    #if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CManualSecuritySettings::UnLockSimL() RESULT: %d"), ret);
-    #endif
+    RDEBUG("ret", ret);
     switch (ret)
         {
         case KErrNone:
@@ -582,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;
     }
@@ -597,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/SecUiSecurityHandler.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/SecUi/Src/SecUiSecurityHandler.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -15,11 +15,10 @@
 *
 *
 */
-
-
+#include <e32notif.h>
 #include <aknnotedialog.h>
 #include <etelmm.h>
-#include <SecUi.rsg>
+// #include <SecUi.rsg>
 #include <exterror.h>
 #include <textresolver.h>
 
@@ -30,6 +29,7 @@
 #include <centralrepository.h> 
 #include <starterclient.h>     //used for RemoveSplashScreen
 #include <e32property.h>
+
 #include <PSVariables.h>   // Property values
 #include <coreapplicationuisdomainpskeys.h>
 #include <startupdomainpskeys.h>
@@ -41,14 +41,13 @@
 #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>
 
@@ -57,7 +56,8 @@
 //  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);
@@ -93,9 +93,12 @@
         *iDestroyedPtr = ETrue;
         iDestroyedPtr = NULL;
         }
-    CancelSecCodeQuery();
+    RDEBUG("calling CancelOpenQuery", 0);
+    TInt err = CancelOpenQuery(-1);
+    RDEBUG("err", err);
     iCustomPhone.Close();
     FeatureManager::UnInitializeLib();
+   	RDEBUG("1", 1);
     }
 //
 // ----------------------------------------------------------
@@ -151,15 +154,11 @@
     switch (aEvent)
         {
         case RMobilePhone::EPin1Required:
-#if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecurityHandler::HandleEventL() Pin1Required"));
-#endif
+						RDEBUG("RMobilePhone::EPin1Required", 0);
             aResult = Pin1RequiredL();
             break;
         case RMobilePhone::EPuk1Required:
-#if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecurityHandler::HandleEventL() PUK1Required"));
-#endif
+						RDEBUG("RMobilePhone::EPuk1Required", 0);
             Puk1RequiredL();
             break;
         case RMobilePhone::EPin2Required:
@@ -191,6 +190,7 @@
             SimLockEventL();
             break;
         default:
+        		RDEBUG("default", aEvent);
             break;
         }
     RDEBUG("aResult", aResult);
@@ -207,9 +207,7 @@
      *    Series 60 Customer / ETel
      *    Series 60  ETel API
      *****************************************************/
-#if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecurityHandler::AskSecCodeL()"));
-#endif
+		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 =
@@ -235,7 +233,6 @@
         }
     /* end check for default code */
 
-    iQueryCanceled = EFalse;
     RMobilePhone::TMobilePassword required_fourth;
 
     TInt ret = KErrNone;
@@ -253,6 +250,7 @@
         CSecQueryUi *iSecQueryUi;
         RDEBUG("CSecQueryUi", 0);
         iSecQueryUi = CSecQueryUi::NewL();
+				iQueryCanceled = EFalse;
         lAlphaSupported = ESecUiAlphaSupported;
         lCancelSupported = ESecUiCancelSupported;
         TBuf<0x100> title;
@@ -265,10 +263,11 @@
                         SEC_C_SECURITY_CODE_MIN_LENGTH,
                         SEC_C_SECURITY_CODE_MAX_LENGTH, ESecUiSecretSupported
                                 | lAlphaSupported | lCancelSupported
-                                | secCodeType /*aMode*/);
+                                | secCodeType );
         RDEBUG("iSecUi_password", 0);
         RDebug::Print(iSecUi_password);
         RDEBUG("delete", 0);
+        iQueryCanceled = ETrue;
         delete iSecQueryUi;
         RDEBUG("queryAccepted", queryAccepted);
         /* end request PIN using QT */
@@ -319,7 +318,7 @@
                     queryAccepted = KErrNone;
                     }
 
-                iQueryCanceled = ETrue; // TODO
+                iQueryCanceled = ETrue;
                 return ETrue;
                 }
             case KErrGsmSSPasswordAttemptsViolation:
@@ -350,30 +349,65 @@
     }
 //
 // ----------------------------------------------------------
-// CSecurityHandler::CancelSecCodeQuery()    
-// Cancels PIN2 and security code queries
-// TODO is this used?
+// Cancels all security code queries
+// aStatus = -1		from destructor
+// aStatus =  1		from API. Will kill all dialogs through signal P&S
 // ----------------------------------------------------------
 // qtdone
-EXPORT_C void CSecurityHandler::CancelSecCodeQuery()
+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);
     }
 //
 // ----------------------------------------------------------
@@ -389,10 +423,6 @@
      *****************************************************/
 
     RDEBUG("0", 0);
-
-#if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecurityHandler::AskSecCodeInAutoLockL()"));
-#endif
     TInt res;
     CWait* wait;
 
@@ -400,10 +430,6 @@
             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);
     TInt period = 0;
@@ -411,21 +437,15 @@
     delete repository;
 
     RDEBUG("res", res);
+    RDEBUG("period", period);
 
-#if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecurityHandler::AskSecCodeInAutoLockL() autolock period:%d"), res);
-#endif
     if (res == KErrNone)
         {
         // disable autolock in Domestic OS side too if autolock period is 0.
-        RDEBUG("period", period);
         if (period == 0)
             {
-#if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecurityHandler::AskSecCodeInAutoLockL() Call SetLockSetting"));
-#endif
+						RDEBUG("period", period);
 
-#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
@@ -440,35 +460,25 @@
                 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
             RDEBUG("lockChange", lockChange);
             wait = CWait::NewL();
             RDEBUG("0", 0);
@@ -480,16 +490,10 @@
             res = wait->WaitForRequestL();
             RDEBUG("res", res);
             delete wait;
-#if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecurityHandler::AskSecCodeInAutoLockL() SetLockSetting RESULT:%d"), res);
-#endif
             } // from   period == 0
         else
             { // ask security code
-#if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecurityHandler::AskSecCodeInAutoLockL() Ask sec code via notifier"));
-#endif
-            RDEBUG("0", 0);
+            RDEBUG("codeQueryNotifier 0", 0);
             RNotifier codeQueryNotifier;
             User::LeaveIfError(codeQueryNotifier.Connect());
             CWait* wait = CWait::NewL();
@@ -501,10 +505,7 @@
             params().iEvent
                     = static_cast<TInt> (RMobilePhone::EPhonePasswordRequired);
             params().iStartup = EFalse;
-#if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecurityHandler::AskSecCodeInAutoLockL() Start Notifier"));
-#endif
-            RDEBUG("0", 0);
+
             RDEBUG("StartNotifierAndGetResponse", 0);
             codeQueryNotifier.StartNotifierAndGetResponse(wait->iStatus,
                     KSecurityNotifierUid, params, response);
@@ -523,8 +524,6 @@
         { // can't read repository for KSettingsAutoLockTime
         RDEBUG("KERRSOMETHING:Call SetLockSetting", 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
@@ -538,48 +537,33 @@
             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();
         RDEBUG("SetLockSetting", 0);
         iPhone.SetLockSetting(wait->iStatus, lockType, lockChange);
         RDEBUG("WaitForRequestL", 0);
         res = wait->WaitForRequestL();
-        RDEBUG("WaitForRequestL", 1);
+        RDEBUG("WaitForRequestL res", res);
         delete wait;
-#if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecurityHandler::AskSecCodeInAutoLockL() KES: SetLockSetting RESULT:%d"), res);
-#endif
         }
 
     RDEBUG("res", res);
@@ -597,10 +581,37 @@
             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);
@@ -637,7 +648,10 @@
     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 ))
@@ -647,16 +661,11 @@
 
         if (tRet != KErrNone)
             {
-#if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL():\
-            Warning: failed to get TARM Admin Flag state"));
-#endif
+            RDEBUG("Warning: failed to get TARM Admin Flag state", tRet);
             }
         else
             {
-#if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL(): TARM flag: %d"), tarmFlag );
-#endif
+            RDEBUG("TARM flag", tarmFlag);
             }
 
         if ((StartUp) || (tarmFlag & KSCPFlagResyncQuery))
@@ -667,12 +676,9 @@
         if (StartUp)
             isConditionSatisfied = ETrue;
         }
-#if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL() Dialog 1"));
-#endif
+
     // Security code at bootup: No "cancel" softkey; Emergency calls enabled.
-    RMobilePhone::TMobilePhoneSecurityCode secCodeTypeToAsk =
-            RMobilePhone::ESecurityCodePhonePassword; // for starters
+    RMobilePhone::TMobilePhoneSecurityCode secCodeTypeToAsk = RMobilePhone::ESecurityCodePhonePassword;
     RDEBUG("isConditionSatisfied", isConditionSatisfied);
     if (isConditionSatisfied)
         {
@@ -695,16 +701,17 @@
 
     CSecQueryUi *iSecQueryUi;
     iSecQueryUi = CSecQueryUi::NewL();
+		iQueryCanceled = EFalse;
     TInt lType = ESecUiSecretSupported | ESecUiAlphaSupported
             | lCancelSupported | lEmergencySupported | secCodeTypeToAsk;
     RDEBUG("lType", lType);
-    iSecUi_password.Copy(_L("12345"));
     queryAccepted = iSecQueryUi->SecQueryDialog(_L("PassPhraseRequiredL"),
             iSecUi_password, SEC_C_SECURITY_CODE_MIN_LENGTH,
             SEC_C_SECURITY_CODE_MAX_LENGTH, lType);
     RDEBUG("iSecUi_password", 0);
     RDebug::Print(iSecUi_password);
     RDEBUG("queryAccepted", queryAccepted);
+    iQueryCanceled = ETrue;
     delete iSecQueryUi;
 
     TBool wasCancelledOrEmergency = EFalse;
@@ -716,9 +723,7 @@
     RDEBUG("wasCancelledOrEmergency", wasCancelledOrEmergency);
     if (wasCancelledOrEmergency)
         {
-#if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL() DIALOG ERROR"));
-#endif
+				RDEBUG("StartUp", StartUp);
         if (!StartUp)
             {
             RDEBUG("AbortSecurityCode", 0);
@@ -732,7 +737,7 @@
             RMobilePhone::ESecurityCodePhonePassword;
     CWait* wait = NULL;
     TInt status = KErrNone;
-    ;
+    
     wait = CWait::NewL();
     RDEBUG("VerifySecurityCode", 0);
     iPhone.VerifySecurityCode(wait->iStatus, secCodeType, iSecUi_password,
@@ -752,13 +757,12 @@
     TInt returnValue = 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 
+            // code approved
+            RDEBUG( "KErrNone", KErrNone );
             CSecuritySettings::ShowResultNoteL(R_CONFIRMATION_NOTE,
                     CAknNoteDialog::EConfirmationTone);
             RDEBUG("R_CONFIRMATION_NOTE", R_CONFIRMATION_NOTE);
@@ -781,10 +785,7 @@
 
                     if (tRet != KErrNone)
                         {
-#if defined(_DEBUG)
-                        RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL():\
-                            FAILED to unset TARM Admin Flag"));
-#endif
+                        RDEBUG( "FAILED to unset TARM Admin Flag tRet=", tRet );
                         }
                     }
                 if (!FeatureManager::FeatureSupported(
@@ -794,7 +795,9 @@
                             KFeatureIdSapDeviceLockEnhancements);
                     RSCPClient scpClient;
                     RDEBUG("scpClient.Connect", 0);
-                    User::LeaveIfError(scpClient.Connect());
+                    TInt tRet = scpClient.Connect();
+                    RDEBUG("tRet", tRet);
+                    User::LeaveIfError(tRet);
                     RDEBUG("scpClient.Connect", 1);
                     CleanupClosePushL(scpClient);
                     TSCPSecCode newCode;
@@ -808,16 +811,14 @@
             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;
+                RDEBUG("res", res);
+                RDEBUG("period", period);
 
                 _LIT_SECURITY_POLICY_PASS( KReadPolicy);
                 _LIT_SECURITY_POLICY_C1(KWritePolicy,
@@ -827,17 +828,14 @@
                         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)
                         {
-#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 );
@@ -848,45 +846,32 @@
                             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,iSecUi_password);
-                                wait->WaitForRequestL();
-                                RDEBUG( "iCustomPhone.DisablePhoneLock", 1 );
+                                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
-                        RDEBUG("iCustomPhone.DisablePhoneLock", 0);
-                        wait = CWait::NewL();
-                        iCustomPhone.DisablePhoneLock(wait->iStatus,
-                                iSecUi_password);
-                        wait->WaitForRequestL();
-                        RDEBUG("iCustomPhone.DisablePhoneLock", 1);
-                        delete wait;
-#endif // RD_REMOTELOCK
                         }
                     }
                 else // error getting repository
                     {
                     RDEBUG("error getting repository", 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 );
@@ -900,33 +885,21 @@
                             RDEBUG( "iCustomPhone.DisablePhoneLock", 0 );
                             wait = CWait::NewL();
                             iCustomPhone.DisablePhoneLock(wait->iStatus,iSecUi_password);
-                            wait->WaitForRequestL();
-                            RDEBUG( "iCustomPhone.DisablePhoneLock", 1 );
+		                        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
-                    // could not get the current autolock time... disable autolock in Domestic OS side.
-                    RDEBUG("iCustomPhone.DisablePhoneLock", 0);
-                    wait = CWait::NewL();
-                    iCustomPhone.DisablePhoneLock(wait->iStatus,
-                            iSecUi_password);
-                    wait->WaitForRequestL();
-                    RDEBUG("iCustomPhone.DisablePhoneLock", 1);
-                    delete wait;
-
-#endif // RD_REMOTELOCK
                     }
 
                 } // no Startup
@@ -935,26 +908,21 @@
         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:
             RDEBUG("KErrAccessDenied", KErrAccessDenied);
-            // TODO should this try again? It seems that it's not asked again.
-#if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL() KErrGsm0707IncorrectPassword"));
-#endif
+            // The Settings caller might retry
             CSecuritySettings::ShowResultNoteL(R_CODE_ERROR,
                     CAknNoteDialog::EErrorTone);
             break;
         default:
             RDEBUG("default", status);
             CSecuritySettings::ShowErrorNoteL(status);
-            // TODO should this try again? It seems that it's not asked again.
+            // The Settings caller might retry
             break;
         }
     RDEBUG("returnValue", returnValue);
@@ -999,30 +967,14 @@
         // 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 defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecurityHandler::Pin1RequiredL():\
-            FAILED to get the SECUI query Flag: %d"), err);
-#endif
-            }
-        else
-            {
-#if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecurityHandler::Pin1RequiredL():\
-                    SECUI query Flag: %d"), secUiOriginatedQuery);
-#endif 
+						RDEBUG("FAILED to get the SECUI query Flag err", err);
             }
         }
-#if defined(_DEBUG)
-    RDebug::Print(_L("CSecurityHandler::Pin1RequiredL() Execute dlg"));
-#endif
-
-    RDEBUG("StartUp", StartUp);
+    RDEBUG("err", err);
     RDEBUG("secUiOriginatedQuery", secUiOriginatedQuery);
     RDEBUG("ESecurityUIsSecUIOriginated", ESecurityUIsSecUIOriginated);
-    RDEBUG("err", err);
     if (StartUp || (secUiOriginatedQuery != ESecurityUIsSecUIOriginated)
             || (err != KErrNone))
         {
@@ -1045,7 +997,6 @@
     res=KErrNone;
     codeInfo.iRemainingEntryAttempts=3;
 #endif
-
     User::LeaveIfError(res);
 
     RDEBUG("codeInfo.iRemainingEntryAttempts",
@@ -1057,9 +1008,9 @@
     CSecQueryUi *iSecQueryUi;
     RDEBUG("CSecQueryUi", 0);
     iSecQueryUi = CSecQueryUi::NewL();
+		iQueryCanceled = EFalse;
     RDEBUG("SecQueryDialog", 1);
-    // TODO ESecUiCodeEtelReqest/ESecUiNone might be useful
-    // TODO also support Emergency
+    // ESecUiCodeEtelReqest/ESecUiNone might be useful
     lAlphaSupported = ESecUiAlphaNotSupported;
     TBuf<0x100> title;
     title.Zero();
@@ -1073,16 +1024,14 @@
             SEC_C_PIN_CODE_MIN_LENGTH, SEC_C_PIN_CODE_MAX_LENGTH, amode);
     RDEBUG("iSecUi_password", 0);
     RDebug::Print(iSecUi_password);
+    iQueryCanceled = ETrue;
     delete iSecQueryUi;
     RDEBUG("queryAccepted", queryAccepted);
-    // TODO handle emergency
     /* end request PIN using QT */
 
     if (queryAccepted == KErrAbort) // emergency call
         {
-#if defined(_DEBUG)
-        RDebug::Print(_L("CSecurityHandler::Pin1RequiredL() R_PIN_REQUEST_QUERY CANCEL!"));
-#endif
+				RDEBUG("queryAccepted", queryAccepted);
         CleanupStack::PopAndDestroy(wait); // this is needed
         return KErrCancel;
         }
@@ -1110,12 +1059,13 @@
     switch (res)
         {
         case KErrNone:
-            // code approved 
-#if defined(_DEBUG)
-            RDebug::Print(_L("CSecurityHandler::Pin1RequiredL()code approved "));
-#endif
-            CSecuritySettings::ShowResultNoteL(R_CONFIRMATION_NOTE,
+            // 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:
@@ -1130,14 +1080,14 @@
         case KErrGsmSSPasswordAttemptsViolation:
         case KErrLocked:
             // code blocked; show error note and terminate.
-            // TODO what if not during Startup? Probably it's Ok since the SIM would had also failed at StartUp
+            // 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
-            // TODO no error? This is strange
+            // no error? This is strange
             break;
         default:
             CSecuritySettings::ShowErrorNoteL(res);
@@ -1153,6 +1103,8 @@
 // ----------------------------------------------------------
 // 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()
@@ -1161,12 +1113,10 @@
      *    Series 60 Customer / ETel
      *    Series 60  ETel API
      *****************************************************/
-#if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecurityHandler::Puk1RequiredL()"));
-#endif            
+		RDEBUG("0", 0);
     TInt queryAccepted = KErrCancel;
-    RMobilePhone::TMobilePassword iSecUi_password;
-    RMobilePhone::TMobilePassword aNewPassword;
+    RMobilePhone::TMobilePassword puk1_password;
+    RMobilePhone::TMobilePassword aNewPinPassword;
     RMobilePhone::TMobilePhoneSecurityCodeInfoV5 codeInfo;
     RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg codeInfoPkg(codeInfo);
     RMobilePhone::TMobilePhoneSecurityCode blockCodeType;
@@ -1177,7 +1127,7 @@
     TBool StartUp(ETrue);
     StartUp = iStartup;
 
-    TInt res(KErrNone);
+    TInt res(KErrCancel);	// for the first try
     wait->SetRequestType(EMobilePhoneGetSecurityCodeInfo);
 
     TInt thisTry = 0;
@@ -1193,74 +1143,113 @@
         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
-
     RDEBUG("StartUp", StartUp);
     RDEBUG("codeInfo.iRemainingEntryAttempts",
             codeInfo.iRemainingEntryAttempts);
-    //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
+  	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);
 
-    RDEBUG("codeInfo.iRemainingEntryAttempts",
-            codeInfo.iRemainingEntryAttempts);
-    if (codeInfo.iRemainingEntryAttempts == KMaxNumberOfPINAttempts)
-        codeInfo.iRemainingEntryAttempts = -1;
+    if (attempts == KMaxNumberOfPINAttempts)
+        attempts = -1;
 
-    // ask PUK code
-    /* request PIN using QT */
     CSecQueryUi *iSecQueryUi;
     RDEBUG("CSecQueryUi", 0);
     iSecQueryUi = CSecQueryUi::NewL();
+		iQueryCanceled = EFalse;
     RDEBUG("SecQueryDialog", 1);
-    // TODO ESecUiCodeEtelReqest/ESecUiNone might be useful
-    // TODO also support Emergency
+    // ESecUiCodeEtelReqest/ESecUiNone might be useful
     TBuf<0x100> title;
     title.Zero();
     title.Append(_L("Puk1RequiredL"));
     title.Append(_L("#"));
-    title.AppendNum(codeInfo.iRemainingEntryAttempts);
-    queryAccepted = iSecQueryUi->SecQueryDialog(title, iSecUi_password,
+    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
-                    | ESecUiCancelSupported | ESecUiPukRequired);
-    RDEBUG("iSecUi_password", 0);
-    RDebug::Print(iSecUi_password);
+                    | lSecUiCancelSupported | ESecUiPukRequired);
+    RDEBUG("puk1_password", 0);
+    RDebug::Print(puk1_password);
+    iQueryCanceled = ETrue;
     delete iSecQueryUi;
     RDEBUG("queryAccepted", queryAccepted);
 
     if ((queryAccepted == KErrAbort) || (queryAccepted == KErrCancel))
         {
-        CleanupStack::PopAndDestroy(wait); // TODO this is needed ???
+        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)
         {
-        // new pin code query
+        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);
-        // TODO ESecUiCodeEtelReqest/ESecUiNone might be useful
-        // TODO also support Emergency
 
         queryAccepted = iSecQueryUi->SecQueryDialog(
-                _L("Puk1-New|Puk1-Verif"), aNewPassword,
-                SEC_C_PUK_CODE_MIN_LENGTH, SEC_C_PUK_CODE_MAX_LENGTH,
+                _L("PIN1-New|PIN1-Verif"), aNewPinPassword,
+                SEC_C_PIN_CODE_MIN_LENGTH, SEC_C_PIN_CODE_MAX_LENGTH,
                 ESecUiAlphaNotSupported | ESecUiCancelSupported
                         | ESecUiPukRequired);
-        RDEBUG("aNewPassword", 0);
-        RDebug::Print(aNewPassword);
+        RDEBUG("aNewPinPassword", 0);
+        RDebug::Print(aNewPinPassword);
+        iQueryCanceled = ETrue;
         delete iSecQueryUi;
         RDEBUG("queryAccepted", queryAccepted);
         }
@@ -1271,16 +1260,16 @@
         return KErrCancel;
         }
 
-    // send code
+    // send code again, now with the user pin
     RDEBUG("VerifySecurityCode", 0);
-    iPhone.VerifySecurityCode(wait->iStatus, blockCodeType, aNewPassword,
-            iSecUi_password);
+    iPhone.VerifySecurityCode(wait->iStatus, blockCodeType, aNewPinPassword,
+            puk1_password);
     RDEBUG("WaitForRequestL", 0);
     res = wait->WaitForRequestL();
     RDEBUG("WaitForRequestL res", res);
     CleanupStack::PopAndDestroy(wait);
 
-    TInt returnValue = res;
+    returnValue = res;
     switch (res)
         {
         case KErrNone:
@@ -1297,7 +1286,7 @@
             break;
         case KErrGsm0707SimWrong:
             // sim lock active
-            // TODO no message ?
+            // no message ?
             break;
         case KErrGsmSSPasswordAttemptsViolation:
         case KErrLocked:
@@ -1308,7 +1297,7 @@
             returnValue = Puk1RequiredL();
             break;
         }
-
+		RDEBUG("returnValue", returnValue);
     return returnValue;
     }
 //
@@ -1324,9 +1313,7 @@
      *    Series 60  ETel API
      *****************************************************/
 
-#if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecurityHandler::Pin2RequiredL() BEGIN"));
-#endif
+		RDEBUG("0", 0);
     TInt queryAccepted = KErrCancel;
     RMobilePhone::TMobilePassword iSecUi_password;
     RMobilePhone::TMobilePassword required_fourth;
@@ -1343,21 +1330,20 @@
     RDEBUG("WaitForRequestL", 0);
     TInt ret = wait->WaitForRequestL();
     RDEBUG("WaitForRequestL ret", ret);
-
     User::LeaveIfError(ret);
 
     RDEBUG("codeInfo.iRemainingEntryAttempts",
             codeInfo.iRemainingEntryAttempts);
-    if (codeInfo.iRemainingEntryAttempts == KMaxNumberOfPINAttempts) // TODO this might be 10 ?
+    if (codeInfo.iRemainingEntryAttempts == KMaxNumberOfPINAttempts)
         codeInfo.iRemainingEntryAttempts = -1;
 
     /* request PIN using QT */
     CSecQueryUi *iSecQueryUi;
     RDEBUG("CSecQueryUi", 0);
     iSecQueryUi = CSecQueryUi::NewL();
+		iQueryCanceled = EFalse;
     RDEBUG("SecQueryDialog", 1);
-    // TODO ESecUiCodeEtelReqest/ESecUiNone might be useful against KLastRemainingInputAttempt
-    // TODO also support Emergency
+    // ESecUiCodeEtelReqest/ESecUiNone might be useful against KLastRemainingInputAttempt
 
     TBuf<0x100> title;
     title.Zero();
@@ -1371,6 +1357,7 @@
     RDEBUG("iSecUi_password", 0);
     RDebug::Print(iSecUi_password);
     RDEBUG("queryAccepted", queryAccepted);
+    iQueryCanceled = ETrue;
     delete iSecQueryUi;
 
     // If failed or device became locked, any pending request should be cancelled.
@@ -1411,9 +1398,6 @@
             CSecuritySettings::ShowErrorNoteL(status);
             break;
         }
-#if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecurityHandler::Pin2RequiredL(): END"));
-#endif
     }
 //
 // ----------------------------------------------------------
@@ -1427,6 +1411,7 @@
      *    Series 60 Customer / ETel
      *    Series 60  ETel API
      *****************************************************/
+		RDEBUG("0", 0);
     TInt queryAccepted = KErrCancel;
     RMobilePhone::TMobilePassword iSecUi_password;
     RMobilePhone::TMobilePassword aNewPassword;
@@ -1439,9 +1424,6 @@
     CWait* wait = CWait::NewL();
     CleanupStack::PushL(wait);
 
-#if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecurityHandler::Puk2RequiredL()"));
-#endif
     // ask PUK2
 
     TInt ret(KErrNone);
@@ -1457,9 +1439,9 @@
     CSecQueryUi *iSecQueryUi;
     RDEBUG("CSecQueryUi", 0);
     iSecQueryUi = CSecQueryUi::NewL();
+		iQueryCanceled = EFalse;
     RDEBUG("SecQueryDialog", 1);
-    // TODO ESecUiCodeEtelReqest/ESecUiNone might be useful
-    // TODO also support Emergency
+    // ESecUiCodeEtelReqest/ESecUiNone might be useful
 
     RDEBUG("codeInfo.iRemainingEntryAttempts",
             codeInfo.iRemainingEntryAttempts);
@@ -1474,9 +1456,10 @@
     queryAccepted = iSecQueryUi->SecQueryDialog(title, iSecUi_password,
             SEC_C_PUK2_CODE_MIN_LENGTH, SEC_C_PUK2_CODE_MAX_LENGTH,
             ESecUiSecretNotSupported | ESecUiAlphaNotSupported
-                    | ESecUiCancelSupported | secCodeType /*aMode*/);
+                    | ESecUiCancelSupported | secCodeType );
     RDEBUG("iSecUi_password", 0);
     RDebug::Print(iSecUi_password);
+    iQueryCanceled = ETrue;
     delete iSecQueryUi;
     RDEBUG("queryAccepted", queryAccepted);
 
@@ -1490,21 +1473,58 @@
         return;
         }
 
+    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)
         {
-        // new pin code query
+        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;
+        }
+
+		// now the PUK2 is valid. Time to get the new PIN2
+		wait = CWait::NewL();
+    CleanupStack::PushL(wait);
+    	  {
+        // new pin2 code query
         CSecQueryUi * iSecQueryUi;
         RDEBUG("CSecQueryUi", 0);
         iSecQueryUi = CSecQueryUi::NewL();
-        // TODO ESecUiCodeEtelReqest/ESecUiNone might be useful
-        // TODO also support Emergency
-
+				iQueryCanceled = EFalse;
+        // ESecUiCodeEtelReqest/ESecUiNone might be useful
         queryAccepted
-                = iSecQueryUi->SecQueryDialog(_L("Puk2-New|Puk2-Verif"),
-                        aNewPassword, SEC_C_PUK2_CODE_MIN_LENGTH,
-                        SEC_C_PUK2_CODE_MAX_LENGTH, ESecUiAlphaNotSupported
+                = iSecQueryUi->SecQueryDialog(_L("PIN2-New|PIN2-Verif"),
+                        aNewPassword, SEC_C_PIN2_CODE_MIN_LENGTH,
+                        SEC_C_PIN2_CODE_MAX_LENGTH, ESecUiAlphaNotSupported
                                 | ESecUiCancelSupported | secCodeType);
         RDEBUG("aNewPassword", 0);
         RDebug::Print(aNewPassword);
+        iQueryCanceled = ETrue;
         delete iSecQueryUi;
         RDEBUG("queryAccepted", queryAccepted);
         if (queryAccepted != KErrNone)
@@ -1517,13 +1537,12 @@
             return;
             }
         }
-    // send code
-    // TODO the current code should be verified before
+    // 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);
-    TInt res = wait->WaitForRequestL();
+    res = wait->WaitForRequestL();
     RDEBUG("WaitForRequestL res", res);
     CleanupStack::PopAndDestroy(wait);
 
@@ -1569,6 +1588,8 @@
     TBool wcdmaSupported(
             FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma));
     TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin));
+    	RDEBUG("wcdmaSupported", wcdmaSupported);
+    	RDEBUG("upinSupported", upinSupported);
     if (wcdmaSupported || upinSupported)
         {
         TInt queryAccepted = KErrCancel;
@@ -1609,7 +1630,8 @@
         CSecQueryUi *iSecQueryUi;
         RDEBUG("CSecQueryUi", 0);
         iSecQueryUi = CSecQueryUi::NewL();
-        // TODO ESecUiCodeEtelReqest/ESecUiNone might be useful
+				iQueryCanceled = EFalse;
+        // ESecUiCodeEtelReqest/ESecUiNone might be useful
         // TODO also support Emergency
         if (StartUp || (secUiOriginatedQuery != ESecurityUIsSecUIOriginated)
                 || (err != KErrNone))
@@ -1628,6 +1650,7 @@
                         | lCancelSupported | ESecUiCodeEtelReqest);
         RDEBUG("iSecUi_password", 0);
         RDebug::Print(iSecUi_password);
+        iQueryCanceled = ETrue;
         delete iSecQueryUi;
         RDEBUG("queryAccepted", queryAccepted);
         if (queryAccepted != KErrNone)
@@ -1652,9 +1675,7 @@
             {
             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;
@@ -1672,13 +1693,13 @@
             case KErrLocked:
                 // code blocked; show error note and terminate.
                 if (StartUp)
-                    CSecuritySettings::ShowResultNoteL(R_CODE_ERROR,
+                    CSecuritySettings::ShowResultNoteL(res,
                             CAknNoteDialog::EErrorTone);
                 break;
             case KErrGsm0707SimWrong:
                 // sim lock active
                 break;
-            default:
+            default:	// for example, KErrArgument
                 CSecuritySettings::ShowErrorNoteL(res);
                 if (StartUp)
                     {
@@ -1741,6 +1762,7 @@
             CSecQueryUi *iSecQueryUi;
             RDEBUG("CSecQueryUi", 0);
             iSecQueryUi = CSecQueryUi::NewL();
+						iQueryCanceled = EFalse;
             // TODO ESecUiCodeEtelReqest/ESecUiNone might be useful
             // TODO also support Emergency
 
@@ -1755,6 +1777,7 @@
                             | ESecUiCancelSupported | ESecUiPukRequired);
             RDEBUG("iSecUi_password", 0);
             RDebug::Print(iSecUi_password);
+            iQueryCanceled = ETrue;
             delete iSecQueryUi;
             RDEBUG("queryAccepted", queryAccepted);
 
@@ -1770,6 +1793,7 @@
             CSecQueryUi *iSecQueryUi;
             RDEBUG("CSecQueryUi", 0);
             iSecQueryUi = CSecQueryUi::NewL();
+						iQueryCanceled = EFalse;
             // TODO ESecUiCodeEtelReqest/ESecUiNone might be useful
             // TODO also support Emergency
 
@@ -1780,6 +1804,7 @@
                             | ESecUiPukRequired);
             RDEBUG("aNewPassword", 0);
             RDebug::Print(aNewPassword);
+            iQueryCanceled = ETrue;
             delete iSecQueryUi;
             RDEBUG("queryAccepted", queryAccepted);
             if (queryAccepted != KErrNone)
@@ -1865,16 +1890,7 @@
     RDEBUG("aStatus", aStatus);
     RDEBUG("!!!!! this should never be called !!!!", 0);
 
-    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);
+    CSecuritySettings::ShowResultNoteL(aStatus, CAknNoteDialog::EErrorTone);
     }
 
 // End of file
--- a/securitydialogs/SecUi/Src/SecUiSecuritySettings.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/SecUi/Src/SecUiSecuritySettings.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -19,7 +19,6 @@
 #include <etelmm.h>
 #include <exterror.h>
 #include <textresolver.h>
-#include <SecUi.rsg>
 #include <aknnotedialog.h>
 #include <mmtsy_names.h>
 #include <centralrepository.h> 
@@ -30,19 +29,16 @@
 #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 <aknnotewrappers.h>
 #include <StringLoader.h>
 #include <RemoteLockSettings.h>
-#include "SecUiRemoteLockSettingPage.h"
-#endif // RD_REMOTELOCK
 #include <featmgr.h>
 
 #include "SecQueryUi.h"
@@ -102,15 +98,13 @@
      *    Needs customer TSY implementation
      *****************************************************/
 
+		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
 
     FeatureManager::InitializeLibL();
     // connect to ETel server
@@ -161,9 +155,7 @@
     // Cancel active requests
     if (iWait->IsActive())
         {
-#if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CManualSecuritySettings::~CSecuritySettings() CANCEL REQ"));
-#endif
+				RDEBUG("CancelAsyncRequest", 0);
         iPhone.CancelAsyncRequest(iWait->GetRequestType());
 
         switch (iWait->GetRequestType())
@@ -212,8 +204,8 @@
     TBuf<0x80> iCaption;
     iCaption.Copy(_L("ChangePinL"));
     TInt iShowError = 1;
-    ChangePinParamsL(iOldPassword, iNewPassword, iFlags, iCaption, iShowError);
-    RDEBUG("0", 0);
+    TInt err = ChangePinParamsL(iOldPassword, iNewPassword, iFlags, iCaption, iShowError);
+    RDEBUG("err", err);
     }
 
 //
@@ -234,9 +226,9 @@
     TBuf<0x80> iCaption;
     iCaption.Copy(_L("ChangeUPinL"));
     TInt iShowError = 1;
-    ChangeUPinParamsL(iOldPassword, iNewPassword, iFlags, iCaption,
+    TInt err = ChangeUPinParamsL(iOldPassword, iNewPassword, iFlags, iCaption,
             iShowError);
-    RDEBUG("0", 0);
+    RDEBUG("err", err);
 
     }
 
@@ -258,10 +250,9 @@
     TBuf<0x80> iCaption;
     iCaption.Copy(_L("ChangePin2L"));
     TInt iShowError = 1;
-    ChangePin2ParamsL(iOldPassword, iNewPassword, iFlags, iCaption,
+    TInt err = ChangePin2ParamsL(iOldPassword, iNewPassword, iFlags, iCaption,
             iShowError);
-    RDEBUG("0", 0);
-
+    RDEBUG("err", err);
     }
 //
 // ----------------------------------------------------------
@@ -281,9 +272,9 @@
     TBuf<0x80> iCaption;
     iCaption.Copy(_L("ChangeSecCodeL"));
     TInt iShowError = 1;
-    ChangeSecCodeParamsL(iOldPassword, iNewPassword, iFlags, iCaption,
+    TInt err = ChangeSecCodeParamsL(iOldPassword, iNewPassword, iFlags, iCaption,
             iShowError);
-    RDEBUG("0", 0);
+    RDEBUG("err", err);
     }
 //
 // ----------------------------------------------------------
@@ -316,223 +307,96 @@
 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 );
+		RDEBUG("aRemoteLockStatus", aRemoteLockStatus);
+		RDEBUG("aAutoLockPeriod", aAutoLockPeriod);
 
     if ( aRemoteLockStatus )
         {
-        previousItem = KRemoteLockSettingItemOn;
-        currentItem = KRemoteLockSettingItemOn;
+        aRemoteLockStatus = ETrue;
+
+        // If user wishes to enable remote lock
+        // a new remote lock code is required.
+        // RemoteLockCodeQueryL also 
+        retValue = RemoteLockCodeQueryL( aRemoteLockCode );
         }
     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;
+        aRemoteLockStatus = EFalse;
+        retValue = KErrNone;
+				// TODO this should calculate aAutoLockPeriod itself, and not trust the input
 
-            // If user wishes to enable remote lock
-            // a new remote lock code is required.
-            // RemoteLockCodeQueryL also 
-            retValue = RemoteLockCodeQueryL( aRemoteLockCode );
-            }
-        else if ( currentItem == KRemoteLockSettingItemOff )
+        // 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 )
             {
-#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 );
-                    }
-                }
+            // Disable lock setting from domestic OS
+            retValue = RemoteLockSetLockSettingL( EFalse );
             }
         else
             {
-            // This should never happen. But if it does don't change anything
-            retValue = KErrUnknown;
+            // 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
-        {
-        // 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
-
+		RDEBUG( "retValue", retValue );
     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 
+// 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.
 // ----------------------------------------------------------
-// no qtdone
+// qtdone
 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
+      // 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();
 
-    // ----- 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;
+    TInt queryAccepted = KErrCancel;
+        queryAccepted = KErrCancel;
+        CSecQueryUi * iSecQueryUi;
+        iSecQueryUi = CSecQueryUi::NewL();
+        // this queries both, and verifies itself
+        queryAccepted = iSecQueryUi->SecQueryDialog(
+                _L("RemoteMsg-New|RemoteMsg-Ver"), aRemoteLockCode,
+                SEC_REMOTELOCK_CODE_MIN_LENGTH, SEC_REMOTELOCK_CODE_MAX_LENGTH,
+                ESecUiAlphaSupported | ESecUiCancelSupported
+                        | ESecUiEmergencyNotSupported | ESecUiNone);
+        RDEBUG("aRemoteLockCode", 0);
+        RDebug::Print(aRemoteLockCode);
+        RDEBUG("queryAccepted", queryAccepted);
+        delete iSecQueryUi;
+        if (queryAccepted != KErrNone)
+            return KErrAbort;
 
-    // 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;
+            // 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 
 
-            if ( aRemoteLockCode.Length() <= RMobilePhone::KMaxMobilePasswordSize )
-                {
+
                 securityCode = aRemoteLockCode;
+								RDEBUG( "EMobilePhoneVerifySecurityCode", EMobilePhoneVerifySecurityCode );
                 iWait->SetRequestType( EMobilePhoneVerifySecurityCode );
                 RDEBUG( "VerifySecurityCode", 0 );
                 iPhone.VerifySecurityCode( iWait->iStatus, secCodeType, securityCode, unblockCode );
@@ -541,112 +405,21 @@
                 RDEBUG( "WaitForRequestL res", res );
 #ifdef __WINS__
                 if (res == KErrNotSupported || res == KErrTimedOut)
-                res = KErrNone;
+                res = KErrGsm0707IncorrectPassword;	// KErrGsm0707IncorrectPassword = incorrect code
 #endif
-                // The remote lock code matches the security code 
-                // and that is not allowed
-                while ( (res == KErrNone) && (buttonId == EEikBidOk))
+								RDEBUG( "KErrGsm0707IncorrectPassword", KErrGsm0707IncorrectPassword );
+                if(res == KErrNone)
                     {
-#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
+                    // 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;
+                    }
 
-                            {
-                            securityCode = aRemoteLockCode;
-                            iWait->SetRequestType( EMobilePhoneVerifySecurityCode );
-                            RDEBUG( "VerifySecurityCode", 0 );
-                            iPhone.VerifySecurityCode( iWait->iStatus, secCodeType, securityCode, unblockCode );
-                            RDEBUG( "WaitForRequestL", 0 );
-                            res = iWait->WaitForRequestL();
-#ifdef __WINS__
-                            if (res == KErrNotSupported || res == KErrTimedOut)
-                            res = KErrNone;
-#endif
-                            RDEBUG( "WaitForRequestL res", res );
-                            }
-                        }
-
-                    }
-                //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
+		RDEBUG( "retValue", retValue );
     return retValue;
-#else //! RD_REMOTELOCK
-    return KErrNotSupported;
-#endif //RD_REMOTELOCK
     }
 //
 // ----------------------------------------------------------
@@ -654,18 +427,40 @@
 // Changes lock setting in domestic OS. Changing the domestic OS lock setting
 // requires user to enter the security code.
 // ----------------------------------------------------------
-// no qtdone
+// qtdone
 TInt CSecuritySettings::RemoteLockSetLockSettingL(TBool aLockSetting)
     {
-#ifdef RD_REMOTELOCK
     TInt retValue( KErrNone );
+		RDEBUG( "aLockSetting", aLockSetting );
 
-#ifdef _DEBUG
-    RDebug::Print(_L("(SecUi)CSecuritySettings::RemoteLockSetLockSettingL( %d ) - Enter" ), aLockSetting );
-#endif // _DEBUG
+
     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;
@@ -674,13 +469,12 @@
         {
         lockSetting = RMobilePhone::ELockSetDisabled;
         }
+		RDEBUG("future lockSetting", lockSetting);
 
     iWait->SetRequestType( EMobilePhoneSetLockSetting );
     RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, ESecurityUIsQueryRequestOk);
     RDEBUG( "SetLockSetting", 0 );
-    iPhone.SetLockSetting( iWait->iStatus, lockType, lockSetting );
-
-    // Wait for code verify to complete
+    iPhone.SetLockSetting( iWait->iStatus, lockType, lockSetting );	// this will PassPhraseRequiredL
     RDEBUG( "WaitForRequestL", 0 );
     retValue = iWait->WaitForRequestL();
     RDEBUG( "WaitForRequestL retValue", retValue );
@@ -692,48 +486,25 @@
     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
+		RDEBUG( "retValue", retValue );
     return retValue;
-#else //! RD_REMOTELOCK
-    return KErrNotSupported;
-#endif //RD_REMOTELOCK
     }
 
 //
@@ -748,10 +519,7 @@
      *    Series 60 Customer / ETel
      *    Series 60  ETel API
      *****************************************************/
-#if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeSimSecurityL()"));
-#endif
-
+		RDEBUG("0", 0);
     RMobilePhone::TMobilePhoneLockInfoV1 lockInfo;
     RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo);
     RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockPhoneToICC;
@@ -774,12 +542,9 @@
 #endif
     User::LeaveIfError(status);
     TInt currentItem = 0;
-
+		RDEBUG("lockInfo.iSetting", lockInfo.iSetting);
     if (lockInfo.iSetting == RMobilePhone::ELockSetDisabled)
         {
-#if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeSimSecurityL()lockInfo: ELockSetDisabled"));
-#endif
         currentItem = 1; // off
         }
 
@@ -807,9 +572,7 @@
 #endif
 
     // the error was displayed in the handler
-#if defined(_DEBUG)
-    RDebug::Print( _L("(SECUI)CSecuritySettings::ChangeSimSecurityL(): RETURN CODE: %d"), status);
-#endif        
+		RDEBUG("status", status);
     switch (status)
         {
         case KErrNone:
@@ -857,12 +620,14 @@
     TBuf<0x80> iCaption;
     iCaption.Copy(_L("ChangePinRequestL"));
     TInt iShowError = 1;
-    ChangePinRequestParamsL(
-            1/* TODO it's imposible to know if we want to set or clear*/,
+    TInt err = ChangePinRequestParamsL(
+            1/* it's imposible to know if we want to set or clear*/,
             iOldPassword, iFlags, iCaption, iShowError);
-    RDEBUG("0", 0);
-
-    return ETrue;
+    RDEBUG("err", err);
+		if(err==KErrNone)
+    	return ETrue;
+		else
+   		return EFalse;
     }
 
 //
@@ -876,12 +641,10 @@
     TBool wcdmaSupported(
             FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma));
     TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin));
+		RDEBUG("wcdmaSupported", wcdmaSupported);
+		RDEBUG("upinSupported", upinSupported);
     if (wcdmaSupported || upinSupported)
         {
-#if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeUPinRequestL()"));
-#endif
-
         TInt simState;
         TInt err(KErrGeneral);
         err = RProperty::Get(KPSUidStartup, KPSSimStatus, simState);
@@ -916,33 +679,21 @@
         User::LeaveIfError(status);
         TInt currentItem = 0;
 
-#if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeUPinRequestL() GetLockInfo"));
-#endif
-
+				RDEBUG("lockInfo.iSetting", lockInfo.iSetting);
         if (lockInfo.iSetting == RMobilePhone::ELockSetDisabled)
             {
-#if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeUPinRequestL() lockInfo: ELockSetDisabled"));
-#endif
             currentItem = 1; // off
             }
 
         if (currentItem == 0) // switch the flag
             {
-#if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeUPinRequestL() currentItem: ELockSetDisabled"));
-#endif
             lockChangeSetting = RMobilePhone::ELockSetDisabled;
             }
         else
             {
-#if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeUPinRequestL() currentItem: ELockSetEnabled"));
-#endif
             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,
@@ -958,7 +709,7 @@
         RDEBUG("WaitForRequestL status", status);
         // Lower the flag                           
         RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery,
-                ESecurityUIsETelAPIOriginated);
+                ESecurityUIsSecUIOriginatedUninitialized);
 #ifdef __WINS__
         if (status == KErrNotSupported || status == KErrTimedOut)
         status = KErrNone;
@@ -1018,12 +769,10 @@
     TBool wcdmaSupported(
             FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma));
     TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin));
+				RDEBUG("wcdmaSupported", wcdmaSupported);
+				RDEBUG("upinSupported", upinSupported);
     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);
@@ -1047,9 +796,7 @@
 
         RMobilePhone::TMobilePhoneLockInfoV1 lockInfo;
         RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo);
-#if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecuritySettings::SwitchPinCodesL() GetLockInfo"));
-#endif    
+				RDEBUG("EMobilePhoneGetLockInfo", EMobilePhoneGetLockInfo);
         iWait->SetRequestType(EMobilePhoneGetLockInfo);
 
         if (activeCode == RMobilePhone::ESecurityUniversalPin)
@@ -1080,11 +827,10 @@
             }
 
         // code request must be ON to change active code.
+				RDEBUG("lockInfo.iSetting", lockInfo.iSetting);
         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,
@@ -1094,41 +840,26 @@
                 {
                 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;
             }
 
         iCustomPhone.GetActivePin(activeCode);
         TInt currentItem = 0;
 
-#if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecuritySettings::SwitchPinCodesL() GetLockInfo"));
-#endif
-
+				RDEBUG("activeCode", activeCode);
         if (activeCode == RMobilePhone::ESecurityUniversalPin)
             {
-#if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecuritySettings::SwitchPinCodesL() active code: UPIN"));
-#endif
             currentItem = 1; // UPIN
             }
-
         if (currentItem == 0) // switch the flag
             {
-#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;
             }
+				RDEBUG("lockType", lockType);
 
         // Raise a flag to indicate that the code
         // request coming from ETEL has originated from SecUi and not from Engine.
@@ -1145,7 +876,7 @@
         RDEBUG("WaitForRequestL status", status);
         // Lower the flag                            
         RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery,
-                ESecurityUIsETelAPIOriginated);
+                ESecurityUIsSecUIOriginatedUninitialized);
 #ifdef __WINS__
         if (status == KErrNotSupported || status == KErrTimedOut)
         status = KErrNone;
@@ -1386,9 +1117,7 @@
      *    Series 60 Customer / ETel
      *    Series 60  ETel API
      *****************************************************/
-#if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecuritySettings::SetFdnModeL()"));
-#endif
+		RDEBUG("0", 0);
     RMmCustomAPI::TSecurityCodeType secCodeType =
             RMmCustomAPI::ESecurityCodePin2;
 
@@ -1454,9 +1183,7 @@
     status = KErrNone;
 #endif
 
-#if defined(_DEBUG)
-    RDebug::Print( _L("(SECUI)CSecuritySettings::SetFdnModeL(): RETURN CODE: %d"), status);
-#endif
+		RDEBUG("status", status);
     switch (status)
         {
         case KErrNone:
@@ -1494,9 +1221,7 @@
      *    Series 60 Customer / ETel
      *    Series 60  ETel API
      *****************************************************/
-#if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecuritySettings::GetFdnMode()"));
-#endif
+		RDEBUG("0", 0);
     return iPhone.GetFdnStatus(aFdnMode);
     }
 
@@ -1524,12 +1249,6 @@
     {
     RDEBUG("aResourceID", aResourceID);
 
-    /*
-     CAknNoteDialog* noteDlg = new (ELeave) CAknNoteDialog(REINTERPRET_CAST(CEikDialog**,&noteDlg));
-     noteDlg->SetTimeout(CAknNoteDialog::ELongTimeout);
-     noteDlg->SetTone(aTone);
-     noteDlg->ExecuteLD(aResourceID);
-     */
     CHbDeviceMessageBoxSymbian* messageBox =
             CHbDeviceMessageBoxSymbian::NewL(
                     CHbDeviceMessageBoxSymbian::EWarning);
@@ -1653,6 +1372,22 @@
             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;
 
         default: // " "
             titleTr.Append(_L("Specific Error"));
@@ -1663,8 +1398,13 @@
     RDEBUG("aResourceID", aResourceID);
     RDebug::Print(titleTr);
 
-    _LIT(KIconName, "qtg_small_smiley_wondering");
-    messageBox->SetIconNameL(KIconName);
+    _LIT(KIconNameWondering, "qtg_small_smiley_wondering");
+    _LIT(KIconNameSmile, "qtg_small_smiley_smile");
+    if(aResourceID==0 || aResourceID==R_CONFIRMATION_NOTE)
+    	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
@@ -1688,12 +1428,10 @@
             FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma));
     TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin));
     TBool isSupported = EFalse;
+		RDEBUG("wcdmaSupported", wcdmaSupported);
+		RDEBUG("upinSupported", upinSupported);
     if (wcdmaSupported || upinSupported)
         {
-#if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinSupported() BEGIN"));
-#endif
-
         RMobilePhone::TMobilePhoneLockInfoV1 lockInfo;
 
         //get lock info
@@ -1707,15 +1445,12 @@
         RDEBUG("WaitForRequestL res", res);
         if ((res == KErrNotSupported) || (res == KErrGsmInvalidParameter))
             {
-#if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinSupported(): NOT SUPPORTED"));
-#endif
+            RDEBUG("0", 0);
             isSupported = EFalse;
             }
         else
             {
-            RDEBUG("0", 0);
-
+            RDEBUG("1", 1);
             isSupported = ETrue;
             }
         }
@@ -1805,14 +1540,12 @@
     User::LeaveIfError(err);
     TBool simRemoved(simState == ESimNotPresent);
 
+		RDEBUG("simRemoved", simRemoved);
     if (simRemoved)
         {
         ShowResultNoteL(R_INSERT_SIM, CAknNoteDialog::EErrorTone);
         return KErrAccessDenied;
         }
-#if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecuritySettings::ChangePinParamsL()"));
-#endif    
     RMobilePhone::TMobilePhoneSecurityCode secCodeType;
     secCodeType = RMobilePhone::ESecurityCodePin1;
 
@@ -1918,7 +1651,7 @@
         if (res != KErrNone)
             {
             ShowResultNoteL(res, CAknNoteDialog::EErrorTone);
-            return res; // TODO not sure if it's wise to exit now.
+            return res; // not sure if it's wise to exit now.
             }
 
         newPassword = _L("");
@@ -2310,7 +2043,7 @@
 
     RDEBUG("codeInfo.iRemainingEntryAttempts",
             codeInfo.iRemainingEntryAttempts);
-    if (codeInfo.iRemainingEntryAttempts == KMaxNumberOfPINAttempts) // TODO this might be 10
+    if (codeInfo.iRemainingEntryAttempts == KMaxNumberOfPINAttempts)
         codeInfo.iRemainingEntryAttempts = -1;
 
     /* request PIN using QT */
@@ -2426,9 +2159,6 @@
      *    Series 60 Customer / ETel
      *    Series 60  ETel API
      *****************************************************/
-#if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeSecCodeParamsL()"));
-#endif
     TInt res = KErrNone;
     TInt queryAccepted = KErrCancel;
     RMobilePhone::TMobilePassword newPassword;
@@ -2536,12 +2266,6 @@
                     RMobilePhone::ELockPhoneDevice;
             RMobilePhone::TMobilePhoneLockSetting lockChangeSetting =
                     RMobilePhone::ELockSetEnabled;
-            if (oldPassword.Length() == 6)
-                {
-                lockChangeSetting = RMobilePhone::ELockSetDisabled;
-                RDEBUG("RMobilePhone::ELockSetDisabled",
-                        RMobilePhone::ELockSetDisabled);
-                }
             iWait->SetRequestType(EMobilePhoneSetLockSetting);
             RDEBUG("SetLockSetting", 0);
             iPhone.SetLockSetting(iWait->iStatus, lockType, lockChangeSetting);
@@ -2573,7 +2297,7 @@
                 if (scpClient.Connect() == KErrNone)
                     {
                     RDEBUG("scpClient.StoreCode", 0);
-                    /*
+                     // this is the old method. Obsolete now
                      // scpClient.StoreCode( newCode );
                      RArray<TDevicelockPolicies> aFailedPolicies;
                      TDevicelockPolicies failedPolicy;
@@ -2582,11 +2306,10 @@
                      RDEBUG( "retLockcode", retLockcode );
                      RDEBUG( "aFailedPolicies.Count()", aFailedPolicies.Count() );
                      for(TInt i=0; i<aFailedPolicies.Count(); i++)
-                     {
-                     failedPolicy = aFailedPolicies[i];
-                     RDEBUG( "failedPolicy", failedPolicy );
-                     }
-                     */
+	                     {
+	                     failedPolicy = aFailedPolicies[i];
+	                     RDEBUG( "failedPolicy", failedPolicy );
+	                     }
                     scpClient.Close();
                     }
                 }
@@ -2626,6 +2349,7 @@
 
 /**************************************/
 // 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)
@@ -2661,7 +2385,6 @@
                 if ((lex.Val(maxPeriod) == KErrNone) && (maxPeriod > 0))
                     {
                     RDEBUG("from SCP maxPeriod", maxPeriod);
-                    // nothing to do
                     }
                 else
                     {
@@ -2687,10 +2410,8 @@
 
         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                
+            	RDEBUG("The period is not allowed by TARM", aPeriod);
+            	RDEBUG( "maxPeriod", maxPeriod );
             allow = EFalse;
             ShowResultNoteL(R_SECUI_TEXT_AUTOLOCK_MUST_BE_ACTIVE,
                     CAknNoteDialog::EErrorTone);
@@ -2704,8 +2425,6 @@
 
     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
@@ -2738,10 +2457,6 @@
         delete remoteLockSettings;
         remoteLockSettings = NULL;
 
-#else // not defined RD_REMOTELOCK
-        lockChange = RMobilePhone::ELockSetDisabled;
-
-#endif // RD_REMOTELOCK
         }
     else
         {
@@ -2750,6 +2465,7 @@
         }
 
     iWait->SetRequestType(EMobilePhoneSetLockSetting);
+    RDEBUG("lockChange", lockChange);
     RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel,
             ESecurityUIsQueryRequestOk);
     RDEBUG("SetLockSetting", 0);
@@ -2765,23 +2481,16 @@
     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
+        		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:
-#if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL() IncorrectPassword"));
-#endif
+        		RDEBUG("KErrAccessDenied", KErrAccessDenied);
             // code was entered erroneously
             ShowResultNoteL(KErrAccessDenied, CAknNoteDialog::EErrorTone); // the old code didn't show messages
             return ChangeAutoLockPeriodParamsL(oldPeriod, aOldPassword,
@@ -2790,16 +2499,12 @@
             // User pressed "cancel" in the code query dialog.
             return oldPeriod;
         default:
-#if defined(_DEBUG)
-            RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL() default"));
-#endif
+        		RDEBUG("default", status);
             ShowResultNoteL(status, CAknNoteDialog::EErrorTone); // the old code didn't show messages
             return ChangeAutoLockPeriodParamsL(oldPeriod, aOldPassword,
                     aFlags, aCaption, aShowError); // ask again
         }
-#if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL() END"));
-#endif
+ 		RDEBUG("aPeriod", aPeriod);
     return aPeriod;
     }
 /*****************************/
@@ -2810,13 +2515,6 @@
     {
     RDEBUG("aEnable", aEnable);
     RDEBUG("aFlags", aFlags);
-    /*****************************************************
-     *    Series 60 Customer / ETel
-     *    Series 60  ETel API
-     *****************************************************/
-#if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecuritySettings::ChangePinRequestParamsL()"));
-#endif      
     TInt simState = 0;
     TInt lEnable = aEnable;
     TInt err(KErrGeneral);
@@ -2827,7 +2525,7 @@
     if (simRemoved)
         {
         ShowResultNoteL(R_INSERT_SIM, CAknNoteDialog::EErrorTone);
-        return EFalse;
+        return KErrAccessDenied;
         }
 
     RMobilePhone::TMobilePhoneLockInfoV1 lockInfo;
@@ -2851,10 +2549,6 @@
 #endif
     User::LeaveIfError(status);
 
-#if defined(_DEBUG)
-    RDebug::Print(_L("(SECUI)CSecuritySettings::ChangePinRequestParamsL() GetLockInfo"));
-#endif
-
     if (aOldPassword.Length() == 0) // only if input parameters are empty
         {
         // switch the value.
@@ -2864,32 +2558,22 @@
             lEnable = 0; // off
         }
 
+		RDEBUG("lEnable", lEnable);
     if (lEnable == 0)
         {
-#if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecuritySettings::ChangePinRequestParamsL() currentItem: ELockSetDisabled"));
-#endif
         lockChangeSetting = RMobilePhone::ELockSetDisabled;
         }
     else
         {
-#if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecuritySettings::ChangePinRequestParamsL() currentItem: ELockSetEnabled"));
-#endif
         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);
-    if (tRet != KErrNone)
-        {
-#if defined(_DEBUG)
-        RDebug::Print(_L("(SECUI)CSecuritySettings::ChangePinRequestParamsL():\
-            FAILED to set the SECUI query Flag: %d"), tRet);
-#endif
-        }
+		RDEBUG("tRet", tRet);
 
     // Change the lock setting
     iWait->SetRequestType(EMobilePhoneSetLockSetting);
@@ -2907,7 +2591,7 @@
 
     // Lower the flag                             
     RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery,
-            ESecurityUIsETelAPIOriginated);
+            ESecurityUIsSecUIOriginatedUninitialized);
 
     switch (status)
         {
@@ -2920,7 +2604,7 @@
             // not allowed with this sim
             ShowResultNoteL(R_OPERATION_NOT_ALLOWED,
                     CAknNoteDialog::EErrorTone);
-            return EFalse;
+            return KErrGsm0707OperationNotAllowed;
             }
         case KErrGsm0707IncorrectPassword:
         case KErrAccessDenied:
@@ -2932,11 +2616,11 @@
         case KErrGsmSSPasswordAttemptsViolation:
         case KErrLocked:
             {
-            return ETrue;
+            return KErrLocked;
             }
         case KErrAbort:
             {
-            return EFalse;
+            return KErrAbort;
             }
         default:
             {
@@ -2944,7 +2628,7 @@
                     aCaption, aShowError);
             }
         }
-    return ETrue;
+    return KErrNone;
     }
 
 //
--- a/securitydialogs/SecUi/Src/SecUiSystemLock.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/SecUi/Src/SecUiSystemLock.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -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"
@@ -50,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();
@@ -64,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
@@ -143,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()
@@ -152,6 +155,7 @@
     *    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
@@ -160,17 +164,20 @@
             CDevicelockAccessApi* iDevicelockAccess = CDevicelockAccessApi::NewL( );
            	RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
 						iDevicelockAccess->OfferDevicelock();
-						//				EnableDevicelock( EDevicelockManual );
+						// 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);
@@ -188,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 Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/SecUi/Src/SecUiWait.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -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 Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/SecUi/group/SecUi.mmp	Thu Jul 22 16:43:28 2010 +0100
@@ -42,84 +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
-    SOURCE  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 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/SecQueryUi.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)
--- a/securitydialogs/SecUi/group/bld.inf	Thu Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/SecUi/group/bld.inf	Thu Jul 22 16:43:28 2010 +0100
@@ -26,20 +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
-/*
-Not any more. The settings are replaced by Qt-style plugins
-../GSSimSecPlugin/GSSimSecPlugin.mmp
-*/
--- a/securitydialogs/SecUi/rom/GSSimSecPlugin.iby	Thu Jun 17 12:11:51 2010 +0100
+++ /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
-				// Now replaced by a QT plugin
-        // ECOM_PLUGIN( GSSimSecPlugin.dll, 10207438.rsc )
-
-    #endif // RD_GS_RENOVATION
-
-#endif // GSSIMSECPLUGIN_IBY
-//  End of File
--- a/securitydialogs/SecUi/rom/GSSimSecPluginResources.iby	Thu Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  GSSecurityPlugin ROM resources.
-*
-*/
-
-#ifndef GSSIMSECPLUGINRESOURCES_IBY
-#define GSSIMSECPLUGINRESOURCES_IBY
-
-    #ifdef RD_GS_RENOVATION
-
-        // Now replaced by a QT plugin
-        // 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/Src/SecurityNotifier.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/Securitynotifier/Src/SecurityNotifier.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -228,18 +228,7 @@
 	#if defined(_DEBUG)
 	RDebug::Printf( "%s %s (%u) searching for autolock.exe =%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0x0 );
 	#endif
-	
-   // Start Dirty and quick hack    
-   #include <PSVariables.h>   // Property values
-   #include <coreapplicationuisdomainpskeys.h>
-   _LIT_SECURITY_POLICY_PASS(KReadPolicy);
-   _LIT_SECURITY_POLICY_C1(KWritePolicy, ECapabilityWriteDeviceData);
-   int ret = RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, RProperty::EInt, KReadPolicy, KWritePolicy);
-   RDebug::Printf( "%s %s (%u) EAutolockOff=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 );
-   RProperty::Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, 1);
-   // End Dirty and quick hack
 		
-	
 	TApaTaskList taskList( CCoeEnv::Static()->WsSession() );
 	const TUid KAutolockUid = { 0x100059B5 };
 	TApaTask task( taskList.FindApp( KAutolockUid ) );
@@ -257,9 +246,9 @@
 		commandLine->SetCommandL( EApaCommandRun );
 		
 		// Try to launch the application.        
-		User::LeaveIfError(ls.StartApp(*commandLine));
+		TInt err = ls.StartApp(*commandLine);
 		#if defined(_DEBUG)
-		RDebug::Printf( "%s %s (%u) autolock.exe created=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0x2 );
+		RDebug::Printf( "%s %s (%u) autolock.exe err=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, err );
 		#endif
 		
 		CleanupStack::PopAndDestroy(2); // commandLine, ls
--- a/securitydialogs/Securitynotifier/Src/Securitynotifierwrapper.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/Securitynotifier/Src/Securitynotifierwrapper.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -18,7 +18,7 @@
 
 
 #include <ecom/implementationproxy.h>
-
+#include <e32notif.h>
 #include <AknNotifierWrapper.h> // link against aknnotifierwrapper.lib
 
 #define KMyNotifierUid TUid::Uid(0x10005988) //  uid
--- a/securitydialogs/group/bld.inf	Thu Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/group/bld.inf	Thu Jul 22 16:43:28 2010 +0100
@@ -24,10 +24,12 @@
 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"
 
--- a/securitydialogs/lockapp/cenrep/AutolockPrivateCRKeys.h	Thu Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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/bld.inf	Thu Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/lockapp/group/bld.inf	Thu Jul 22 16:43:28 2010 +0100
@@ -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 Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/lockapp/group/lockapp.mmp	Thu Jul 22 16:43:28 2010 +0100
@@ -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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +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 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
-    {
-    ESecurityUIsQueryRequestUninitialized = 0,
-    ESecurityUIsQueryRequestOk,
-    ESecurityUIsQueryRequestCanceled
-    };
-
-/**
- * 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 to tell SysAp to switch-on the lights.
- */    
-const TUint32 KSecurityUIsLights  = 0x00000308;
-enum TSecurityUIsLights
-    {
-    ESecurityUIsLightsUninitialized = 0,
-    ESecurityUIsLightsLockOnRequest,
-    ESecurityUIsLightsQueryOnRequest,
-    ESecurityUIsLightsLockOffRequest,
-    ESecurityUIsLightsLastValue
-    };
-
-#endif // SECURITYUISPRIVATEPSKEYS_H
-
-// End of File
--- a/securitydialogs/lockapp/rom/lockapp.iby	Thu Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/lockapp/rom/lockapp.iby	Thu Jul 22 16:43:28 2010 +0100
@@ -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,21 +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_EXE(lockapp)
-S60_APP_EXE_UDEB(lockapp)
-S60_APP_AIF_RSC(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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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	Thu Jul 22 16:43:28 2010 +0100
@@ -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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,209 +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( )
-    {
-    	RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0x8 );
-    	    
-   // 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
-	 	  RDebug::Printf( "%s %s (%u) 1=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0x1 );
-	    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));
-	    	  RDebug::Printf( "%s %s (%u) autolock.exe created=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0x7 );
-	        
-	        CleanupStack::PopAndDestroy(2); // commandLine, ls
-			}
-	    Exit();
-	  }
-
-    INFO( "CLockAppAppUi::ConstructL started" );
-
-    // 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 );
-    INFO( "CLockAppAppUi::ConstructL finished" );
-    }
-
-// ---------------------------------------------------------------------------
-// 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 ) )
-                {
-                INFO( "CLockAppAppUi::HandleMessageL(): Admin command received, unlocking" );
-                iStateControl->DisableDevicelockL();
-                }
-            else
-                {
-                INFO( "CLockAppAppUi::HandleMessageL(): Unauthorized attempt to unlock" );
-                }
-            CleanupStack::PopAndDestroy(); // calls Close() on scpClient
-            }
-        else
-            {
-            INFO( "CLockAppAppUi::HandleMessageL(): Failed to connect to SCP, ignoring unlock-message." );
-            }
-        }
-    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 )
-    {
-		RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-    if ( aEvent.Type() == TRawEvent::EKeyDown )
-        {
-        RDebug::Printf("CLockAppAppUi::HandleWsEventL() - aEvent.Key()->iCode: %d", aEvent.Key()->iCode );
-        }
-
-    // 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 Jun 17 12:11:51 2010 +0100
+++ /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())
-    {
-	RDebug::Printf( "%s %s (%u) 1=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 );
-    }
-
-// ---------------------------------------------------------------------------
-// Second phase constructor.
-// ---------------------------------------------------------------------------
-void CLockAppBaseControl::ConstructL( )
-    {
-	RDebug::Printf( "%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 )
-    {   
-    	RDebug::Printf( "%s %s (%u) aCapture=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aCapture );
-    	RDebug::Printf( "%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 Jun 17 12:11:51 2010 +0100
+++ /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
-RDebug::Printf( "%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 )
-    {
-    	    RDebug::Printf( "%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 )
-    {
-RDebug::Printf( "%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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 );
-    RDebug::Printf( "%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)
-    {
-    	RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-
-    }
-
-// ---------------------------------------------------------------------------
-// Destructor.
-// ---------------------------------------------------------------------------
-CLockAppDevicelockControl::~CLockAppDevicelockControl( )
-    {
-    	RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-
-    /*****************************************************
-    *    S60 Customer / ETel
-    *    S60  ETel API
-    *****************************************************/
-    /*****************************************************
-    *    S60 Customer / TSY
-    *    Needs customer TSY implementation
-    *****************************************************/
-    RDebug::Printf( "%s %s (%u) iCustomPhoneInitialized=%x -> -1 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iCustomPhoneInitialized );
-    iCustomPhoneInitialized=-1;
-    if ( iCustomPhone.SubSessionHandle( ) )
-        {
-        iCustomPhone.Close( );
-        RDebug::Printf( "%s %s (%u) iCustomPhoneInitialized=%x -> -2 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iCustomPhoneInitialized );
-        iCustomPhoneInitialized=-2;
-        }
-
-		RDebug::Printf( "%s %s (%u) iPhoneInitialized=%x -> -1 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPhoneInitialized );
-		iPhoneInitialized=-1;
-    if ( iPhone.SubSessionHandle( ) )
-        {
-        iPhone.Close( );
-        RDebug::Printf( "%s %s (%u) iPhoneInitialized=%x -> -2 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPhoneInitialized );
-				iPhoneInitialized=-2;
-        }
-
-    RDebug::Printf( "%s %s (%u) iTelServerInitialized=%x -> -1 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iTelServerInitialized );
-    iTelServerInitialized=-1;
-    if ( iTelServer.Handle( ) )
-        {
-        iTelServer.UnloadPhoneModule( KMmTsyModuleName );
-        iTelServer.Close( );
-        RDebug::Printf( "%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 );
-    RDebug::Printf( "%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 );
-        }
-    RDebug::Printf( "%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 ) );
-    RDebug::Printf( "%s %s (%u) iTelServerInitialized=%x -> 5 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iTelServerInitialized );
-    iTelServerInitialized=5;
-    User::LeaveIfError( iTelServer.GetPhoneInfo( KPhoneIndex, PhoneInfo ) );
-    RDebug::Printf( "%s %s (%u) iTelServerInitialized=%x -> 6 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iTelServerInitialized );
-    iTelServerInitialized=6;
-    User::LeaveIfError( iPhone.Open( iTelServer, PhoneInfo.iName ) );
-		RDebug::Printf( "%s %s (%u) iPhoneInitialized=%x -> 2 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPhoneInitialized );
-		iPhoneInitialized=2;
-    User::LeaveIfError( iCustomPhone.Open( iPhone ) );
-		RDebug::Printf( "%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 );
-		RDebug::Printf( "%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");
-        RDebug::Printf( "%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( )
-    {
-    	    	RDebug::Printf( "%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)
-				{
-				RDebug::Printf( "%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
-    *****************************************************/
-
-
-		RDebug::Printf( "%s %s (%u) 111 value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-
-    // RDebug::Printf( "%s %s (%u) iStateControl=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iStateControl );
-
-		RDebug::Printf( "%s %s (%u) checking iPhoneInitialized=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-		RDebug::Printf( "%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);
-
-		RDebug::Printf( "%s %s (%u) before getLockInfoStatus=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-    TRequestStatus getLockInfoStatus;
-		RDebug::Printf( "%s %s (%u) after getLockInfoStatus=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-		
-		RDebug::Printf( "%s %s (%u) iPhoneInitialized=%x -> 5 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPhoneInitialized );
-		iPhoneInitialized=5;
-    iPhone.GetLockInfo( getLockInfoStatus, lockType, lockInfoPkg );
-		RDebug::Printf( "%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;
-				RDebug::Printf( "%s %s (%u) iPhoneInitialized=%x -> 8 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPhoneInitialized );
-				iPhoneInitialized=8;
-        iPhone.SetLockSetting( setLockSettingStatus, lockType, lockChange );
-				RDebug::Printf( "%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)
-	         RDebug::Printf( "%s %s (%u) getting 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("(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)
-	         RDebug::Printf( "%s %s (%u) getting KPSUidStartup+KStartupSecurityCodeQueryStatus=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, tRet );
-	         RDebug::Printf( "%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 )
-    {
-    RDebug::Printf( "%s %s (%u) aEnvMask=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aEnvMask );
-    RDebug::Printf( "%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 );
-    		RDebug::Printf( "%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);
-    			RDebug::Printf( "%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 ) )
-    	{
-      RDebug::Printf( "%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 );
-	        		RDebug::Printf( "%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 );
-    						RDebug::Printf( "%s %s (%u) KAknCapServerUid=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, KAknCapServerUid );
-			        	if( capserver.Exists() )
-			        	    {
-	        	        RDebug::Printf( "%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 );
-	        	RDebug::Printf( "%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 )
-    {
-    RDebug::Printf( "%s %s (%u) aKeyId=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aKeyId );
-    RDebug::Printf( "%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 )
-    {
-    RDebug::Printf( "%s %s (%u) KPSUidCoreApplicationUIs=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, KPSUidCoreApplicationUIs );
-    RDebug::Printf( "%s %s (%u) aKeyId=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aKeyId );
-    RDebug::Printf( "%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 )
-    {
-    RDebug::Printf( "%s %s (%u) aKeyEvent.iCode=%x aType=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aKeyEvent.iCode, aType );
-    RDebug::Printf( "%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 );
-		RDebug::Printf( "%s %s (%u) iPhoneInitialized=%x -> 10 ", __FILE__, __PRETTY_FUNCTION__, __LINE__, iPhoneInitialized );
-		iPhoneInitialized=10;
-    CSecurityHandler* handler = new (ELeave) CSecurityHandler( iPhone );
-		RDebug::Printf( "%s %s (%u) got handler=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 );
-    CleanupStack::PushL( handler );
-    TSecUi::InitializeLibL( );
-		RDebug::Printf( "%s %s (%u) got TSecUi::InitializeLibL=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 );
-    iShowingSecCodeQuery = ETrue;
-    TRAPD(err, {
-								RDebug::Printf( "%s %s (%u) before AskSecCodeInAutoLockL=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 );
-                TBool ret = handler->AskSecCodeInAutoLockL();
-								RDebug::Printf( "%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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,702 +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);
-    idle = ETrue; // don't care about idle state. Phone should autolock on any UI, not only HomeSreeen.
-    INFO_2("CLockAppKeyguardControl::AutoActivationAllowedL - idle: %d %d", value, idle);
-    value = 0;
-		/* This is not used any more because screensavers are removed now
-    RProperty::Get( KPSUidScreenSaver, KScreenSaverOn, value );
-    screenSaverOn = (value > 0);
-    */
-    screenSaverOn = ETrue;
-    
-    INFO_2("CLockAppKeyguardControl::AutoActivationAllowedL - screenSaverOn: %d %d", value, screenSaverOn);
-    value = 0;
-		/* This is not used any more because screensavers are removed now
-    RProperty::Get( KPSUidScreenSaver, KScreenSaverActivatedFromIdle, value );
-    screenSaverStertedFromIdle = (value == KSsStartedFromIdle);
-    */
-    screenSaverStertedFromIdle = ETrue;
-    
-    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 )
-    {
-    RDebug::Printf( "%s %s (%u) aKeyEvent.iCode=%x aType=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aKeyEvent.iCode, aType );
-    RDebug::Printf( "%s %s (%u) iActive=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iActive );
-    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:
-        						RDebug::Printf( "%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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,949 +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
-		/* This is not used any more because screensavers are removed now
-    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 );
-		/* This is not used any more because screensavers are removed now
-    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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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 Jun 17 12:11:51 2010 +0100
+++ /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/group/bld.inf	Thu Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/lockclient/group/bld.inf	Thu Jul 22 16:43:28 2010 +0100
@@ -20,11 +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 should be done in the QT way, using  lockclient.pro
+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	Thu Jul 22 16:43:28 2010 +0100
@@ -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	Thu Jul 22 16:43:28 2010 +0100
@@ -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
+
--- a/securitydialogs/lockclient/group/lockclient.pro	Thu Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/lockclient/group/lockclient.pro	Thu Jul 22 16:43:28 2010 +0100
@@ -40,8 +40,12 @@
 
 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 Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/lockclient/inc/lockaccessextension.h	Thu Jul 22 16:43:28 2010 +0100
@@ -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;
 
 /**
--- a/securitydialogs/lockclient/rom/lockclient.iby	Thu Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/lockclient/rom/lockclient.iby	Thu Jul 22 16:43:28 2010 +0100
@@ -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 Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/lockclient/src/devicelockaccessapi.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -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 Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/lockclient/src/keyguardaccessapi.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -31,8 +31,7 @@
 // ---------------------------------------------------------------------------
 EXPORT_C CKeyguardAccessApi* CKeyguardAccessApi::NewL( )
     {
-    qDebug() << "============= CKeyguardAccessApi::NewL";
-    RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
+    RDEBUG("0", 0);
 
     CKeyguardAccessApi* self = new (ELeave) CKeyguardAccessApi( );
     CleanupStack::PushL( self );
@@ -46,8 +45,7 @@
 // ---------------------------------------------------------------------------
 CKeyguardAccessApi::CKeyguardAccessApi()
     {
-    qDebug() << "============= CKeyguardAccessApi::CKeyguardAccessApi";
-    RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
+    RDEBUG("0", 0);
     }
 
 // ---------------------------------------------------------------------------
@@ -68,8 +66,7 @@
 // ---------------------------------------------------------------------------
 void CKeyguardAccessApi::ConstructL( )
     {
-    qDebug() << "============= CKeyguardAccessApi::ConstructL";
-    RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
+    RDEBUG("0", 0);
     iLockAccessExtension = new (ELeave) RLockAccessExtension;
     }
 
@@ -79,7 +76,7 @@
 EXPORT_C TBool CKeyguardAccessApi::IsKeylockEnabled()
     {
 
-		qDebug() << "============= CKeyguardAccessApi::IsKeylockEnabled";
+		RDEBUG("0", 0);
     TInt value;
     TInt err = RProperty::Get(KPSUidAvkonDomain, KAknKeyguardStatus, value);
     if ( err == KErrNone )
@@ -105,9 +102,7 @@
 // ---------------------------------------------------------------------------
 EXPORT_C TBool CKeyguardAccessApi::IsKeyguardEnabled()
     {
-    qDebug() << "============= CKeyguardAccessApi::IsKeyguardEnabled";
-    RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
-
+    RDEBUG("0", 0);
     TInt value;
     TInt err = RProperty::Get(KPSUidAvkonDomain, KAknKeyguardStatus, value);
     if ( err == KErrNone )
@@ -148,16 +143,15 @@
 // ---------------------------------------------------------------------------
 EXPORT_C TInt CKeyguardAccessApi::DisableKeyguard( TBool aWithNote )
     {
-		qDebug() << "============= CKeyguardAccessApi::DisableKeyguard";
+		RDEBUG("aWithNote", aWithNote);
     if ( iLockAccessExtension )
         {
-        		qDebug() << "============= CKeyguardAccessApi::DisableKeyguard 1";
+        RDEBUG("0", 1);
         return iLockAccessExtension->SendMessage( ELockAppDisableKeyguard, aWithNote );
         }
     else
         {
-        			qDebug() << "============= CKeyguardAccessApi::DisableKeyguard 0";
-
+        RDEBUG("0", 0);
         return KErrNotFound;
         }
     }
@@ -167,6 +161,7 @@
 // ---------------------------------------------------------------------------
 EXPORT_C TInt CKeyguardAccessApi::OfferKeyguard()
     {
+   	RDEBUG("0", 0);
     if ( iLockAccessExtension )
         {
         return iLockAccessExtension->SendMessage( ELockAppOfferKeyguard );
@@ -182,7 +177,7 @@
 // ---------------------------------------------------------------------------
 EXPORT_C TInt CKeyguardAccessApi::ShowKeysLockedNote()
     {
-    qDebug() << "============= CKeyguardAccessApi::ShowKeysLockedNote";
+    RDEBUG("0", 0);
     if ( iLockAccessExtension )
         {
         return iLockAccessExtension->SendMessage( ELockAppShowKeysLockedNote );
--- a/securitydialogs/lockclient/src/lockaccessextension.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/lockclient/src/lockaccessextension.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -15,24 +15,21 @@
  *
 */
 
-
 #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>
 
 #include <xqservicerequest.h>
 #include <xqserviceutil.h>
 #include <xqrequestinfo.h>
-#include <QDebug>
 #include <xqaiwrequest.h>
 #include <xqappmgr.h>
 
-// Constants
-const TInt KTimesToConnectServer( 2);
-const TInt KTimeoutBeforeRetrying( 50000);
-
 // ---------------------------------------------------------------------------
 // Gets server version, needed for connection
 // ---------------------------------------------------------------------------
@@ -71,8 +68,7 @@
 		ret = KErrNotReady;
 		}
 	*/
-	qDebug() << "============= RLockAccessExtension::TryConnect";
-	qDebug() << ret;
+	RDEBUG("ret", ret);
 	return ret;
 	}
 
@@ -82,9 +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 methd. Now we use QtHighway
+	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 )
 		{
@@ -104,8 +161,7 @@
 		ret = KErrNotSupported;
 		}
 	*/
-	qDebug() << "============= RLockAccessExtension::EnsureConnected";
-	qDebug() << ret;
+	RDEBUG("ret", ret);
 	return ret;
 	}
 
@@ -114,7 +170,8 @@
 // ---------------------------------------------------------------------------
 TInt RLockAccessExtension::SendMessage( TInt aMessage )
 	{
-	TInt ret = EnsureConnected( );
+	RDEBUG("0", 0);
+	TInt ret = KErrNone;
 	if ( ret == KErrNone )
 		{
 		// ret = SendReceive( aMessage );
@@ -128,7 +185,8 @@
 // ---------------------------------------------------------------------------
 TInt RLockAccessExtension::SendMessage( TInt aMessage, TInt aParam1 )
 	{
-	TInt ret = EnsureConnected( );
+	RDEBUG("0", 0);
+	TInt ret = KErrNone;
 	if ( ret == KErrNone )
 		{
 		// assign parameters to IPC argument
@@ -144,75 +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);
 		// this is the old methd. Now we use QtHighway
 		// ret = SendReceive( aMessage, args );
-    qDebug() << "============= RLockAccessExtension::SendMessage 123.2";
-    qDebug() << aMessage;
-    qDebug() << aParam1;
-    qDebug() << aParam2;
+    RDEBUG("aMessage", aMessage);
+    RDEBUG("aParam1", aParam1);
+    RDEBUG("aParam2", aParam2);
 
-		if(1==0)
-			{	// old method. Not used any more
+		
+			{	// old method. Not used any more. Kept as reference
+			/*
 	    XQServiceRequest* mServiceRequest;
-	    qDebug() << "============= RLockAccessExtension::SendMessage 2";
-	    mServiceRequest = new XQServiceRequest("com.nokia.services.AutolockSrv.AutolockSrv","service(QString,QString,QString)");// use   , false    to make async
-	    qDebug() << "============= RLockAccessExtension::SendMessage 2.1";
-	    qDebug() << 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);
-	    qDebug() << "============= RLockAccessExtension::SendMessage aParam1";
+      RDEBUG("aParam1", 0);
 	    label = "" + QString("%1").arg(aParam1);
 	    *mServiceRequest << QString(label);
-	    qDebug() << "============= RLockAccessExtension::SendMessage aParam2";
+      RDEBUG("aParam2", 0);
 	    label = "" + QString("%1").arg(aParam2);
 	    *mServiceRequest << QString(label);
-	    qDebug() << "============= RLockAccessExtension::SendMessage 3";
 	    int returnvalue;
+      RDEBUG("send", 0);
 	    bool ret = mServiceRequest->send(returnvalue);
-	    qDebug() << "============= RLockAccessExtension::SendMessage ret=" << ret;
-	    qDebug() << "============= RLockAccessExtension::SendMessage returnvalue=" << returnvalue;
+      RDEBUG("ret", ret);
+      RDEBUG("returnvalue", returnvalue);
+      */
 			}
-		else
-			{
-	 		// TODO this always seems to fail because request is NULL
+
+			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;
-			request = mAppManager.create("com.nokia.services.AutolockSrv", "AutolockSrv", "service(QString,QString,QString)", false);
-			// also works with		create("AutolockSrv", "service(QString,QString,QString)", false);
+	    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)
-	    	qDebug() << "============= RLockAccessExtension::SendMessage got request";
+				{
+	    	RDEBUG("got request", 0);
+	    	}
 	    else
 	    	{
-	 	    qDebug() << "============= RLockAccessExtension::SendMessage not got request";
+	 	    RDEBUG("not got request", 0);
+	 	    RDebug::Printf( "%s %s (%u) not got request=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
+	 	    return KErrAbort;
 	 	  	}
 				
-	    qDebug() << "============= RLockAccessExtension::SendMessage 121.3";
-			QList<QVariant> args;
-			QString label ;
-			label = "" + QString("%1").arg(aMessage);
-	    args << QVariant(QString(label));
-	    qDebug() << "============= RLockAccessExtension::SendMessage 123.4";
-			label = "" + QString("%1").arg(aParam1);
-	    args << QVariant(QString(label));
-			label = "" + QString("%1").arg(aParam2);
-	    args << QVariant(QString(label));
-	    qDebug() << "============= RLockAccessExtension::SendMessage 123.4";
+			RDEBUG("setArguments", 0);
 			request->setArguments(args);
-	    qDebug() << "============= RLockAccessExtension::SendMessage 123.5";
-			bool ret = request->send();
-	    qDebug() << "============= RLockAccessExtension::SendMessage ret=" << ret;
+			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();
-	    qDebug() << "============= RLockAccessExtension::SendMessage error=" << error;
+			RDEBUG("error", error);
+	    ret = returnvalue;
 	
 	    delete request;
-			}
 		}
+  RDEBUG("ret", ret);
 	return ret;
 	}
 
--- a/securitydialogs/secuinotifications/secuinotificationdialogplugin/inc/secuinotificationcontentwidget.h	Thu Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/inc/secuinotificationcontentwidget.h	Thu Jul 22 16:43:28 2010 +0100
@@ -21,7 +21,12 @@
 #include <hbwidget.h>       // HbWidget
 #include <hblineedit.h>       // HbWidget
 
+#include <HbCheckBox>
+#include <HbListWidget>
+#include <HbListWidgetItem>
 class HbLabel;
+class HbCheckBox;
+class HbListWidget;
 
 
 class SecUiNotificationContentWidget : public HbWidget
@@ -50,6 +55,9 @@
 public:
 		HbLineEdit *codeTop;
 		HbLineEdit *codeBottom;
+        HbCheckBox *checkbox;
+        HbLabel *DialogText;
+        HbListWidget *listWidget;
     int queryType;
     int lMinLength;
     int lMaxLength;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/inc/secuinotificationdebug.h	Thu Jul 22 16:43:28 2010 +0100
@@ -0,0 +1,28 @@
+/*
+* 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 );
+#else
+#define RDEBUG( x, y )
+#endif
+
+#endif // SECUINOTIFICATIONDEBUG_H
--- a/securitydialogs/secuinotifications/secuinotificationdialogplugin/inc/secuinotificationdialog.h	Thu Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/inc/secuinotificationdialog.h	Thu Jul 22 16:43:28 2010 +0100
@@ -18,11 +18,22 @@
 #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>
+
+QTM_BEGIN_NAMESPACE
+    class QValueSpacePublisher;
+    class QValueSpaceSubscriber;
+QTM_END_NAMESPACE
+QTM_USE_NAMESPACE
 
 /**
  * SW Install notification widget class.
@@ -65,23 +76,30 @@
 		void handlebut2Changed();
 		void handlebut3Changed();
 
+public slots:    
+    void subscriberKSecurityUIsDismissDialogChanged();
 private:
     Q_DISABLE_COPY(SecUiNotificationDialog)
 
+    int mMyId;
     int mLastError;
     bool mShowEventReceived;
     QVariantMap mResultMap;
     HbLineEdit *codeTop;
     HbLineEdit *codeBottom;
+    HbCheckBox *checkBox;
+    HbListWidget *listWidget;
     HbAction *okAction;
     HbAction *cancelAction;
-    HbLabel *title;
+    HbAction *okVKBAction;
+    HbLabel *titleWidget;
     int queryType;
     int lMinLength;
     int lMaxLength;
     int queryDual;
     int lEmergencySupported;
     int isEmergency;
+    QValueSpaceSubscriber *subscriberKSecurityUIsDismissDialog;
 };
 
 #endif // SECUINOTIFICATIONDIALOG_H
--- a/securitydialogs/secuinotifications/secuinotificationdialogplugin/inc/secuinotificationdialogpluginkeys.h	Thu Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/inc/secuinotificationdialogpluginkeys.h	Thu Jul 22 16:43:28 2010 +0100
@@ -41,6 +41,8 @@
 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
--- a/securitydialogs/secuinotifications/secuinotificationdialogplugin/rom/secuinotificationdialogplugin.iby	Thu Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/rom/secuinotificationdialogplugin.iby	Thu Jul 22 16:43:28 2010 +0100
@@ -21,6 +21,7 @@
 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
--- a/securitydialogs/secuinotifications/secuinotificationdialogplugin/secuinotificationdialogplugin.pro	Thu Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/secuinotificationdialogplugin.pro	Thu Jul 22 16:43:28 2010 +0100
@@ -19,6 +19,8 @@
 CONFIG += plugin
 
 CONFIG += hb
+CONFIG += mobility
+MOBILITY = publishsubscribe
 
 # directories
 INCLUDEPATH += .
@@ -45,6 +47,9 @@
     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>" \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/secuinotificationdialogplugin.qcrml	Thu Jul 22 16:43:28 2010 +0100
@@ -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>
--- a/securitydialogs/secuinotifications/secuinotificationdialogplugin/src/secuinotificationcontentwidget.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/src/secuinotificationcontentwidget.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -16,6 +16,7 @@
 *
 */
 
+#include "secuinotificationdebug.h"
 #include "secuinotificationcontentwidget.h"
 #include "secuinotificationdialogpluginkeys.h"
 #include <QGraphicsLinearLayout>
@@ -28,6 +29,10 @@
 #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
@@ -60,7 +65,7 @@
 SecUiNotificationContentWidget::SecUiNotificationContentWidget(
         QGraphicsItem *parent, Qt::WindowFlags flags) : HbWidget(parent, flags)
 {
-		qDebug() << "SecUiNotificationContentWidget::SecUiNotificationContentWidget";
+		RDEBUG("0", 0);
 }
 
 // ----------------------------------------------------------------------------
@@ -77,7 +82,7 @@
 //
 void SecUiNotificationContentWidget::constructFromParameters(const QVariantMap &parameters)
 {
-		qDebug() << "SecUiNotificationContentWidget::constructFromParameters 1";
+		RDEBUG("0", 0);
 		qDebug() << parameters;
     QGraphicsLinearLayout *mainLayout = new QGraphicsLinearLayout(Qt::Vertical);
 
@@ -85,17 +90,17 @@
     lMaxLength = 8;	// might be replaced later
  		queryDual=0;
  		isEmergency=0;
+       codeTop=0;
 
     // KApplicationSize
     if (parameters.contains(KQueryType)) {
-				qDebug() << "SecUiNotificationContentWidget::KQueryType";
+				RDEBUG("0", 0);
         queryType = parameters.value(KQueryType).toUInt();
-				qDebug() << queryType;
+				RDEBUG("queryType", queryType);
 				if( (queryType & ESecUiTypeMaskLock) )
 					{
-					qDebug() << "SecUiNotificationContentWidget::KQueryType=ESecUiTypeLock";
+					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");
@@ -180,8 +185,6 @@
         qDebug() << lMaxLength;
         if(lMaxLength>2)
 	        codeTop->setMaxLength(lMaxLength);
-        // HbLineEdit *codeTop2 = new HbLineEdit;
-				qDebug() << "SecUiNotificationContentWidget::KCodeTop 2";
 				qDebug() << "SecUiNotificationContentWidget::KCodeTop queryType=";
 				qDebug() << queryType;
 				codeTop->setInputMethodHints(Qt::ImhDigitsOnly);	// default
@@ -209,7 +212,39 @@
 
         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)
+					qDebug() << "SecUiNotificationContentWidget::KDefaultCode";
+  	      QString defaultCode = parameters.value(KDefaultCode).toString();
+    	    qDebug() << defaultCode;
+					codeTop->setText(defaultCode);
+					}
+				qDebug() << "SecUiNotificationContentWidget::KCodeTop 4";
+
+		    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);
+		    				qDebug() << "SecUiNotificationDialog::titleAttempts=" << titleAttempts;
+		    				int nAttempts = titleAttempts.toInt();
+		    				RDEBUG("nAttempts", nAttempts);
+		    				titleText = titleText.left(titleText.indexOf('#'));
+		    				if(nAttempts>0)
+		    					titleText = titleText + " attempts=" + QString::number(nAttempts);
+		    				}
+		        HbLabel *titleTop = new HbLabel(titleText);
+		        mainLayout->addItem(titleTop);
+		        // in the dialog, it was setHeadingWidget(title);
+		    }
+
     		mainLayout->addItem(codeTop);
+    		// double-query
     		if (parameters.contains(KCodeBottom))
     			{
     			queryDual=1;
@@ -228,7 +263,7 @@
 	 		    if (queryType & ESecUiAlphaSupported)
 			    	{
 			    	qDebug() << "SecUiNotificationContentWidget::KCodeBottom setUpAsLatinAlphabetOnlyEditor";
-	 	    		codeTop->setInputMethodHints(Qt::ImhNone);
+	 	    		codeBottom->setInputMethodHints(Qt::ImhNone);
 			  		}
 					qDebug() << "SecUiNotificationContentWidget::KCodeBottom 3";
 	        connect(codeBottom, SIGNAL(textChanged(const QString &)), this, SIGNAL(codeBottomChanged(const QString &)));
@@ -251,10 +286,57 @@
 
         mainLayout->addItem(mainLayoutButtons);
         
-        codeTop->setFocus();
+        codeTop->setFocus();	// this should open the VKB
 
     }
 
+    if (parameters.contains(KChecboxType)) {
+    		qDebug() << "SecUiNotificationContentWidget::KChecboxType";
+        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)) {
+    				qDebug() << "SecUiNotificationContentWidget::KDefaultCode";
+            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());
+            }
+
+        }
+        mainLayout->addItem(checkbox);
+    }
+
+    if (parameters.contains(KMultiChecboxType) && parameters.contains(KDefaultCode)) 
+    	{
+ 				qDebug() << "SecUiNotificationContentWidget::KMultiChecboxType";
+        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);
+                    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);
     }
 
--- a/securitydialogs/secuinotifications/secuinotificationdialogplugin/src/secuinotificationdialog.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/src/secuinotificationdialog.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -15,6 +15,7 @@
 *
 */
 
+#include "secuinotificationdebug.h"
 #include "secuinotificationdialog.h"
 #include "secuinotificationdialogpluginkeys.h"
 #include "secuinotificationcontentwidget.h"
@@ -23,10 +24,21 @@
 #include <hbaction.h>
 #include <QDebug>
 #include <e32debug.h>
-#include <CPhCltEmergencyCall.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
+
+#include <qvaluespacesubscriber.h>
+#include <qvaluespacepublisher.h>
+#define ESecUiBasicTypeText    0x0000000
+#define ESecUiBasicTypeCheck   0x0010000
+#define ESecUiBasicTypeCheckMulti   0x0020000
+#define ESecUiBasicTypeMask    0x00F0000
 
 #define ESecUiCancelSupported  0x1000000
 #define ESecUiCancelNotSupported  0x0000000
@@ -50,6 +62,18 @@
 
 #define ESecUiTypeMaskLock			0x00F00000
 
+const TUid KPSUidSecurityUIs = { 0x100059b5 };
+const TUint32 KSecurityUIsDismissDialog  = 0x00000309;
+
+enum TSecurityUIsDismissDialogValues
+    {
+    ESecurityUIsDismissDialogUninitialized = 0,
+    ESecurityUIsDismissDialogOn,
+    ESecurityUIsDismissDialogProcessing,
+    ESecurityUIsDismissDialogDone,
+    ESecurityUIsDismissDialogLastValue
+    };
+
 // ----------------------------------------------------------------------------
 // SecUiNotificationDialog::SecUiNotificationDialog()
 // ----------------------------------------------------------------------------
@@ -57,7 +81,10 @@
 SecUiNotificationDialog::SecUiNotificationDialog(
         const QVariantMap &parameters) : HbDialog(), mLastError(KNoError)
 {
-		qDebug() << "SecUiNotificationDialog::SecUiNotificationDialog";
+		RDEBUG("0", 0);
+		TTime myTime;
+    myTime.HomeTime();
+		mMyId = I64LOW( myTime.Int64() );
     constructDialog(parameters);
 }
 
@@ -67,6 +94,7 @@
 //
 SecUiNotificationDialog::~SecUiNotificationDialog()
 {
+	RDEBUG("0", 0);
 }
 
 // ----------------------------------------------------------------------------
@@ -75,7 +103,7 @@
 //
 bool SecUiNotificationDialog::setDeviceDialogParameters(const QVariantMap &parameters)
 {
-		qDebug() << "SecUiNotificationDialog::setDeviceDialogParameters";
+	 RDEBUG("0", 0);
    return constructDialog(parameters);
 }
 
@@ -85,8 +113,8 @@
 //
 int SecUiNotificationDialog::deviceDialogError() const
 {
-		qDebug() << "SecUiNotificationDialog::deviceDialogError";
-		qDebug() << mLastError;
+		RDEBUG("mLastError", mLastError);
+		RDEBUG("mMyId", mMyId);
     return mLastError;
 }
 
@@ -97,14 +125,31 @@
 void SecUiNotificationDialog::closeDeviceDialog(bool byClient)
 {
     Q_UNUSED(byClient);
+		RDEBUG("mMyId", mMyId);
+		RDEBUG("calling close()", 0);
     close();
-		qDebug() << "SecUiNotificationDialog::closeDeviceDialog";
+		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);
 }
 
 // ----------------------------------------------------------------------------
@@ -122,9 +167,29 @@
 //
 void SecUiNotificationDialog::hideEvent(QHideEvent *event)
 {
-		qDebug() << "SecUiNotificationDialog::hideEvent";
+		RDEBUG("0", 0);
     HbDialog::hideEvent(event);
-    emit deviceDialogClosed();
+		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);
 }
 
 // ----------------------------------------------------------------------------
@@ -133,9 +198,46 @@
 //
 void SecUiNotificationDialog::showEvent(QShowEvent *event)
 {
-		qDebug() << "SecUiNotificationDialog::showEvent";
+		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);
+      			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 && mShowEventReceived==true)	// show happens 2 times. Dialog can be closed only the second.
+				{
+				QString myString = "";
+				myString += QString("%1").arg(value);
+				qDebug() << "SecUiNotificationDialog::faking myString=" << myString;
+		    codeTop->setText( myString );
+		    TInt err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsTestCode, 0 );	// clear after using it
+				qDebug() << "SecUiNotificationDialog::calling handleAccepted=" << myString;
+		    emit handleAccepted();
+				// handleAccepted already   emit closeDeviceDialog(false);	// false means "not by client", although it's not really used
+				}
+			}
     mShowEventReceived = true;
+    RDEBUG("1", 1);
 }
 
 // ----------------------------------------------------------------------------
@@ -144,12 +246,31 @@
 //
 bool SecUiNotificationDialog::constructDialog(const QVariantMap &parameters)
     {
-		qDebug() << "SecUiNotificationDialog::constructDialog";
+		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 = "";
@@ -162,22 +283,24 @@
     				titleAttempts = titleText.right(titleText.length()-titleText.indexOf('#')-1);
     				qDebug() << "SecUiNotificationDialog::titleAttempts=" << titleAttempts;
     				int nAttempts = titleAttempts.toInt();
-    				qDebug() << "SecUiNotificationDialog::nAttempts=" << nAttempts;
+    				RDEBUG("nAttempts", nAttempts);
     				titleText = titleText.left(titleText.indexOf('#'));
     				if(nAttempts>0)
     					titleText = titleText + " attempts=" + QString::number(nAttempts);
     				}
-        title = new HbLabel(titleText);
-        setHeadingWidget(title);
+    		titleText = "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)) {
-					qDebug() << "SecUiNotificationDialog::KEmergency";
+					RDEBUG("KEmergency", 1);
 	        QString emergencyText = parameters.value(KEmergency).toString();
 	        qDebug() << emergencyText;
 	        if(!emergencyText.compare("emergencyYes"))
 	        	{
-	        	qDebug() << "SecUiNotificationDialog::KEmergency emergencyYes";
+	        	RDEBUG("emergencyYes", 1);
 	        	isEmergency = 1;
 	        	okAction->setEnabled(true);
 	        	okAction->setText("Call");
@@ -185,121 +308,141 @@
 	        	}
 	        if(!emergencyText.compare("emergencyNo"))
 	        	{
-	        	qDebug() << "SecUiNotificationDialog::KEmergency emergencyNo";
+	        	RDEBUG("emergencyNo", 1);
 	        	isEmergency = 0;
 	        	okAction->setEnabled(false);	// 112 -> 1122 (=password) . This is handled by   < lMinLength 
 	        	okAction->setText("Ok");
     				return true;
 	        	}
 	    }
-	    
+	    // after TARM validation.
 	    if (parameters.contains(KInvalidNewLockCode)) {
-					qDebug() << "SecUiNotificationDialog::KInvalidNewLockCode";
+					RDEBUG("KInvalidNewLockCode", 0);
 	        QString invalidText = parameters.value(KInvalidNewLockCode).toString();
 	        qDebug() << invalidText;
+	        QString newTitleText = "Lock Code";	// TODO take from the original one
 
-	        title->setPlainText("Lock Code");	// TODO take from the original one
 	        QString invalidStr = invalidText.right(invalidText.length()-invalidText.indexOf('#')-1);
 	        int invalidNumber = invalidStr.toInt();
-	        qDebug() << "SecUiNotificationDialog::KInvalidNewLockCode invalidNumber" << invalidNumber;
+	        RDEBUG("invalidNumber", invalidNumber);
 	        if(invalidNumber<0)
 	        	{
-	        	qDebug() << "SecUiNotificationDialog::KInvalidNewLockCode ???";
+	        	RDEBUG("invalidNumber<0", invalidNumber );
 	        	// nothing to do
 	        	}
-/*
-	        if(invalidNumber==EDeviceLockAutolockperiod)
+				if(invalidNumber==EDeviceLockAutolockperiod)
 	        	{
-	        	qDebug() << "SecUiNotificationDialog::KInvalidNewLockCode EDeviceLockAutolockperiod";
-	        	title->setPlainText("EDeviceLockAutolockperiod");
+	        	RDEBUG("EDeviceLockAutolockperiod", invalidNumber );
+	        	newTitleText+="EDeviceLockAutolockperiod";
 	        	}
 	        if(invalidNumber==EDeviceLockMaxAutolockPeriod)
 	        	{
-	        	qDebug() << "SecUiNotificationDialog::KInvalidNewLockCode EDeviceLockMaxAutolockPeriod";
-	        	title->setPlainText("EDeviceLockMaxAutolockPeriod");
+	        	RDEBUG("EDeviceLockAutolockperiod", invalidNumber );
+	        	newTitleText+="EDeviceLockMaxAutolockPeriod";
 	        	}
 	        if(invalidNumber==EDeviceLockMinlength)
 	        	{
-	        	qDebug() << "SecUiNotificationDialog::KInvalidNewLockCode EDeviceLockMinlength";
-	        	title->setPlainText("EDeviceLockMinlength");
+	        	RDEBUG("EDeviceLockMinlength", invalidNumber );
+	        	newTitleText+="EDeviceLockMinlength";
 	        	}
 	        if(invalidNumber==EDeviceLockMaxlength)
 	        	{
-	        	qDebug() << "SecUiNotificationDialog::KInvalidNewLockCode EDeviceLockMaxlength";
-	        	title->setPlainText("EDeviceLockMaxlength");
+	        	RDEBUG("EDeviceLockMaxlength", invalidNumber );
+	        	newTitleText+="EDeviceLockMaxlength";
 	        	}
 	        if(invalidNumber==EDeviceLockRequireUpperAndLower)
 	        	{
-	        	qDebug() << "SecUiNotificationDialog::KInvalidNewLockCode EDeviceLockRequireUpperAndLower";
-	        	title->setPlainText("EDeviceLockRequireUpperAndLower");
+	        	RDEBUG("EDeviceLockRequireUpperAndLower", invalidNumber );
+	        	newTitleText+="EDeviceLockRequireUpperAndLower";
 	        	}
 	        if(invalidNumber==EDeviceLockRequireCharsAndNumbers)
 	        	{
-	        	qDebug() << "SecUiNotificationDialog::KInvalidNewLockCode EDeviceLockRequireCharsAndNumbers";
-	        	title->setPlainText("EDeviceLockMaxlength");
+	        	RDEBUG("EDeviceLockMaxlength", invalidNumber );
+	        	newTitleText+="EDeviceLockMaxlength";
 	        	}
 	        if(invalidNumber==EDeviceLockAllowedMaxRepeatedChars)
 	        	{
-	        	qDebug() << "SecUiNotificationDialog::KInvalidNewLockCode EDeviceLockAllowedMaxRepeatedChars";
-	        	title->setPlainText("EDeviceLockAllowedMaxRepeatedChars");
+	        	RDEBUG("EDeviceLockAllowedMaxRepeatedChars", invalidNumber );
+	        	newTitleText+="EDeviceLockAllowedMaxRepeatedChars";
 	        	}
 	        if(invalidNumber==EDeviceLockHistoryBuffer)
 	        	{
-	        	qDebug() << "SecUiNotificationDialog::KInvalidNewLockCode EDeviceLockHistoryBuffer";
-	        	title->setPlainText("EDeviceLockHistoryBuffer");
+	        	RDEBUG("EDeviceLockHistoryBuffer", invalidNumber );
+	        	newTitleText+="EDeviceLockHistoryBuffer";
 	        	}
 	        if(invalidNumber==EDeviceLockPasscodeExpiration)
 	        	{
-	        	qDebug() << "SecUiNotificationDialog::KInvalidNewLockCode EDeviceLockPasscodeExpiration";
-	        	title->setPlainText("EDeviceLockPasscodeExpiration");
+	        	RDEBUG("EDeviceLockPasscodeExpiration", invalidNumber );
+	        	newTitleText+="EDeviceLockPasscodeExpiration";
 	        	}
 	        if(invalidNumber==EDeviceLockMinChangeTolerance)
 	        	{
-	        	qDebug() << "SecUiNotificationDialog::KInvalidNewLockCode EDeviceLockMinChangeTolerance";
-	        	title->setPlainText("EDeviceLockMinChangeTolerance");
+	        	RDEBUG("EDeviceLockMinChangeTolerance", invalidNumber );
+	        	newTitleText+="EDeviceLockMinChangeTolerance";
 	        	}
 	        if(invalidNumber==EDeviceLockMinChangeInterval)
 	        	{
-	        	qDebug() << "SecUiNotificationDialog::KInvalidNewLockCode EDeviceLockMinChangeInterval";
-	        	title->setPlainText("EDeviceLockMinChangeInterval");
+	        	RDEBUG("EDeviceLockMinChangeInterval", invalidNumber );
+	        	newTitleText+="EDeviceLockMinChangeInterval";
 	        	}
 	        if(invalidNumber==EDeviceLockDisallowSpecificStrings)
 	        	{
-	        	qDebug() << "SecUiNotificationDialog::KInvalidNewLockCode EDeviceLockDisallowSpecificStrings";
-	        	title->setPlainText("EDeviceLockDisallowSpecificStrings");
+	        	RDEBUG("EDeviceLockDisallowSpecificStrings", invalidNumber );
+	        	newTitleText+="EDeviceLockDisallowSpecificStrings";
 	        	}
 	        if(invalidNumber==EDeviceLockAllowedMaxAtempts)
 	        	{
-	        	qDebug() << "SecUiNotificationDialog::KInvalidNewLockCode EDeviceLockAllowedMaxAtempts";
-	        	title->setPlainText("EDeviceLockAllowedMaxAtempts");
+	        	RDEBUG("EDeviceLockAllowedMaxAtempts", invalidNumber );
+	        	newTitleText+="EDeviceLockAllowedMaxAtempts";
 	        	}
 	        if(invalidNumber==EDeviceLockConsecutiveNumbers)
 	        	{
-	        	qDebug() << "SecUiNotificationDialog::KInvalidNewLockCode EDeviceLockConsecutiveNumbers";
-	        	title->setPlainText("EDeviceLockConsecutiveNumbers");
+	        	RDEBUG("EDeviceLockConsecutiveNumbers", invalidNumber );
+	        	newTitleText+="EDeviceLockConsecutiveNumbers";
 	        	}
 	        if(invalidNumber==EDeviceLockMinSpecialCharacters)
 	        	{
-	        	qDebug() << "SecUiNotificationDialog::KInvalidNewLockCode EDeviceLockMinSpecialCharacters";
-	        	title->setPlainText("EDeviceLockMinSpecialCharacters");
+	        	RDEBUG("EDeviceLockMinSpecialCharacters", invalidNumber );
+	        	newTitleText+="EDeviceLockMinSpecialCharacters";
 	        	}
 	        if(invalidNumber==EDeviceLockSingleCharRepeatNotAllowed)
 	        	{
-	        	qDebug() << "SecUiNotificationDialog::KInvalidNewLockCode EDeviceLockSingleCharRepeatNotAllowed";
-	        	title->setPlainText("EDeviceLockSingleCharRepeatNotAllowed");
+	        	RDEBUG("EDeviceLockSingleCharRepeatNotAllowed", invalidNumber );
+	        	newTitleText+="EDeviceLockSingleCharRepeatNotAllowed";
 	        	}
 	        if(invalidNumber==EDevicelockConsecutiveCharsNotAllowed)
 	        	{
-	        	qDebug() << "SecUiNotificationDialog::KInvalidNewLockCode EDevicelockConsecutiveCharsNotAllowed";
-	        	title->setPlainText("EDevicelockConsecutiveCharsNotAllowed");
+	        	RDEBUG("EDevicelockConsecutiveCharsNotAllowed", invalidNumber );
+	        	newTitleText+="EDevicelockConsecutiveCharsNotAllowed";
 	        	}
 	        if(invalidNumber>=EDevicelockTotalPolicies)
 	        	{
-	        	qDebug() << "SecUiNotificationDialog::KInvalidNewLockCode EDevicelockTotalPolicies";
-	        	title->setPlainText("EDevicelockTotalPolicies");
+	        	RDEBUG("EDevicelockTotalPolicies", invalidNumber );
+	        	newTitleText+="EDevicelockTotalPolicies";
 	        	}
-	        	*/
-	        // always keep OK valid.
+	        if( !titleWidget )
+	        	{
+	        	RDEBUG("creating titleWidget", 0 );
+	        	titleWidget = new HbLabel("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("Ok");
+	        	codeBottom->setEnabled(true);
+	        	}
+	        else
+	        	{
+	        	okAction->setEnabled(false);
+	        	codeBottom->setEnabled(false);
+	        	codeBottom->setText("");
+	        	okAction->setText("Ok");
+	        	}
+	        // need to return because all objects are already created
    				return true;
 	    }
 	
@@ -311,7 +454,10 @@
 		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;
@@ -323,8 +469,7 @@
     connect(content, SIGNAL(but1Changed()), this, SLOT(handlebut1Changed()));
     connect(content, SIGNAL(but2Changed()), this, SLOT(handlebut2Changed()));
     connect(content, SIGNAL(but3Changed()), this, SLOT(handlebut3Changed()));
-		qDebug() << "SecUiNotificationDialog::queryType=";
-		qDebug() << queryType;
+		RDEBUG("queryType", queryType);
     // Buttons
     if( (queryType & ESecUiTypeMaskLock))
     	{
@@ -333,25 +478,54 @@
     	}
 
     okAction = new HbAction(tr("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);
+    // 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(tr("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);
+    // setSecondaryAction(cancelAction);
 
-		qDebug() << "SecUiNotificationDialog check Cancel";
+		// 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
   		{
-				qDebug() << "disable Cancel";
+				RDEBUG("disable Cancel", 1);
   			cancelAction->setEnabled(false);
+  			cancelAction->setText("");
+  			cancelAction->setVisible(false);
   		}
     
     return true;
@@ -363,14 +537,20 @@
 //
 void SecUiNotificationDialog::sendResult(int accepted)
 {
-		qDebug() << "SecUiNotificationDialog::sendResult 1.2";
+		RDEBUG("0", 0);
+		RDEBUG("mMyId", mMyId);
     QVariant acceptedValue(accepted);
-		qDebug() << "SecUiNotificationDialog::sendResult 2";
+		RDEBUG("0", 0);
     mResultMap.insert(KResultAccepted, acceptedValue);
-		qDebug() << "SecUiNotificationDialog::sendResult 3";
+		RDEBUG("0", 0);
 		qDebug() << mResultMap;
-    emit deviceDialogData(mResultMap);
-		qDebug() << "SecUiNotificationDialog::sendResult end";
+		RDEBUG("queryType", queryType);
+		if(!(queryType & ESecUiTypeMaskLock))
+			{	// the lock-icon should not reply
+			RDEBUG("emit deviceDialogData", 0);
+    	emit deviceDialogData(mResultMap);
+    	}
+		RDEBUG("1", 1);
 }
 
 // ----------------------------------------------------------------------------
@@ -379,21 +559,42 @@
 //
 void SecUiNotificationDialog::handleAccepted()
 {
-		qDebug() << "SecUiNotificationDialog::handleAccepted";
+		RDEBUG("0", 0);
 		// okAction
-		QString codeTopText;
+		RDEBUG("mMyId", mMyId);
+		QString codeTopText="";
 
 		if( (queryType & ESecUiTypeMaskLock))
     	{
     	codeTopText = "Unlock-Request";
     	}
-    else
+    else if( (queryType & ESecUiBasicTypeMask)==ESecUiBasicTypeCheck)
+    	{
+        codeTopText=(checkBox->isChecked() ?  "1":"0");
+        mResultMap.insert(KCodeTopIndex,  codeTopText);
+    	}
+    else if( (queryType & ESecUiBasicTypeMask)==ESecUiBasicTypeCheckMulti)
     	{
-    	codeTopText = codeTop->text();
+        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);
     	}
-    // TODO check last time for codeBottom
+    else
+        codeTopText = codeTop->text();
+    // no need to check last time for codeBottom
    	qDebug() << "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();
 }
 
 // ----------------------------------------------------------------------------
@@ -402,8 +603,13 @@
 //
 void SecUiNotificationDialog::handleCancelled()
 {
-		qDebug() << "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();
 }
 
 // ----------------------------------------------------------------------------
@@ -412,17 +618,17 @@
 //
 void SecUiNotificationDialog::handleMemorySelectionChanged(const QString &text)
     {
-    	qDebug() << "SecUiNotificationDialog::handleMemorySelectionChanged";
-    	qDebug() << text;
+		RDEBUG("0", 0);
+		RDEBUG("mMyId", mMyId);
+    qDebug() << text;
     QVariant memorySelection(text);
     mResultMap.insert(KSelectedMemoryIndex, memorySelection);
-    //TODO: do we need emit here, or would it be better to send all data at the end?
-    //emit deviceDialogData(mResultMap);
     }
 
 void SecUiNotificationDialog::handleCodeTopContentChanged()
     {
-    	qDebug() << "SecUiNotificationDialog::handleCodeTopContentChanged";
+		RDEBUG("0", 0);
+		RDEBUG("mMyId", mMyId);
     	qDebug() << codeTop->text();
     	handleCodeTopChanged(codeTop->text());
     }
@@ -433,40 +639,40 @@
 //
 void SecUiNotificationDialog::handleCodeTopChanged(const QString &text)
     {
-    	qDebug() << "SecUiNotificationDialog::handleCodeTopChanged";
+		RDEBUG("0", 0);
     	qDebug() << "SecUiNotificationDialog::handleCodeTopChanged=" << text ;
     	if(queryDual)
     		{
     		codeBottom->setText("");	// any change resets the verification.
     		}
-    	if( queryType == 0x1000004 )
+    	if( queryType == 0x1000004 )	// new codeLock
     		{	// ChangeSecCodeParamsL change RMobilePhone::ESecurityCodePhonePassword
-			    QVariant codeTop(text);
-			    mResultMap.insert(KCodeTopIndex, codeTop);
-					sendResult(KErrCompletion);	// send the current password back to the client for further TARM validation
+			    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
     		}
     	if(text.length() < lMinLength )
     		{
     		qDebug() << "SecUiNotificationDialog::handleCodeTopChanged too short:" << 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 codeTop(text);
-  				mResultMap.insert(KCodeTopIndex, codeTop);
+					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)
     		{
-    		// TODO might use a flag to avoid re-setting
+    		// might use a flag to avoid re-setting. But this complicates things if there's another initial verification
     		qDebug() << "SecUiNotificationDialog::handleCodeTopChanged long enough:" << text ;
     		okAction->setText("Ok");
     		if(queryDual==0)	// only if Bottom is not used
     			okAction->setEnabled(true);
     		}
-    QVariant codeTop(text);
-    mResultMap.insert(KCodeTopIndex, codeTop);
+    QVariant codeTopVar(text);
+    mResultMap.insert(KCodeTopIndex, codeTopVar);
     }
 // ----------------------------------------------------------------------------
 // SecUiNotificationDialog::handleCodeBottomChanged()
@@ -474,10 +680,9 @@
 //
 void SecUiNotificationDialog::handleCodeBottomChanged(const QString &text)
     {
-    	qDebug() << "SecUiNotificationDialog::handleCodeBottomChanged";
+		RDEBUG("0", 0);
     	qDebug() << "SecUiNotificationDialog::handleCodeBottomChanged" << text ;
     	qDebug() << "SecUiNotificationDialog::handleCodeBottomChanged. codeTop=" << codeTop->text() ;
-    	// TODO compare 
     	if(text.length() < lMinLength )
     		{
     		qDebug() << "SecUiNotificationDialog::handleCodeBottomChanged too short:" << text ;
@@ -485,10 +690,11 @@
     		}
     	else
     		{
-    		// TODO might use a flag to avoid re-setting
+    		// might use a flag to avoid re-setting. But it just complicates things.
     		qDebug() << "SecUiNotificationDialog::handleCodeBottomChanged long enough:" << 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
     			qDebug() << "SecUiNotificationDialog::handleCodeBottomChanged codes match:" << text ;
 	    		okAction->setEnabled(true);
 	    		}
@@ -506,8 +712,8 @@
 //
 void SecUiNotificationDialog::handlebut1Changed()
     {
-    	qDebug() << "SecUiNotificationDialog::handlebut1Changed";
-    	codeTop->setText("1234");
+		RDEBUG("0", 0);
+    codeTop->setText("1234");
     }
 // ----------------------------------------------------------------------------
 // SecUiNotificationDialog::handlebut2Changed()
@@ -515,7 +721,7 @@
 //
 void SecUiNotificationDialog::handlebut2Changed()
     {
-    	qDebug() << "SecUiNotificationDialog::handlebut2Changed";
+		RDEBUG("0", 0);
     	QString codeTopText = codeTop->text();
     	qDebug() << "codeTopText";
     	qDebug() << codeTopText;
@@ -523,6 +729,40 @@
     	qDebug() << "codeTopText+1";
     	qDebug() << 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()
@@ -547,5 +787,77 @@
 //
 void SecUiNotificationDialog::saveFocusWidget(QWidget*,QWidget*)
 {
-		qDebug() << "SecUiNotificationDialog::saveFocusWidget";
+		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);
+	}
--- a/securitydialogs/secuinotifications/secuinotificationdialogplugin/src/secuinotificationdialogplugin.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/src/secuinotificationdialogplugin.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -15,10 +15,13 @@
 *
 */
 
+#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;
@@ -50,12 +53,13 @@
 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.
-    // TODO: should access be limited to certain clients?
+    // should access be limited to certain clients or capabilities ? Not for now.
     return true;
 }
 
@@ -67,6 +71,7 @@
     const QString &deviceDialogType, const QVariantMap &parameters)
 {
     //  Create device dialog widget
+    RDEBUG("0", 0);
     Q_UNUSED(deviceDialogType)
 
     SecUiNotificationDialog *deviceDialog = new SecUiNotificationDialog(parameters);
@@ -86,15 +91,39 @@
 bool SecUiNotificationDialogPlugin::deviceDialogInfo( const QString &deviceDialogType,
         const QVariantMap &parameters, DeviceDialogInfo *info) const
 {
-    // Return device dialog flags
+		// 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);
-    Q_UNUSED(parameters);
 
-    //info->group = DeviceNotificationDialogGroup;	// TODO this should be SecurityGroup , but it's still not available, Commented out by 10.1 Integration
-	info->group = SecurityGroup;	// Added by 10.1 Integration... It's working better with this layer.
+		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;
+					}
+				}
+    // Return device dialog flags
+
     return true;
 }
 
@@ -104,6 +133,7 @@
 //
 QStringList SecUiNotificationDialogPlugin::deviceDialogTypes() const
 {
+		RDEBUG("0", 0);
     // Return device dialog types this plugin implements
 
     QStringList types;
@@ -121,6 +151,7 @@
 //
 HbDeviceDialogPlugin::PluginFlags SecUiNotificationDialogPlugin::pluginFlags() const
 {
+		RDEBUG("0", 0);
     // Return plugin flags
     return NoPluginFlags;
 }
@@ -131,6 +162,7 @@
 //
 int SecUiNotificationDialogPlugin::error() const
 {
+		RDEBUG("mError", mError);
     // Return last error
     return mError;
 }
--- a/securitydialogs/securitydialogs.pro	Thu Jun 17 12:11:51 2010 +0100
+++ b/securitydialogs/securitydialogs.pro	Thu Jul 22 16:43:28 2010 +0100
@@ -18,7 +18,7 @@
 
 SUBDIRS += secuinotifications/secuinotifications.pro
 SUBDIRS += lockclient/group/lockclient.pro
-SUBDIRS += AutolockSrv/indicatorplugin/indicatorautolockplugin.pro
-SUBDIRS += AutolockSrv/autolockuseractivityservice.pro
-SUBDIRS += AutolockSrv/AutolockSrv.pro
+SUBDIRS += Autolock/indicatorplugin/indicatorautolockplugin.pro
+SUBDIRS += Autolock/autolockuseractivityservice.pro
+SUBDIRS += Autolock/Autolock.pro
 
--- a/securitysrv.pro	Thu Jun 17 12:11:51 2010 +0100
+++ b/securitysrv.pro	Thu Jul 22 16:43:28 2010 +0100
@@ -18,3 +18,5 @@
 
 SUBDIRS += securitydialogs/securitydialogs.pro
 SUBDIRS += cpsecplugins/cpsecplugins.pro
+SUBDIRS += pkiutilities/pkiutilities.pro
+
--- a/securitysrv_info/securitysrv_metadata/securitysrv_metadata.mrp	Thu Jun 17 12:11:51 2010 +0100
+++ b/securitysrv_info/securitysrv_metadata/securitysrv_metadata.mrp	Thu Jul 22 16:43:28 2010 +0100
@@ -1,19 +1,3 @@
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description: 
-#
-
 component           securitysrv_metadata
 source   \sf\mw\securitysrv\securitysrv_info\securitysrv_metadata 
 source   \sf\mw\securitysrv\package_definition.xml
--- a/wim/WimServer/src/WimSatRefreshObserver.cpp	Thu Jun 17 12:11:51 2010 +0100
+++ b/wim/WimServer/src/WimSatRefreshObserver.cpp	Thu Jul 22 16:43:28 2010 +0100
@@ -23,8 +23,8 @@
 #include "WimServer.h"
 #include "WimSession.h"
 #include "WimTrace.h"
-#include <RSatRefresh.h>
-#include <RSatSession.h>
+#include <rsatrefresh.h>
+#include <rsatsession.h>
 #include <etelsat.h>
 #if defined SAT_REFRESH_TIMER_TRIGGER
 #include "SatRefreshTimerTrigger.h" // for simulated sat refresh