1/*
2 SPDX-FileCopyrightText: 2008, 2015 David Faure <faure@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#ifndef KFILECOPYTOMENU_P_H
8#define KFILECOPYTOMENU_P_H
9
10#include <KConfigGroup>
11#include <QActionGroup>
12#include <QMenu>
13#include <QUrl>
14
15class KFileCopyToMenuPrivate
16{
17public:
18 KFileCopyToMenuPrivate(KFileCopyToMenu *qq, QWidget *parentWidget);
19
20 KFileCopyToMenu *const q;
21 QList<QUrl> m_urls;
22 QWidget *m_parentWidget;
23 bool m_readOnly;
24 bool m_autoErrorHandling;
25};
26
27enum MenuType { Copy, Move };
28
29// The main menu, shown when opening "Copy To" or "Move To"
30// It contains Home Folder, Root Folder, Browse, and recent destinations
31class KFileCopyToMainMenu : public QMenu
32{
33 Q_OBJECT
34public:
35 KFileCopyToMainMenu(QMenu *parent, KFileCopyToMenuPrivate *d, MenuType menuType);
36
37 QActionGroup &actionGroup()
38 {
39 return m_actionGroup; // used by submenus
40 }
41 MenuType menuType() const
42 {
43 return m_menuType; // used by submenus
44 }
45
46private Q_SLOTS:
47 void slotAboutToShow();
48 void slotBrowse();
49 void slotTriggered(QAction *action);
50
51private:
52 void copyOrMoveTo(const QUrl &dest);
53
54private:
55 MenuType m_menuType;
56 QActionGroup m_actionGroup;
57 KFileCopyToMenuPrivate *d; // this isn't our own d pointer, it's the one for the public class
58 KConfigGroup m_recentDirsGroup;
59};
60
61// The menu that lists a directory
62class KFileCopyToDirectoryMenu : public QMenu
63{
64 Q_OBJECT
65public:
66 KFileCopyToDirectoryMenu(QMenu *parent, KFileCopyToMainMenu *mainMenu, const QString &path);
67
68private Q_SLOTS:
69 void slotAboutToShow();
70
71private:
72 KFileCopyToMainMenu *m_mainMenu;
73 QString m_path;
74};
75
76#endif
77

source code of kio/src/filewidgets/kfilecopytomenu_p.h