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_POPUPMENUPLUGIN_H
22 #define KONQ_POPUPMENUPLUGIN_H
24 #include "libkonq_export.h"
25 #include <QtCore/QObject>
28 class KActionCollection
;
29 class KonqPopupMenuInformation
;
32 * Base class for KonqPopupMenu plugins.
34 * Please try to use servicemenus first, if you simply need to add
35 * actions to the popup menu for one or more mimetypes.
37 * However if you need some dynamic logic, like "only show this item if
38 * two files are selected", or "show a submenu with a variable number of actions",
39 * then you have to implement a KonqPopupMenuPlugin subclass.
41 class LIBKONQ_EXPORT KonqPopupMenuPlugin
: public QObject
49 KonqPopupMenuPlugin(QObject
* parent
);
50 virtual ~KonqPopupMenuPlugin();
53 * Implement the setup method in the plugin in order to create actions
54 * in the given actionCollection and add it to the menu using menu->addAction().
56 * @param actionCollection the parent for the actions
57 * @param popupMenuInfo all the information about the popupmenu being shown
58 * (which file items, their common mimetype, etc.)
59 * @param menu the menu where the plugin can add its own actions
61 virtual void setup(KActionCollection
* actionCollection
,
62 const KonqPopupMenuInformation
& popupMenuInfo
,
66 #endif /* KONQ_POPUPMENUPLUGIN_H */