File indexing completed on 2024-05-12 16:43:56

0001 /*
0002     SPDX-FileCopyrightText: 2009 Cristian Oneț <onet.cristian@gmail.com>
0003     SPDX-FileCopyrightText: 2017-2018 Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com>
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef ACCOUNTSVIEWPROXYMODEL_H
0008 #define ACCOUNTSVIEWPROXYMODEL_H
0009 
0010 #include "kmm_widgets_export.h"
0011 
0012 // ----------------------------------------------------------------------------
0013 // QT Includes
0014 
0015 #include <QSet>
0016 #include <QPoint>
0017 
0018 // ----------------------------------------------------------------------------
0019 // KDE Includes
0020 
0021 // ----------------------------------------------------------------------------
0022 // Project Includes
0023 
0024 #include "accountsproxymodel.h"
0025 #include "modelenums.h"
0026 
0027 class QPoint;
0028 
0029 /**
0030   * This model is specialized to organize the data for the accounts tree view
0031   * based on the data of the @ref AccountsModel.
0032   */
0033 class AccountsViewProxyModelPrivate;
0034 class KMM_WIDGETS_EXPORT AccountsViewProxyModel : public AccountsProxyModel
0035 {
0036     Q_OBJECT
0037     Q_DISABLE_COPY(AccountsViewProxyModel)
0038 
0039 public:
0040     explicit AccountsViewProxyModel(QObject *parent = nullptr);
0041     ~AccountsViewProxyModel() override;
0042 
0043     void setColumnVisibility(eAccountsModel::Column column, bool visible);
0044     QSet<eAccountsModel::Column> getVisibleColumns();
0045 
0046 public Q_SLOTS:
0047     void slotColumnsMenu(const QPoint);
0048 
0049 Q_SIGNALS:
0050     void columnToggled(const eAccountsModel::Column column, const bool show);
0051 
0052 protected:
0053     AccountsViewProxyModel(AccountsViewProxyModelPrivate &dd, QObject *parent);
0054     bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
0055     bool filterAcceptsColumn(int source_column, const QModelIndex &source_parent) const override;
0056 
0057 private:
0058     Q_DECLARE_PRIVATE(AccountsViewProxyModel)
0059 };
0060 
0061 #endif