Akonadi Contacts

addressmodel.h
1/*
2 This file is part of Contact Editor.
3
4 SPDX-FileCopyrightText: 2019 Volker Krause <vkrause@kde.org>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7*/
8
9#pragma once
10
11#include <QAbstractListModel>
12
13#include <KContacts/Address>
14
15namespace Akonadi
16{
17class AddressModel : public QAbstractListModel
18{
20public:
21 explicit AddressModel(QObject *parent = nullptr);
22 ~AddressModel() override;
23
24 [[nodiscard]] KContacts::Address::List addresses() const;
25 void setAddresses(const KContacts::Address::List &addresses);
26 void addAddress(const KContacts::Address &address);
27 void replaceAddress(const KContacts::Address &address, int row);
28 void removeAddress(int row);
29
30 int rowCount(const QModelIndex &parent) const override;
31 QVariant data(const QModelIndex &index, int role) const override;
32
33private:
34 KContacts::Address::List mAddresses;
35};
36
37}
A widget for editing the display name of a contact.
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const override
Q_OBJECTQ_OBJECT
QObject * parent() const const
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.