2
* This file is part of system-settings
4
* Copyright (C) 2016 Canonical Ltd.
6
* This program is free software: you can redistribute it and/or modify it
7
* under the terms of the GNU General Public License version 3, as published
8
* by the Free Software Foundation.
10
* This program is distributed in the hope that it will be useful, but
11
* WITHOUT ANY WARRANTY; without even the implied warranties of
12
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
13
* PURPOSE. See the GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License along
16
* with this program. If not, see <http://www.gnu.org/licenses/>.
19
#ifndef MOCK_CERTHANDLER_H
20
#define MOCK_CERTHANDLER_H
22
#include <QAbstractListModel>
30
QString expiryDate; // dd.mm.yyyy
40
class MockAbstractListModel : public QAbstractListModel
45
CNRole = Qt::UserRole + 1,
56
explicit MockAbstractListModel(QObject *parent = 0);
57
~MockAbstractListModel() {};
58
QHash<int, QByteArray> roleNames() const;
59
Q_INVOKABLE int rowCount(const QModelIndex &parent = QModelIndex()) const;
60
Q_INVOKABLE QString getfileName(const int selectedIndex) const;
61
Q_INVOKABLE void dataupdate();
62
QVariant data(const QModelIndex &index, int role) const;
63
QList<MockFile> m_files = QList<MockFile>();
66
class MockFileHandler : public QObject
70
Q_INVOKABLE QByteArray getCertContent(QString filename);
71
Q_INVOKABLE QString moveCertFile(QString filename);
72
Q_INVOKABLE QString moveKeyFile(QString filename);
73
Q_INVOKABLE QString movePacFile(QString filename);
74
Q_INVOKABLE bool removeFile(QString filename);
77
class MockCertificateListModel : public MockAbstractListModel
82
class MockPrivatekeyListModel : public MockAbstractListModel
87
class MockPacFileListModel : public MockAbstractListModel
92
#endif // MOCK_CERTHANDLER_H