SVN_SILENT made messages (.desktop file) - always resolve ours
[kdepim.git] / akonadiconsole / agentconfigmodel.h
blob9d4bbc1421e3a4c20eb59315fe74779de1a5515e
1 /*
2 Copyright (c) 2010 Volker Krause <vkrause@kde.org>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
17 USA.
20 #ifndef AKONADICONSOLE_AGENTCONFIGMODEL_H
21 #define AKONADICONSOLE_AGENTCONFIGMODEL_H
23 #include <AkonadiCore/AgentInstance>
25 #include <QAbstractItemModel>
26 #include <QVector>
28 class QDBusInterface;
30 class AgentConfigModel : public QAbstractTableModel
32 Q_OBJECT
33 public:
34 explicit AgentConfigModel(QObject *parent = Q_NULLPTR);
35 ~AgentConfigModel();
36 void setAgentInstance(const Akonadi::AgentInstance &instance);
38 int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
39 int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
40 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
41 bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) Q_DECL_OVERRIDE;
42 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
43 Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE;
45 public Q_SLOTS:
46 void reload();
47 void writeConfig();
49 private:
50 QVector<QPair<QString, QVariant> > m_settings;
51 QDBusInterface *m_interface;
54 #endif