pkiutilities/untrustedcertificatedialog/inc/untrustedcertificatewidget.h
branchRCL_3
changeset 21 09b1ac925e3f
equal deleted inserted replaced
20:63339781d179 21:09b1ac925e3f
       
     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 isPermanentAcceptAllowed() const;
       
    48     bool isPermanentAcceptChecked() const;
       
    49     QString serverName() const;
       
    50 
       
    51 public:     // new platform specific functions
       
    52     bool isCertificateValid();
       
    53 
       
    54 private:    // new platform specific functions
       
    55     void processEncodedCertificate(const QByteArray &encodedCert);
       
    56     QString descriptionText();
       
    57 
       
    58 private:    // new functions
       
    59     Q_DISABLE_COPY(UntrustedCertificateWidget)
       
    60     void processParameters(const QVariantMap &parameters);
       
    61 
       
    62 private:    // data
       
    63     QGraphicsLinearLayout *mMainLayout;
       
    64     HbLabel *mProblemDescription;
       
    65     HbCheckBox *mAcceptPermanently;
       
    66     HbGroupBox *mCertificateDetailsGroupBox;
       
    67     HbTextEdit *mCertificateDetailsText;
       
    68     UntrustedCertificateInfoBase *mCertificateInfo;
       
    69     QString mServerName;
       
    70     int mValidationError;
       
    71     bool mIsSavingServerNamePossible;
       
    72 };
       
    73 
       
    74 
       
    75 #endif // UNTRUSTEDCERTIFICATEWIDGET_H
       
    76