aheinecke@404: /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik aheinecke@404: * Software engineering by Intevation GmbH aheinecke@404: * aheinecke@404: * This file is Free Software under the GNU GPL (v>=2) aheinecke@404: * and comes with ABSOLUTELY NO WARRANTY! aheinecke@404: * See LICENSE.txt for details. aheinecke@404: */ rrenkert@334: #ifndef CERTIFICATETABLEMODEL_H rrenkert@334: #define CERTIFICATETABLEMODEL_H rrenkert@334: rrenkert@334: /** rrenkert@334: * @file certificatetablemodel.h rrenkert@334: * @brief Table model for certificates. rrenkert@334: */ rrenkert@334: rrenkert@334: #include rrenkert@334: #include rrenkert@334: #include "certificate.h" rrenkert@334: andre@1255: /** @brief Table model for certificates.*/ rrenkert@334: class CertificateTabelModel : public QAbstractTableModel rrenkert@334: { rrenkert@334: Q_OBJECT rrenkert@334: rrenkert@334: public: rrenkert@334: CertificateTabelModel(QObject *parent = 0); rrenkert@334: rrenkert@358: void addCertificate(const Certificate &certificate, bool editable); rrenkert@376: bool removeRows(int row, int count, const QModelIndex&); rrenkert@396: bool removeAll(); rrenkert@334: int rowCount(const QModelIndex &parent = QModelIndex()) const; rrenkert@334: int columnCount(const QModelIndex &parent = QModelIndex()) const; rrenkert@334: rrenkert@334: QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; rrenkert@348: bool setData(const QModelIndex &index, const QVariant &value, rrenkert@348: int role = Qt::EditRole); rrenkert@334: QVariant headerData(int section, Qt::Orientation orientation, rrenkert@348: int role = Qt::DisplayRole) const; rrenkert@348: rrenkert@348: Qt::ItemFlags flags(const QModelIndex &index) const; rrenkert@334: aheinecke@463: const QList& certificates() {return mCertificates;} aheinecke@463: rrenkert@334: private: aheinecke@463: QList mCertificates; rrenkert@342: QList header; rrenkert@334: }; rrenkert@334: rrenkert@334: #endif