diff -r a36219ae6585 -r 2e64dc50f295 policymanagement/policyengine/policyengineui/inc/PolicyEngineUi.h --- a/policymanagement/policyengine/policyengineui/inc/PolicyEngineUi.h Tue Jul 13 09:37:43 2010 +0530 +++ b/policymanagement/policyengine/policyengineui/inc/PolicyEngineUi.h Tue Jul 13 09:51:41 2010 +0530 @@ -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,153 +13,55 @@ * * Description: Implementation of policymanagement components * -* */ - -#ifndef POLICTY_ENGINE_UI_HEADER_ -#define POLICTY_ENGINE_UI_HEADER_ - -// INCLUDES -#include -#include - -// CONSTANTS +#ifndef POLICYENGINEUI_H +#define POLICYENGINEUI_H -_LIT8( KUserAcceptMark, "A"); -_LIT8( KUserDenyMark, "D"); -const TUint KDelimeterChar = '|'; +#include +#include -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 ¶meters); + 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(); - 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 ¶meters); + 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