diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ui/certificatelistwidget.h	Wed Jun 25 15:16:24 2014 +0200
@@ -0,0 +1,64 @@
+/* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik
+ * Software engineering by Intevation GmbH
+ *
+ * This file is Free Software under the GNU GPL (v>=2)
+ * and comes with ABSOLUTELY NO WARRANTY!
+ * See LICENSE.txt for details.
+ */
+#ifndef CERTIFICATELISTWIDGET_H
+#define CERTIFICATELISTWIDGET_H
+
+#include <QWidget>
+#include <QMainWindow>
+#include <QLabel>
+#include <QListWidget>
+
+#include "certificate.h"
+/**
+ * @file certificatelistwidget.h
+ * @brief Displays a list of certificates and a details panel for a selected
+ * certificate.
+ */
+
+Q_DECLARE_METATYPE(Certificate);
+class CertificateListWidget : public QWidget
+{
+    Q_OBJECT
+public:
+    CertificateListWidget(QWidget *parent, Qt::WindowFlags flags = 0);
+
+    void addCertificate(const Certificate &certificate, bool state, bool editable = true);
+    void addCertificates(const QList<Certificate> &list);
+    void removeCertificate(const Certificate &cert);
+    void setCertState(bool state, const Certificate &cert);
+    void clear();
+    QStringList certificates();
+    QStringList selectedCertificates();
+    QStringList unselectedCertificates();
+    QList<Certificate> certificateList();
+    int selectedCertCount();
+    bool contains(const Certificate &cert);
+    void setSelected(int index);
+
+private:
+    void setupGUI();
+
+    QListWidget *mCertificateList;
+    QLabel *mSubjectCN;
+    QLabel *mSubjectO;
+    QLabel *mIssuerCN;
+    QLabel *mIssuerO;
+    QLabel *mValidFrom;
+    QLabel *mValidTo;
+    QLabel *mFingerprint;
+
+private slots:
+    void updateDetails(QListWidgetItem *item);
+    void certStateChanged(bool state, const Certificate &cert);
+
+signals:
+    void certListChanged(int selected);
+    void certChanged(bool state, const Certificate &cert);
+
+};
+#endif // CERTIFICATELISTWIDGET_H

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