]> cloud.milkyroute.net Git - dolphin.git/blob - src/panels/folders/treeviewcontextmenu.h
Output of licensedigger + manual cleanup afterwards.
[dolphin.git] / src / panels / folders / treeviewcontextmenu.h
1 /*
2 * SPDX-FileCopyrightText: 2006 Peter Penz <peter.penz19@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7 #ifndef TREEVIEWCONTEXTMENU_H
8 #define TREEVIEWCONTEXTMENU_H
9
10 #include <KFileItem>
11
12 #include <QObject>
13
14 class QMimeData;
15 class FoldersPanel;
16
17 /**
18 * @brief Represents the context menu which appears when doing a right
19 * click on an item of the treeview.
20 */
21 class TreeViewContextMenu : public QObject
22 {
23 Q_OBJECT
24
25 public:
26 /**
27 * @parent Pointer to the folders panel the context menu
28 * belongs to.
29 * @fileInfo Pointer to the file item the context menu
30 * is applied. If 0 is passed, the context menu
31 * is above the viewport.
32 */
33 TreeViewContextMenu(FoldersPanel* parent,
34 const KFileItem& fileInfo);
35
36 ~TreeViewContextMenu() override;
37
38 /** Opens the context menu modal. */
39 void open(const QPoint& pos);
40
41 private slots:
42 /** Cuts the item m_fileItem. */
43 void cut();
44
45 /** Copies the item m_fileItem. */
46 void copy();
47
48 /** Paste the clipboard to m_fileItem. */
49 void paste();
50
51 /** Renames the item m_fileItem. */
52 void rename();
53
54 /** Moves the item m_fileItem to the trash. */
55 void moveToTrash();
56
57 /** Deletes the item m_fileItem. */
58 void deleteItem();
59
60 /** Shows the properties of the item m_fileItem. */
61 void showProperties();
62
63 /**
64 * Sets the 'Show Hidden Files' setting for the
65 * folders panel to \a show.
66 */
67 void setShowHiddenFiles(bool show);
68
69 /**
70 * Sets the 'Limit folders panel to home' setting for the
71 * folders panel to \a enable.
72 */
73 void setLimitFoldersPanelToHome(bool enable);
74
75 /**
76 * Sets the 'Automatic Scrolling' setting for the
77 * folders panel to \a enable.
78 */
79 void setAutoScrolling(bool enable);
80
81 private:
82 void populateMimeData(QMimeData* mimeData, bool cut);
83
84 private:
85 FoldersPanel* m_parent;
86 KFileItem m_fileItem;
87 };
88
89 #endif