Add (and install) svg for the new krunner interface.
[kdebase/uwolfer.git] / apps / lib / konq / konq_menuactions.h
blob0cba5577d99a730735c35970051b27e0a2cd51ce
1 /* This file is part of the KDE project
2 Copyright (C) 1998-2007 David Faure <faure@kde.org>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
9 This library 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 GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
20 #ifndef KONQ_MENUACTIONS_H
21 #define KONQ_MENUACTIONS_H
23 #include <kfileitem.h>
24 #include <libkonq_export.h>
26 class QMenu;
27 class KonqMenuActionsPrivate;
29 /**
30 * This class handles the user-defined actions for a url in a popupmenu.
31 * User-defined actions include:
32 * - builtin services like mount/unmount for old-style device desktop files
33 * - user-defined actions for a .desktop file, defined in the file itself (see the desktop entry standard)
34 * - servicemenus actions, defined in .desktop files and selected based on the mimetype of the url
36 class LIBKONQ_EXPORT KonqMenuActions
38 public:
39 /**
40 * Creates a KonqMenuActions instance.
41 * Note that this instance must stay alive for at least as long as the popupmenu;
42 * it has the slots for the actions created by addActionsTo.
44 KonqMenuActions();
46 /**
47 * Sets the list of fileitems which the actions apply to.
48 * This call is mandatory.
50 void setItems(const KFileItemList& items);
52 /**
53 * Sets the URL which the actions apply to. This call is optional,
54 * the url of the first item given to setItems is used otherwise.
56 void setUrl(const KUrl& url);
58 /**
59 * Call this if actions that modify the files should not be shown.
60 * This is controlled by Require=Write in the servicemenu desktop files
62 void setReadOnly(bool ro);
64 /**
65 * Generate the actions and submenus, and adds them to the @p menu.
66 * All actions are created as children of the menu.
67 * @return the number of actions added
69 int addActionsTo(QMenu* menu);
71 private:
72 KonqMenuActionsPrivate* const d;
75 #endif /* KONQ_MENUACTIONS_H */