diff -r b183ec05bd8c -r 19bba8228ff0 policymanagement/policyengine/policyengineui/inc/PolicyEngineUi.h --- a/policymanagement/policyengine/policyengineui/inc/PolicyEngineUi.h Tue Aug 31 16:04:06 2010 +0300 +++ b/policymanagement/policyengine/policyengineui/inc/PolicyEngineUi.h Wed Sep 01 12:27:42 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2002-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" @@ -13,55 +13,154 @@ * * Description: Implementation of policymanagement components * +* */ -#ifndef POLICYENGINEUI_H -#define POLICYENGINEUI_H + +#ifndef POLICTY_ENGINE_UI_HEADER_ +#define POLICTY_ENGINE_UI_HEADER_ + +// INCLUDES +#include +#include + +// CONSTANTS -#include -#include +_LIT8( KUserAcceptMark, "A"); +_LIT8( KUserDenyMark, "D"); +const TUint KDelimeterChar = '|'; -class HbDialog; -class HbLineEdit; +enum TUserResponse + { + EUserAccept, + EUserDeny, + }; + +// FORWARD DECLARATIONS + +class CCoeEnv; +class CPolicyEngineUi; + -class PolicyEngineUI : public HbDialog, public HbDeviceDialogInterface - { -Q_OBJECT +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; + }; -public: - PolicyEngineUI(const QVariantMap& parameters); - ~PolicyEngineUI(); - void DisplayNotificationDialog(const QVariantMap ¶meters); - void ShowInputDialog(); - bool verifyFingerPrint(); + + +/** +* 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 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; + /** + * 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: -signals: - //signal to be sent to client - void deviceDialogClosed(); - void deviceDialogData(QVariantMap data); + /** + * 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(); + + + TInt ShowDialogL( const TDialog& aDialog); + TDlgResp ShowConfirmationQueryL( const TDesC& aText, const TBool& aWithCancel ); + TDlgResp ShowPossessionMessageQueryL(); + TDlgResp DataQueryL( const TDesC& aText, TDes& aInput ); + + private: // Data -private: - // number of tries user does - int estbTrustCount; - QString iServerName; - QString iFingerprint; - QString iCode; - HbLineEdit *mContentEdit; - HbDialog* mdialog; - }; + HBufC * iCorporate; + HBufC * iRandomPart; + TInt iState; + CPolicyEngineNotifier * iNotifier; + + TInt iResourceFileOffset; + CCoeEnv* iCoeEnv; // not owned + }; -#endif // POLICYENGINEUI_H + +#endif // POLICTY_ENGINE_UI_HEADER_ + +// End of File