File indexing completed on 2025-01-05 04:58:21

0001 /*
0002   SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org>
0003 
0004   SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "pimcommonakonadi_export.h"
0010 #include <QWidget>
0011 
0012 class QItemSelectionModel;
0013 class QTreeView;
0014 class KCheckableProxyModel;
0015 
0016 namespace Akonadi
0017 {
0018 class EntityTreeModel;
0019 class Collection;
0020 }
0021 
0022 namespace PimCommon
0023 {
0024 class CheckedCollectionWidgetPrivate;
0025 /**
0026  * @brief The CheckedCollectionWidget class
0027  * @author Laurent Montel <montel@kde.org>
0028  */
0029 class PIMCOMMONAKONADI_EXPORT CheckedCollectionWidget : public QWidget
0030 {
0031     Q_OBJECT
0032 public:
0033     explicit CheckedCollectionWidget(const QString &mimetype, QWidget *parent = nullptr);
0034     ~CheckedCollectionWidget() override;
0035 
0036     [[nodiscard]] Akonadi::EntityTreeModel *entityTreeModel() const;
0037 
0038     [[nodiscard]] QTreeView *folderTreeView() const;
0039 
0040     [[nodiscard]] QItemSelectionModel *selectionModel() const;
0041 
0042     [[nodiscard]] KCheckableProxyModel *checkableProxy() const;
0043 
0044 Q_SIGNALS:
0045     void collectionAdded(const Akonadi::Collection &, const Akonadi::Collection &);
0046     void collectionRemoved(const Akonadi::Collection &);
0047 
0048 private:
0049     PIMCOMMONAKONADI_NO_EXPORT void slotSetCollectionFilter(const QString &filter);
0050     std::unique_ptr<CheckedCollectionWidgetPrivate> const d;
0051 };
0052 }