pkiutilities/untrustedcertificatedialog/inc/untrustedcertificatedialog.h
branchRCL_3
changeset 22 03674e5abf46
parent 21 09b1ac925e3f
child 23 94da73d93b58
equal deleted inserted replaced
21:09b1ac925e3f 22:03674e5abf46
     1 /*
       
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Device dialog plugin that shows untrusted certificate
       
    15 *               dialog for TLS server authentication failure errors.
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef UNTRUSTEDCERTIFICATEDIALOG_H
       
    20 #define UNTRUSTEDCERTIFICATEDIALOG_H
       
    21 
       
    22 #include <hbdialog.h>
       
    23 #include <hbdevicedialoginterface.h>
       
    24 
       
    25 class UntrustedCertificateWidget;
       
    26 
       
    27 
       
    28 /**
       
    29  * Untrusted certificate dialog.
       
    30  * This dialog is displayed when a secure socket (CSecureSocket) is opened
       
    31  * using EDialogModeAttended mode, and the server sends untrusted certificate.
       
    32  * Untrusted certificate dialog shows the certificate details and prompts if
       
    33  * the secure connection is allowed to proceed.
       
    34  */
       
    35 class UntrustedCertificateDialog : public HbDialog, public HbDeviceDialogInterface
       
    36 {
       
    37     Q_OBJECT
       
    38 
       
    39 public:     // constructor and destructor
       
    40     UntrustedCertificateDialog(const QVariantMap &parameters);
       
    41     virtual ~UntrustedCertificateDialog();
       
    42 
       
    43 public:     // from HbDeviceDialogInterface
       
    44     bool setDeviceDialogParameters(const QVariantMap &parameters);
       
    45     int deviceDialogError() const;
       
    46     void closeDeviceDialog(bool byClient);
       
    47     HbDialog *deviceDialogWidget() const;
       
    48 
       
    49 signals:    // required by device dialog framework
       
    50     void deviceDialogClosed();
       
    51     void deviceDialogData(const QVariantMap &data);
       
    52 
       
    53 protected:  // from HbPopup (via HbDialog)
       
    54     void hideEvent(QHideEvent *event);
       
    55     void showEvent(QShowEvent *event);
       
    56 
       
    57 private:    // new functions
       
    58     bool isParametersValid(const QVariantMap &parameters);
       
    59     bool constructDialog(const QVariantMap &parameters);
       
    60     bool updateFromParameters(const QVariantMap &parameters);
       
    61     void sendResult(int result);
       
    62     void confirmPermanentAccept();
       
    63 
       
    64 private slots:  // new slots
       
    65     void handleAccepted();
       
    66     void handleRejected();
       
    67     void handlePermanentAcceptance();
       
    68 
       
    69 private:    // new functions
       
    70     Q_DISABLE_COPY(UntrustedCertificateDialog)
       
    71 
       
    72 private:    // data
       
    73     int mLastError;
       
    74     UntrustedCertificateWidget *mContent;
       
    75     QVariantMap mResultMap;
       
    76     bool mShowEventReceived;
       
    77     HbAction *mOkAction;
       
    78 };
       
    79 
       
    80 #endif // UNTRUSTEDCERTIFICATEDIALOG_H
       
    81