1 | /* This file is part of the KDE libraries |
2 | |
3 | Copyright (c) 2001,2002 Carsten Pfeiffer <pfeiffer@kde.org> |
4 | 2007 Jos van den Oever <jos@vandenoever.info> |
5 | 2010 Sebastian Trueg <trueg@kde.org> |
6 | |
7 | This library is free software; you can redistribute it and/or |
8 | modify it under the terms of the GNU Library General Public |
9 | License (LGPL) as published by the Free Software Foundation; either |
10 | version 2 of the License, or (at your option) any later version. |
11 | |
12 | This library is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 | Library General Public License for more details. |
16 | |
17 | You should have received a copy of the GNU Library General Public License |
18 | along with this library; see the file COPYING.LIB. If not, write to |
19 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
20 | Boston, MA 02110-1301, USA. |
21 | */ |
22 | #ifndef KFILEMETAINFOITEM_H |
23 | #define KFILEMETAINFOITEM_H |
24 | |
25 | #include <kio/kio_export.h> |
26 | #include <QtCore/QSharedData> |
27 | |
28 | class KFileWritePlugin; |
29 | class QVariant; |
30 | class PredicateProperties; |
31 | class KUrl; |
32 | |
33 | class KFileMetaInfoItemPrivate; |
34 | class KIO_EXPORT KFileMetaInfoItem { |
35 | friend class KFileMetaInfo; |
36 | friend class KFileMetaInfoPrivate; |
37 | friend class KMetaInfoWriter; |
38 | public: |
39 | /** |
40 | * @brief Default constructor |
41 | **/ |
42 | KFileMetaInfoItem(); |
43 | /** |
44 | * @brief Copy constructor |
45 | **/ |
46 | KFileMetaInfoItem(const KFileMetaInfoItem& item); |
47 | /** |
48 | * @brief Destructor |
49 | **/ |
50 | ~KFileMetaInfoItem(); |
51 | /** |
52 | * @brief Copy operator |
53 | **/ |
54 | const KFileMetaInfoItem& operator=(const KFileMetaInfoItem& item); |
55 | /** |
56 | * @brief Can this item be edited. |
57 | **/ |
58 | bool isEditable() const; |
59 | /** |
60 | * @brief Has this value been removed, e.g with setValue(QVariant()) |
61 | **/ |
62 | bool isRemoved() const; |
63 | /** |
64 | * @brief Can this item be removed. |
65 | **/ |
66 | bool isModified() const; |
67 | /** |
68 | * @brief Has this value been skipped by analyzer due to performance or other considerations. |
69 | **/ |
70 | bool isSkipped() const; |
71 | /** |
72 | * @brief Retrieve the current value of this item |
73 | **/ |
74 | const QVariant& value() const; |
75 | /** |
76 | * @brief Set the value of this field. |
77 | **/ |
78 | bool setValue(const QVariant& value); |
79 | /** |
80 | * @brief Append a value to the properties in this file. |
81 | **/ |
82 | bool addValue(const QVariant&); |
83 | /** |
84 | * @brief Is this a valid item. |
85 | **/ |
86 | bool isValid() const; |
87 | /** |
88 | * @brief Retrieve the properties of this field type. |
89 | * |
90 | * @deprecated |
91 | **/ |
92 | #ifndef KDE_NO_DEPRECATED |
93 | KDE_DEPRECATED const PredicateProperties& properties() const; |
94 | #endif |
95 | /** |
96 | * Localized name of the predicate. |
97 | **/ |
98 | const QString& name() const; |
99 | /** |
100 | * This method returns a translated suffix to be displayed after the |
101 | * value. Think of the kbps in 128kbps |
102 | * |
103 | * @return the suffix |
104 | */ |
105 | QString suffix() const; |
106 | /** |
107 | * This method returns a translated prefix to be displayed before the |
108 | * value. |
109 | * |
110 | * @return the prefix |
111 | */ |
112 | QString prefix() const; |
113 | private: |
114 | QSharedDataPointer<KFileMetaInfoItemPrivate> d; |
115 | |
116 | KFileMetaInfoItem(const QString& p, |
117 | const QVariant& v, KFileWritePlugin* w, bool e); |
118 | }; |
119 | |
120 | #endif |
121 | |