Akonadi Contacts

addressmodel.h
1 /*
2  This file is part of Contact Editor.
3 
4  SPDX-FileCopyrightText: 2019 Volker Krause <[email protected]>
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 
15 namespace ContactEditor
16 {
17 class AddressModel : public QAbstractListModel
18 {
19  Q_OBJECT
20 public:
21  explicit AddressModel(QObject *parent = nullptr);
22  ~AddressModel() override;
23 
24  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 
33 private:
34  KContacts::Address::List mAddresses;
35 };
36 
37 }
38 
Q_OBJECTQ_OBJECT
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Wed Jun 23 2021 23:09:24 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.