File indexing completed on 2024-05-05 16:08:26

0001 /* This file is part of the KDE libraries
0002 
0003    Copyright (c) 2001,2002 Carsten Pfeiffer <pfeiffer@kde.org>
0004                  2007 Jos van den Oever <jos@vandenoever.info>
0005                  2010 Sebastian Trueg <trueg@kde.org>
0006 
0007    This library is free software; you can redistribute it and/or
0008    modify it under the terms of the GNU Library General Public
0009    License (LGPL) as published by the Free Software Foundation; either
0010    version 2 of the License, or (at your option) any later version.
0011 
0012    This library is distributed in the hope that it will be useful,
0013    but WITHOUT ANY WARRANTY; without even the implied warranty of
0014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0015    Library General Public License for more details.
0016 
0017    You should have received a copy of the GNU Library General Public License
0018    along with this library; see the file COPYING.LIB.  If not, write to
0019    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0020    Boston, MA 02110-1301, USA.
0021 */
0022 #ifndef KFILEMETAINFOITEM_H
0023 #define KFILEMETAINFOITEM_H
0024 
0025 #include <kdelibs4support_export.h>
0026 #include <QSharedData>
0027 
0028 class KFileWritePlugin;
0029 class QVariant;
0030 class PredicateProperties;
0031 
0032 class KFileMetaInfoItemPrivate;
0033 class KDELIBS4SUPPORT_DEPRECATED_EXPORT KFileMetaInfoItem
0034 {
0035     friend class KFileMetaInfo;
0036     friend class KFileMetaInfoPrivate;
0037     friend class KMetaInfoWriter;
0038 public:
0039     /**
0040      * @brief Default constructor
0041      **/
0042     KFileMetaInfoItem();
0043     /**
0044      * @brief Copy constructor
0045      **/
0046     KFileMetaInfoItem(const KFileMetaInfoItem &item);
0047     /**
0048      * @brief Destructor
0049      **/
0050     ~KFileMetaInfoItem();
0051     /**
0052      * @brief Copy operator
0053      **/
0054     const KFileMetaInfoItem &operator=(const KFileMetaInfoItem &item);
0055     /**
0056      * @brief Can this item be edited.
0057      **/
0058     bool isEditable() const;
0059     /**
0060      * @brief Has this value been removed, e.g with setValue(QVariant())
0061      **/
0062     bool isRemoved() const;
0063     /**
0064      * @brief Can this item be removed.
0065      **/
0066     bool isModified() const;
0067     /**
0068      * @brief Has this value been skipped by analyzer due to performance or other considerations.
0069      **/
0070     bool isSkipped() const;
0071     /**
0072      * @brief Retrieve the current value of this item
0073      **/
0074     const QVariant &value() const;
0075     /**
0076      * @brief Set the value of this field.
0077      **/
0078     bool setValue(const QVariant &value);
0079     /**
0080      * @brief Append a value to the properties in this file.
0081      **/
0082     bool addValue(const QVariant &);
0083     /**
0084      * @brief Is this a valid item.
0085      **/
0086     bool isValid() const;
0087     /**
0088      * @brief Retrieve the properties of this field type.
0089      *
0090      * @deprecated
0091      **/
0092 #ifndef KDELIBS4SUPPORT_NO_DEPRECATED
0093     KDELIBS4SUPPORT_DEPRECATED const PredicateProperties &properties() const;
0094 #endif
0095     /**
0096      * Localized name of the predicate.
0097      **/
0098     const QString &name() const;
0099     /**
0100      * This method returns a translated suffix to be displayed after the
0101      * value. Think of the kbps in 128kbps
0102      *
0103      * @return the suffix
0104      */
0105     QString suffix() const;
0106     /**
0107      * This method returns a translated prefix to be displayed before the
0108      * value.
0109      *
0110      * @return the prefix
0111      */
0112     QString prefix() const;
0113 private:
0114     QSharedDataPointer<KFileMetaInfoItemPrivate> d;
0115 
0116     KFileMetaInfoItem(const QString &p,
0117                       const QVariant &v, KFileWritePlugin *w, bool e);
0118 };
0119 
0120 #endif