File indexing completed on 2024-05-05 04:48:24

0001 /****************************************************************************************
0002  * Copyright (c) 2004 Michael Pyne <michael.pyne@kdemail.net>                           *
0003  * Copyright (c) 2006 Ian Monroe <ian@monroe.nu>                                        *
0004  *                                                                                      *
0005  * This program is free software; you can redistribute it and/or modify it under        *
0006  * the terms of the GNU General Public License as published by the Free Software        *
0007  * Foundation; either version 2 of the License, or (at your option) any later           *
0008  * version.                                                                             *
0009  *                                                                                      *
0010  * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
0011  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
0012  * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
0013  *                                                                                      *
0014  * You should have received a copy of the GNU General Public License along with         *
0015  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
0016  ****************************************************************************************/
0017 
0018 #ifndef DELETEDIALOG_H
0019 #define DELETEDIALOG_H
0020 
0021 #include "ui_deletedialogbase.h"
0022 
0023 #include <QDialog>
0024 #include <QUrl>
0025 
0026 #include <QCheckBox>
0027 #include <QLabel>
0028 
0029 class KGuiItem;
0030 class QLabel;
0031 
0032 class DeleteDialogBase : public QWidget, public Ui::DeleteDialogBase
0033 {
0034 public:
0035     explicit DeleteDialogBase( QWidget *parent ) : QWidget( parent ) {
0036     setupUi( this );
0037   }
0038 };
0039 
0040 
0041 class DeleteWidget : public DeleteDialogBase
0042 {
0043     Q_OBJECT
0044 
0045 public:
0046     explicit DeleteWidget(QWidget *parent = nullptr);
0047 
0048     void setFiles(const QList<QUrl> &files);
0049 
0050 protected Q_SLOTS:
0051     virtual void slotShouldDelete(bool shouldDelete);
0052 };
0053 
0054 class DeleteDialog : public QDialog
0055 {
0056     Q_OBJECT
0057 
0058 public:
0059     explicit DeleteDialog(QWidget *parent, const char *name = "delete_dialog");
0060     static bool showTrashDialog(QWidget* parent, const QList<QUrl> &files);
0061 
0062     bool confirmDeleteList(const QList<QUrl> &condemnedFiles);
0063     void setFiles(const QList<QUrl> &files);
0064     bool shouldDelete() const { return m_widget->ddShouldDelete->isChecked(); }
0065 
0066 protected Q_SLOTS:
0067     virtual void accept();
0068     void slotShouldDelete(bool shouldDelete);
0069 
0070 private:
0071     DeleteWidget *m_widget;
0072     KGuiItem m_trashGuiItem;
0073 };
0074 
0075 #endif
0076 
0077 // vim: set et ts=4 sw=4: