pkiutilities/untrustedcertificatedialog/inc/untrustedcertificatewidget.h
changeset 26 aad866c37519
child 30 cc1cea6aabaf
equal deleted inserted replaced
22:6b63ca65093a 26:aad866c37519
       
     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 UNTRUSTEDCERTIFICATEWIDGET_H
       
    20 #define UNTRUSTEDCERTIFICATEWIDGET_H
       
    21 
       
    22 #include <hbwidget.h>
       
    23 
       
    24 class UntrustedCertificateInfoBase;
       
    25 class QGraphicsLinearLayout;
       
    26 class HbLabel;
       
    27 class HbCheckBox;
       
    28 class HbGroupBox;
       
    29 class HbTextEdit;
       
    30 
       
    31 
       
    32 /**
       
    33  * Untrusted certificate widget.
       
    34  * Content widget for untrusted certificate dialog.
       
    35  * See UntrustedCertificateDialog.
       
    36  */
       
    37 class UntrustedCertificateWidget : public HbWidget
       
    38 {
       
    39     Q_OBJECT
       
    40 
       
    41 public:     // constructor and destructor
       
    42     UntrustedCertificateWidget(QGraphicsItem *parent=0, Qt::WindowFlags flags=0);
       
    43     virtual ~UntrustedCertificateWidget();
       
    44 
       
    45     void constructFromParameters(const QVariantMap &parameters);
       
    46     void updateFromParameters(const QVariantMap &parameters);
       
    47     bool isPermanentAcceptChecked() const;
       
    48 
       
    49 public:     // new platform specific functions
       
    50     bool isCertificateValid();
       
    51 
       
    52 private:    // new platform specific functions
       
    53     void processEncodedCertificate(const QByteArray &encodedCert);
       
    54     QString descriptionText();
       
    55 
       
    56 private:    // new functions
       
    57     Q_DISABLE_COPY(UntrustedCertificateWidget)
       
    58     void processParameters(const QVariantMap &parameters);
       
    59 
       
    60 private:    // data
       
    61     QGraphicsLinearLayout *mMainLayout;
       
    62     HbLabel *mProblemDescription;
       
    63     HbCheckBox *mAcceptPermanently;
       
    64     HbGroupBox *mCertificateDetailsGroupBox;
       
    65     HbTextEdit *mCertificateDetailsText;
       
    66     UntrustedCertificateInfoBase *mCertificateInfo;
       
    67     QString mServerName;
       
    68     int mValidationError;
       
    69     bool mIsSavingServerNamePossible;
       
    70 };
       
    71 
       
    72 
       
    73 #endif // UNTRUSTEDCERTIFICATEWIDGET_H
       
    74