File indexing completed on 2024-11-24 04:39:28

0001 /*
0002     This file is part of Akonadi Contact.
0003 
0004     SPDX-FileCopyrightText: 2010 KDAB
0005     SPDX-FileContributor: Tobias Koenig <tokoe@kde.org>
0006 
0007     SPDX-License-Identifier: LGPL-2.0-or-later
0008 */
0009 
0010 #pragma once
0011 
0012 #include "akonadi-contact-core_export.h"
0013 #include "leafextensionproxymodel_p.h"
0014 
0015 #include "contactstreemodel.h"
0016 
0017 namespace Akonadi
0018 {
0019 class AKONADI_CONTACT_CORE_EXPORT EmailAddressSelectionProxyModel : public Akonadi::LeafExtensionProxyModel
0020 {
0021     Q_OBJECT
0022 
0023 public:
0024     enum Role { NameRole = ContactsTreeModel::DateRole + 1, EmailAddressRole };
0025 
0026     explicit EmailAddressSelectionProxyModel(QObject *parent = nullptr);
0027     ~EmailAddressSelectionProxyModel() override;
0028 
0029     [[nodiscard]] QVariant data(const QModelIndex &proxyIndex, int role = Qt::DisplayRole) const override;
0030 
0031 protected:
0032     /**
0033      * This method is called to retrieve the row count for the given leaf @p index.
0034      */
0035     int leafRowCount(const QModelIndex &index) const override;
0036 
0037     /**
0038      * This method is called to retrieve the column count for the given leaf @p index.
0039      */
0040     int leafColumnCount(const QModelIndex &index) const override;
0041 
0042     /**
0043      * This method is called to retrieve the data of the child of the given leaf @p index
0044      * at @p row and @p column with the given @p role.
0045      */
0046     QVariant leafData(const QModelIndex &index, int row, int column, int role = Qt::DisplayRole) const override;
0047 
0048 private:
0049 };
0050 }