1 /* This file is part of the KDE project
2 Copyright 2008 David Faure <faure@kde.org>
4 This library is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Library General Public License as published
6 by the Free Software Foundation; either version 2 of the License or
7 ( at your option ) version 3 or, at the discretion of KDE e.V.
8 ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
21 #ifndef KONQ_COPYTOMENU_H
22 #define KONQ_COPYTOMENU_H
25 #include <kfileitem.h>
26 #include <libkonq_export.h>
29 class KonqCopyToMenuPrivate
;
32 * This class adds "Copy To" and "Move To" submenus to a popupmenu.
34 class LIBKONQ_EXPORT KonqCopyToMenu
38 * Creates a KonqCopyToMenu instance.
39 * Note that this instance must stay alive for at least as long as the popupmenu;
40 * it has the slots for the actions created by addActionsTo.
50 * Sets the list of fileitems which the actions apply to.
51 * Either call this or setUrls.
53 void setItems(const KFileItemList
& items
);
56 * Sets the URLs which the actions apply to.
57 * Either call this or setItems.
59 void setUrls(const KUrl::List
& urls
);
62 * If setReadOnly(true) is called, the "Move To" submenu will not appear.
64 void setReadOnly(bool ro
);
67 * Generate the actions and submenus, and adds them to the @p menu.
68 * All actions are created as children of the menu.
70 void addActionsTo(QMenu
* menu
);
73 KonqCopyToMenuPrivate
* const d
;
76 #endif /* KONQ_COPYTOMENU_H */