Akonadi Contacts

customfieldsmodel.h
1/*
2 This file is part of Contact Editor.
3
4 SPDX-FileCopyrightText: 2010 Tobias Koenig <tokoe@kde.org>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7*/
8
9#pragma once
10
11#include "customfields_p.h"
12
13#include <QAbstractItemModel>
14namespace Akonadi
15{
16class CustomFieldsModel : public QAbstractItemModel
17{
19public:
20 enum Role { TypeRole = Qt::UserRole, ScopeRole };
21
22 explicit CustomFieldsModel(QObject *parent = nullptr);
23 ~CustomFieldsModel() override;
24
25 void setCustomFields(const CustomField::List &addresses);
26 [[nodiscard]] CustomField::List customFields() const;
27
28 QModelIndex index(int row, int col, const QModelIndex &parent = QModelIndex()) const override;
29 QModelIndex parent(const QModelIndex &child) const override;
30 QVariant data(const QModelIndex &index, int role) const override;
31 bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
32 QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
33 Qt::ItemFlags flags(const QModelIndex &index) const override;
34 int columnCount(const QModelIndex &parent = QModelIndex()) const override;
35 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
36
37 bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
38 bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
39
40private:
41 CustomField::List mCustomFields;
42};
43}
A widget for editing the display name of a contact.
Q_OBJECTQ_OBJECT
QObject * parent() const const
UserRole
typedef ItemFlags
Orientation
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:13:20 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.