File indexing completed on 2024-05-12 05:07:44

0001 /*
0002     SPDX-FileCopyrightText: 2019 Thomas Baumgart <tbaumgart@kde.org>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 
0007 #ifndef LEDGERACCOUNTFILTER_H
0008 #define LEDGERACCOUNTFILTER_H
0009 
0010 // ----------------------------------------------------------------------------
0011 // QT Includes
0012 
0013 // ----------------------------------------------------------------------------
0014 // KDE Includes
0015 
0016 // ----------------------------------------------------------------------------
0017 // Project Includes
0018 
0019 #include "ledgerfilterbase.h"
0020 
0021 class MyMoneyAccount;
0022 class LedgerAccountFilterPrivate;
0023 
0024 class LedgerAccountFilter : public LedgerFilterBase
0025 {
0026     Q_OBJECT
0027 
0028 public:
0029     explicit LedgerAccountFilter(QObject* parent, QVector<QAbstractItemModel*> specialJournalModels);
0030     ~LedgerAccountFilter() override;
0031 
0032     void setShowBalanceInverted(bool inverted = true);
0033 
0034     void setAccount(const MyMoneyAccount& acc);
0035 
0036     QVariant data(const QModelIndex& index, int role) const override;
0037 
0038 protected:
0039     bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const override;
0040 
0041     // Overridden to suppress sorting on this model
0042     void doSort() override;
0043 
0044 private:
0045     Q_DECLARE_PRIVATE_D(LedgerFilterBase::d_ptr, LedgerAccountFilter)
0046 };
0047 
0048 #endif // LEDGERACCOUNTFILTER_H
0049