File indexing completed on 2024-11-24 04:43:07

0001 /*
0002    SPDX-FileCopyrightText: 2021-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "confirmbeforedeleting_private_export.h"
0010 #include "confirmbeforedeletingcreaterulewidget.h"
0011 #include <QWidget>
0012 class QTreeWidget;
0013 class QTreeWidgetItem;
0014 class QPushButton;
0015 class KMAILCONFIRMBEFOREDELETING_TESTS_EXPORT ConfirmBeforeDeletingWidget : public QWidget
0016 {
0017     Q_OBJECT
0018 public:
0019     explicit ConfirmBeforeDeletingWidget(QWidget *parent = nullptr);
0020     ~ConfirmBeforeDeletingWidget() override;
0021 
0022     void save();
0023 
0024 private:
0025     void slotCustomContextMenuRequested(const QPoint &p);
0026     void slotRemoveRule();
0027     void slotAddRule();
0028     void fillRules();
0029     void slotEditRule();
0030     void initializeItem(QTreeWidgetItem *item, const ConfirmBeforeDeletingCreateRuleWidget::ConfirmBeforeDeletingInfo &info);
0031     void updateButtons();
0032     QTreeWidget *const mTreeWidget;
0033     QPushButton *const mAddRule;
0034     QPushButton *const mRemoveRule;
0035     QPushButton *const mModifyRule;
0036 };