1 | /* |
2 | This file is part of the KDE libraries |
3 | SPDX-FileCopyrightText: 2006-2010 Peter Penz <peter.penz@gmx.at> |
4 | SPDX-FileCopyrightText: 2020 Méven Car <meven.car@kdemail.net> |
5 | |
6 | SPDX-License-Identifier: LGPL-2.0-or-later |
7 | */ |
8 | |
9 | #ifndef RENAMEFILEDIALOG_H |
10 | #define RENAMEFILEDIALOG_H |
11 | |
12 | #include <KFileItem> |
13 | |
14 | #include "kiowidgets_export.h" |
15 | |
16 | #include <QDialog> |
17 | #include <QString> |
18 | |
19 | class QLineEdit; |
20 | class QSpinBox; |
21 | class QPushButton; |
22 | class KJob; |
23 | |
24 | namespace KIO |
25 | { |
26 | class RenameFileDialogPrivate; |
27 | |
28 | // TODO KF6 : rename the class RenameFileDialog to RenameDialog and the class RenameDialog to RenameFileOverwrittenDialog or similar. |
29 | /*! |
30 | * \class KIO::RenameFileDialog |
31 | * \inheaderfile KIO/RenameFileDialog |
32 | * \inmodule KIOWidgets |
33 | * |
34 | * \brief Dialog for renaming a variable number of files. |
35 | * |
36 | * The dialog deletes itself when accepted or rejected. |
37 | * |
38 | * \since 5.67 |
39 | */ |
40 | class KIOWIDGETS_EXPORT RenameFileDialog : public QDialog |
41 | { |
42 | Q_OBJECT |
43 | |
44 | public: |
45 | /*! |
46 | * Constructs the Dialog to rename file(s) |
47 | * |
48 | * \a parent the parent QWidget |
49 | * |
50 | * \a items a non-empty list of items to rename |
51 | */ |
52 | explicit RenameFileDialog(const KFileItemList &items, QWidget *parent); |
53 | ~RenameFileDialog() override; |
54 | |
55 | Q_SIGNALS: |
56 | /*! |
57 | * |
58 | */ |
59 | void renamingFinished(const QList<QUrl> &urls); |
60 | |
61 | /*! |
62 | * |
63 | */ |
64 | void error(KJob *error); |
65 | |
66 | private Q_SLOTS: |
67 | KIOWIDGETS_NO_EXPORT void slotAccepted(); |
68 | KIOWIDGETS_NO_EXPORT void slotOperationChanged(int index); |
69 | KIOWIDGETS_NO_EXPORT void slotStateChanged(); |
70 | KIOWIDGETS_NO_EXPORT void slotFileRenamed(const QUrl &oldUrl, const QUrl &newUrl); |
71 | KIOWIDGETS_NO_EXPORT void slotResult(KJob *job); |
72 | |
73 | private: |
74 | class RenameFileDialogPrivate; |
75 | RenameFileDialogPrivate *const d; |
76 | }; |
77 | } // namespace KIO |
78 | |
79 | #endif |
80 | |