Akonadi

agentinstancemodel.h
1 /*
2  Copyright (c) 2006-2008 Tobias Koenig <[email protected]>
3 
4  This library is free software; you can redistribute it and/or modify it
5  under the terms of the GNU Library General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or (at your
7  option) any later version.
8 
9  This library is distributed in the hope that it will be useful, but WITHOUT
10  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12  License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to the
16  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  02110-1301, USA.
18 */
19 
20 #ifndef AKONADI_AGENTINSTANCEMODEL_H
21 #define AKONADI_AGENTINSTANCEMODEL_H
22 
23 #include "akonadicore_export.h"
24 
25 #include <QAbstractItemModel>
26 
27 namespace Akonadi
28 {
29 
51 class AKONADICORE_EXPORT AgentInstanceModel : public QAbstractItemModel
52 {
53  Q_OBJECT
54 
55 public:
59  enum Roles {
60  TypeRole = Qt::UserRole + 1,
71  UserRole = Qt::UserRole + 42
72  };
73 
79  explicit AgentInstanceModel(QObject *parent = nullptr);
80 
84  ~AgentInstanceModel() override;
85 
86  Q_REQUIRED_RESULT QHash<int, QByteArray> roleNames() const override;
87  Q_REQUIRED_RESULT int columnCount(const QModelIndex &parent = QModelIndex()) const override;
88  Q_REQUIRED_RESULT int rowCount(const QModelIndex &parent = QModelIndex()) const override;
89  Q_REQUIRED_RESULT QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
90  Q_REQUIRED_RESULT QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
91  Q_REQUIRED_RESULT QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
92  Q_REQUIRED_RESULT QModelIndex parent(const QModelIndex &index) const override;
93  Q_REQUIRED_RESULT Qt::ItemFlags flags(const QModelIndex &index) const override;
94  Q_REQUIRED_RESULT bool setData(const QModelIndex &index, const QVariant &value, int role) override;
95 
96 private:
97  //@cond PRIVATE
98  class Private;
99  Private *const d;
100 
101  Q_PRIVATE_SLOT(d, void instanceChanged(const Akonadi::AgentInstance &))
102  //@endcond
103 };
104 
105 }
106 
107 #endif
A textual presentation of the current status.
The current online/offline status.
The current status (numerical) of the instance.
Provides a data model for agent instances.
A description of the agent type.
A list of supported capabilities.
The current progress (numerical in percent) of an operation.
The identifier of the agent instance.
Helper integration between Akonadi and Qt.
A representation of an agent instance.
Roles
Describes the roles of this model.
typedef ItemFlags
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon May 25 2020 22:46:07 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.