policymanagement/policyengine/policyengineui/inc/PolicyEngineUi.h
branchRCL_3
changeset 61 b183ec05bd8c
parent 58 4af31167ea77
child 62 19bba8228ff0
--- a/policymanagement/policyengine/policyengineui/inc/PolicyEngineUi.h	Thu Aug 19 10:44:50 2010 +0300
+++ b/policymanagement/policyengine/policyengineui/inc/PolicyEngineUi.h	Tue Aug 31 16:04:06 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
+* 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"
@@ -13,154 +13,55 @@
 *
 * Description: Implementation of policymanagement components
 *
-*
 */
 
-
-#ifndef POLICTY_ENGINE_UI_HEADER_
-#define POLICTY_ENGINE_UI_HEADER_
-
-//  INCLUDES
-#include <e32base.h>
-#include <eiknotapi.h>
-
-//  CONSTANTS
+#ifndef POLICYENGINEUI_H
+#define POLICYENGINEUI_H
 
-_LIT8( KUserAcceptMark, "A");
-_LIT8( KUserDenyMark, "D");
-const TUint KDelimeterChar = '|';
+#include <hbdialog.h>
+#include <hbdevicedialoginterface.h>
 
-enum TUserResponse
-	{
-	EUserAccept,
-	EUserDeny,
-	};
-
-//  FORWARD DECLARATIONS
-
-class CCoeEnv;
-class CPolicyEngineUi;
-
+class HbDialog;
+class HbLineEdit;
 
-class CPolicyEngineNotifier : public CBase, public MEikSrvNotifierBase2
-	{
-	public:
-	
-		CPolicyEngineNotifier();
-		~CPolicyEngineNotifier();
-		static CPolicyEngineNotifier* NewL();
-		void ConstructL();
-		
-		void Complete( TUserResponse aResponse);
-		
-    public: //From MEikSrvNotifierBase2
-    
-		void Release();
-		TNotifierInfo RegisterL();
-		TNotifierInfo Info() const;
-		TPtrC8 StartL(const TDesC8& aBuffer);
-		void StartL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage);
-		void Cancel();
-		TPtrC8 UpdateL(const TDesC8& aBuffer); 
-		  
-	private:
-		CPolicyEngineUi * iPolicyEngineUi;
-		
-        /**
-        * refers connections is intialized or not
-        */
-        TNotifierInfo         iInfo;             ///< Notifier info
-        
-        TInt iReplySlot;
-        RMessagePtr2 iMessage;
-	};
+class PolicyEngineUI : public HbDialog, public HbDeviceDialogInterface
+    {
+Q_OBJECT
 
-
-
-/**
-* This class provides a wrapper for some common dialogs for the policy engine
-*
-* @lib policyengineui.lib
-*/
-class CPolicyEngineUi : public CActive
-    {
-    public:  // Constructors and destructor
+public:
+    PolicyEngineUI(const QVariantMap& parameters);
+    ~PolicyEngineUI();
+    void DisplayNotificationDialog(const QVariantMap &parameters);
+    void ShowInputDialog();
+    bool verifyFingerPrint();
 
-        /**
-        * Constructor.
-        */
-        CPolicyEngineUi();
-
-        /**
-        * Two-phased constructor.
-        */
-        static CPolicyEngineUi* NewL();
-    
-        /**
-        * Destructor.
-        */
-        virtual ~CPolicyEngineUi();
-        
-        void ActivateL( const TDesC8& aCorporate, const TDesC8& aRandomPart, CPolicyEngineNotifier* iNotifier); 
-    
-		void RunL();
-		TInt RunError(TInt aError);
-		void DoCancel();
-
-	public:
+public slots:
+    void onOKSelected();
+    void onCancelSelected();
+    void establishTrust();
+    void cancelTrust();
+    void onTrustCreation();
+    void codeTextChanged();
+public:
+    //derived from HbDeviceDialogInterface
+    bool setDeviceDialogParameters(const QVariantMap &parameters);
+    int deviceDialogError() const;
+    void closeDeviceDialog(bool byClient);
+    HbDialog *deviceDialogWidget() const;
 
-        /**
-        * Execute corporate policy question chain, which user deny or accept. One response generated.
-        * @param aCorporate - Corparate name used in queries
-        * @param aRandomPart - Random part of certificate, which user must know.
-        * @return TUserResponse - Response value for user
-        */
-        
-        TUserResponse ShowCorporateConfirmationDialogL( const TDesC8& aCorporate,
-        										   		 const TDesC8& aRandomPart);
-	private:
-	
-		//private enums
-		enum TDialog
-			{
-			EControl = 0, 
-			EQuestion,
-			ERemove,
-			EDenied,
-			EUnMatch
-			};
-		
-		enum TDlgResp
-			{
-			EOkResp,
-			ECancelResp
-			};
-		
-	private:
-	
-        /**
-        * Two-phased constructor.
-        */
-		void ConstructL();
+signals:
+    //signal to be sent to client
+    void deviceDialogClosed();
+    void deviceDialogData(QVariantMap data);
+    
+private:
+    // number of tries user does
+    int estbTrustCount;
+    QString iServerName;
+    QString iFingerprint;
+    QString iCode;
+    HbLineEdit *mContentEdit;
+    HbDialog* mdialog;
+    };
 
-	
-		TInt ShowDialogL( const TDialog& aDialog);
-		TDlgResp ShowConfirmationQueryL( const TDesC& aText, const TBool& aWithCancel );
-		TDlgResp ShowPossessionMessageQueryL();
-		TDlgResp DataQueryL( const TDesC& aText, TDes& aInput );
-
-    private: // Data
-    
-    	HBufC * iCorporate;
-    	HBufC * iRandomPart;
-    	TInt iState;
-    	CPolicyEngineNotifier * iNotifier;
-    	
-	    TInt iResourceFileOffset;
-        CCoeEnv* iCoeEnv;  // not owned
-        };
-
-
-#endif      // POLICTY_ENGINE_UI_HEADER_
-            
-// End of File
+#endif // POLICYENGINEUI_H