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_POPUPMENUINFORMATION_H
22 #define KONQ_POPUPMENUINFORMATION_H
24 #include "konq_fileitemcapabilities.h"
27 class KonqPopupMenuInformationPrivate
;
32 * Holds the information about the items shown by KonqPopupMenu.
33 * This information is used by KonqMenuActions to insert the appropriate
34 * actions (for user-defined services and for associated applications),
35 * and by KonqPopupMenuPlugin for plugins to decide what to show.
37 * KonqPopupMenuInformation is implicitly shared, i.e. it can be used as a value and copied around at almost no cost.
39 class LIBKONQ_EXPORT KonqPopupMenuInformation
45 KonqPopupMenuInformation();
50 KonqPopupMenuInformation(const KonqPopupMenuInformation
&);
55 ~KonqPopupMenuInformation();
57 KonqPopupMenuInformation
& operator=(const KonqPopupMenuInformation
& o
);
60 * Sets the list of fileitems which the actions apply to.
62 void setItems(const KFileItemList
& items
);
67 KFileItemList
items() const;
70 * List of urls, gathered from the fileitems
72 KUrl::List
urlList() const;
75 * Returns the capabilities of the items.
76 * For instance, if they are readonly, then no action should modify those files.
78 KonqFileItemCapabilities
capabilities() const;
81 * @return true if all items are directories
83 bool isDirectory() const;
86 * @return the mimetype of all items, if they all have the same, otherwise empty
88 QString
mimeType() const;
91 * @return the mimetype group (e.g. "text") of all items, if they all have the same, otherwise empty
93 QString
mimeGroup() const;
96 * Call this to set a parent widget (e.g. for error message boxes)
98 void setParentWidget(QWidget
* parentWidget
);
101 * Parent widget (e.g. for error message boxes)
103 QWidget
* parentWidget() const;
106 QSharedDataPointer
<KonqPopupMenuInformationPrivate
> d
;
109 #endif /* KONQ_POPUPMENUINFORMATION_H */