add more spacing
[personal-kdebase.git] / apps / dolphin / src / panels / folders / treeviewcontextmenu.h
blob8da23721b2a4abb9ca59f70ea929189c11b780a4
1 /***************************************************************************
2 * Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at> *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 ***************************************************************************/
20 #ifndef TREEVIEWCONTEXTMENU_H
21 #define TREEVIEWCONTEXTMENU_H
23 #include <QtCore/QObject>
24 #include <KFileItem>
26 class FoldersPanel;
28 /**
29 * @brief Represents the context menu which appears when doing a right
30 * click on an item of the treeview.
32 class TreeViewContextMenu : public QObject
34 Q_OBJECT
36 public:
37 /**
38 * @parent Pointer to the folders panel the context menu
39 * belongs to.
40 * @fileInfo Pointer to the file item the context menu
41 * is applied. If 0 is passed, the context menu
42 * is above the viewport.
44 TreeViewContextMenu(FoldersPanel* parent,
45 const KFileItem& fileInfo);
47 virtual ~TreeViewContextMenu();
49 /** Opens the context menu modal. */
50 void open();
52 private slots:
53 /** Cuts the item m_fileInfo. */
54 void cut();
56 /** Copies the item m_fileInfo. */
57 void copy();
59 /** Paste the clipboard to m_fileInfo. */
60 void paste();
62 /** Renames the item m_fileInfo. */
63 void rename();
65 /** Moves the item m_fileInfo to the trash. */
66 void moveToTrash();
68 /** Deletes the item m_fileInfo. */
69 void deleteItem();
71 /** Shows the properties of the item m_fileInfo. */
72 void showProperties();
74 /**
75 * Sets the 'Show Hidden Files' setting for the
76 * folders panel to \a show.
78 void setShowHiddenFiles(bool show);
80 private:
81 void populateMimeData(QMimeData* mimeData, bool cut);
83 private:
84 FoldersPanel* m_parent;
85 KFileItem m_fileInfo;
88 #endif