File indexing completed on 2024-05-12 05:52:36

0001 /*
0002     SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "libkdebugsettings_private_export.h"
0010 #include <QListView>
0011 class CustomLoggingCategoryModel;
0012 class CustomLoggingCategoryProxyModel;
0013 class LIBKDEBUGSETTINGS_EXPORT_TEST_EXPORT CustomDebugListView : public QListView
0014 {
0015     Q_OBJECT
0016 public:
0017     explicit CustomDebugListView(QWidget *parent = nullptr);
0018     ~CustomDebugListView() override;
0019 
0020     void slotAddRule();
0021     void removeRules();
0022     void editRule();
0023 
0024     [[nodiscard]] CustomLoggingCategoryModel *loggingCategoryModel() const;
0025     void setLoggingCategoryModel(CustomLoggingCategoryModel *newLoggingCategoryModel);
0026 
0027     void setFilterRuleStr(const QString &str);
0028 
0029 Q_SIGNALS:
0030     void updateButtonsRequested();
0031 
0032 private:
0033     void slotEditRule(const QModelIndex &index);
0034     void slotRemoveRules(const QModelIndexList &selectedIndexes);
0035     void slotCustomContextMenuRequested(const QPoint &pos);
0036     CustomLoggingCategoryModel *mCustomLoggingCategoryModel = nullptr;
0037     CustomLoggingCategoryProxyModel *const mCustomLoggingCategoryProxyModel;
0038 };