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 {
21 TypeRole = Qt::UserRole,
22 ScopeRole
23 };
24
25 explicit CustomFieldsModel(QObject *parent = nullptr);
26 ~CustomFieldsModel() override;
27
28 void setCustomFields(const CustomField::List &addresses);
29 [[nodiscard]] CustomField::List customFields() const;
30
31 QModelIndex index(int row, int col, const QModelIndex &parent = QModelIndex()) const override;
32 QModelIndex parent(const QModelIndex &child) const override;
33 QVariant data(const QModelIndex &index, int role) const override;
34 bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
35 QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
36 Qt::ItemFlags flags(const QModelIndex &index) const override;
37 int columnCount(const QModelIndex &parent = QModelIndex()) const override;
38 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
39
40 bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
41 bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
42
43private:
44 CustomField::List mCustomFields;
45};
46}
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 Sat Dec 21 2024 17:05:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.