1 /***************************************************************************
2 * Copyright (C) 2008 by Peter Penz <peter.penz@gmx.at> *
3 * Copyright (C) 2008 by George Goldberg <grundleborg@googlemail.com> *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program 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 *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
19 ***************************************************************************/
21 #ifndef KONQ_FILEITEMCAPABILITIES_H
22 #define KONQ_FILEITEMCAPABILITIES_H
24 #include <libkonq_export.h>
26 #include <QtCore/QSharedDataPointer>
28 class KonqFileItemCapabilitiesPrivate
;
32 * @brief Provides information about the access capabilities of a group of
35 * As soon as one file item does not support a specific capability, it is
36 * marked as unsupported for all items.
38 * This class is implicitly shared, which means it can be used as a value and
39 * copied around at almost no cost.
43 class LIBKONQ_EXPORT KonqFileItemCapabilities
47 * @brief Default constructor. Use setItems to specify the items.
49 KonqFileItemCapabilities();
51 * @brief Constructor that takes a KFileItemList and sets the capabilities
52 * supported by all the FileItems as true.
53 * @param items The list of items that are to have their supported
54 * capabilities checked.
56 KonqFileItemCapabilities(const KFileItemList
& items
);
58 * @brief Copy constructor
60 KonqFileItemCapabilities(const KonqFileItemCapabilities
&);
64 virtual ~KonqFileItemCapabilities();
66 * @brief Assignment operator
68 KonqFileItemCapabilities
& operator=(const KonqFileItemCapabilities
& other
);
70 * Sets the items that are to have their supported capabilities checked.
72 void setItems(const KFileItemList
& items
);
75 * @brief Check if reading capability is supported
76 * @return true if all the FileItems support reading, otherwise false.
78 bool supportsReading() const;
80 * @brief Check if deleting capability is supported
81 * @return true if all the FileItems support deleting, otherwise false.
83 bool supportsDeleting() const;
85 * @brief Check if writing capability is supported
86 * @return true if all the FileItems support writing, otherwise false.
88 bool supportsWriting() const;
90 * @brief Check if moving capability is supported
91 * @return true if all the FileItems support moving, otherwise false.
93 bool supportsMoving() const;
95 * @brief Check if files are local
96 * @return true if all the FileItems are local, otherwise there is one or more
97 * remote file, so false.
102 /** @brief d-pointer */
103 QSharedDataPointer
<KonqFileItemCapabilitiesPrivate
> d
;