Fix crash if key bindings specified in profile cannot be found. Improve
[personal-kdebase.git] / apps / lib / konq / konq_fileitemcapabilities.h
blob2a26db16a9fc44a4fb2ac1151b34c7a6c99c7dac
1 /***************************************************************************
2 * Copyright (C) 2008 by Peter Penz <peter.penz@gmx.at> *
3 * Copyright (C) 2008 by George Goldberg <grundleborg@googlemail.com> *
4 * *
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. *
9 * *
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. *
14 * *
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;
29 class KFileItemList;
31 /**
32 * @brief Provides information about the access capabilities of a group of
33 * KFileItem objects.
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.
41 * @since 4.1
43 class LIBKONQ_EXPORT KonqFileItemCapabilities
45 public:
46 /**
47 * @brief Default constructor. Use setItems to specify the items.
49 KonqFileItemCapabilities();
50 /**
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);
57 /**
58 * @brief Copy constructor
60 KonqFileItemCapabilities(const KonqFileItemCapabilities&);
61 /**
62 * @brief Destructor
64 virtual ~KonqFileItemCapabilities();
65 /**
66 * @brief Assignment operator
68 KonqFileItemCapabilities& operator=(const KonqFileItemCapabilities& other);
69 /**
70 * Sets the items that are to have their supported capabilities checked.
72 void setItems(const KFileItemList& items);
74 /**
75 * @brief Check if reading capability is supported
76 * @return true if all the FileItems support reading, otherwise false.
78 bool supportsReading() const;
79 /**
80 * @brief Check if deleting capability is supported
81 * @return true if all the FileItems support deleting, otherwise false.
83 bool supportsDeleting() const;
84 /**
85 * @brief Check if writing capability is supported
86 * @return true if all the FileItems support writing, otherwise false.
88 bool supportsWriting() const;
89 /**
90 * @brief Check if moving capability is supported
91 * @return true if all the FileItems support moving, otherwise false.
93 bool supportsMoving() const;
94 /**
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.
99 bool isLocal() const;
101 private:
102 /** @brief d-pointer */
103 QSharedDataPointer<KonqFileItemCapabilitiesPrivate> d;
106 #endif