diff -r 6b63ca65093a -r aad866c37519 pkiutilities/untrustedcertificatedialog/inc/untrustedcertificatedialog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pkiutilities/untrustedcertificatedialog/inc/untrustedcertificatedialog.h Fri Jun 11 14:28:40 2010 +0300 @@ -0,0 +1,78 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Device dialog plugin that shows untrusted certificate +* dialog for TLS server authentication failure errors. +* +*/ + +#ifndef UNTRUSTEDCERTIFICATEDIALOG_H +#define UNTRUSTEDCERTIFICATEDIALOG_H + +#include +#include + +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 ¶meters); + virtual ~UntrustedCertificateDialog(); + +public: // from HbDeviceDialogInterface + bool setDeviceDialogParameters(const QVariantMap ¶meters); + 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 ¶meters); + bool constructDialog(const QVariantMap ¶meters); + bool updateFromParameters(const QVariantMap ¶meters); + void sendResult(int result); + +private slots: // new slots + void handleAccepted(); + void handleRejected(); + +private: // new functions + Q_DISABLE_COPY(UntrustedCertificateDialog) + +private: // data + int mLastError; + bool mShowEventReceived; + UntrustedCertificateWidget *mContent; + QVariantMap mResultMap; +}; + +#endif // UNTRUSTEDCERTIFICATEDIALOG_H +