File indexing completed on 2022-11-29 20:24:01

0001 /*
0002     SPDX-FileCopyrightText: 2015-2022 Laurent Montel <montel@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 
0006 */
0007 
0008 #pragma once
0009 
0010 #include "libkdebugsettings_export.h"
0011 #include "loggingcategory.h"
0012 #include <QWidget>
0013 class QListWidget;
0014 class QPushButton;
0015 class KListWidgetSearchLine;
0016 class LIBKDEBUGSETTINGS_EXPORT CustomDebugSettingsPage : public QWidget
0017 {
0018     Q_OBJECT
0019 public:
0020     explicit CustomDebugSettingsPage(QWidget *parent = nullptr);
0021     ~CustomDebugSettingsPage() override;
0022 
0023     void fillList(const LoggingCategory::List &list);
0024     Q_REQUIRED_RESULT LoggingCategory::List rules() const;
0025 
0026 protected:
0027     bool eventFilter(QObject *obj, QEvent *event) override;
0028 
0029 private:
0030     void slotRemoveRules();
0031     void slotAddRule();
0032     void slotEditRule();
0033     void updateButtons();
0034     void slotCustomContextMenu(const QPoint &pos);
0035 
0036     QListWidget *const mListWidget;
0037     QPushButton *const mAddRule;
0038     QPushButton *const mEditRule;
0039     QPushButton *const mRemoveRule;
0040     KListWidgetSearchLine *mTreeListWidgetSearchLine = nullptr;
0041 };