comparison ui/certificatelistwidget.h @ 654:129e611eaf50

Merge branch trustbridge-refactor
author Andre Heinecke <andre.heinecke@intevation.de>
date Wed, 25 Jun 2014 15:16:24 +0200
parents 39f03316f675
children 973a7ce19658
comparison
equal deleted inserted replaced
648:e41a2537b84d 654:129e611eaf50
1 /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik
2 * Software engineering by Intevation GmbH
3 *
4 * This file is Free Software under the GNU GPL (v>=2)
5 * and comes with ABSOLUTELY NO WARRANTY!
6 * See LICENSE.txt for details.
7 */
8 #ifndef CERTIFICATELISTWIDGET_H
9 #define CERTIFICATELISTWIDGET_H
10
11 #include <QWidget>
12 #include <QMainWindow>
13 #include <QLabel>
14 #include <QListWidget>
15
16 #include "certificate.h"
17 /**
18 * @file certificatelistwidget.h
19 * @brief Displays a list of certificates and a details panel for a selected
20 * certificate.
21 */
22
23 Q_DECLARE_METATYPE(Certificate);
24 class CertificateListWidget : public QWidget
25 {
26 Q_OBJECT
27 public:
28 CertificateListWidget(QWidget *parent, Qt::WindowFlags flags = 0);
29
30 void addCertificate(const Certificate &certificate, bool state, bool editable = true);
31 void addCertificates(const QList<Certificate> &list);
32 void removeCertificate(const Certificate &cert);
33 void setCertState(bool state, const Certificate &cert);
34 void clear();
35 QStringList certificates();
36 QStringList selectedCertificates();
37 QStringList unselectedCertificates();
38 QList<Certificate> certificateList();
39 int selectedCertCount();
40 bool contains(const Certificate &cert);
41 void setSelected(int index);
42
43 private:
44 void setupGUI();
45
46 QListWidget *mCertificateList;
47 QLabel *mSubjectCN;
48 QLabel *mSubjectO;
49 QLabel *mIssuerCN;
50 QLabel *mIssuerO;
51 QLabel *mValidFrom;
52 QLabel *mValidTo;
53 QLabel *mFingerprint;
54
55 private slots:
56 void updateDetails(QListWidgetItem *item);
57 void certStateChanged(bool state, const Certificate &cert);
58
59 signals:
60 void certListChanged(int selected);
61 void certChanged(bool state, const Certificate &cert);
62
63 };
64 #endif // CERTIFICATELISTWIDGET_H

http://wald.intevation.org/projects/trustbridge/