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

0001 /*****************************************************************************
0002  * Copyright (C) 2009 by Peter Penz <peter.penz@gmx.at>                      *
0003  *                                                                           *
0004  * This library is free software; you can redistribute it and/or             *
0005  * modify it under the terms of the GNU Library General Public               *
0006  * License as published by the Free Software Foundation; either              *
0007  * version 2 of the License, or (at your option) any later version.          *
0008  *                                                                           *
0009  * This library is distributed in the hope that it will be useful,           *
0010  * but WITHOUT ANY WARRANTY; without even the implied warranty of            *
0011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
0012  * Library General Public License for more details.                          *
0013  *                                                                           *
0014  * You should have received a copy of the GNU Library General Public License *
0015  * along with this library; see the file COPYING.LIB.  If not, write to      *
0016  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,      *
0017  * Boston, MA 02110-1301, USA.                                               *
0018  *****************************************************************************/
0019 
0020 #ifndef KFILEMETADATACONFIGURATIONWIDGET_H
0021 #define KFILEMETADATACONFIGURATIONWIDGET_H
0022 
0023 #include <kdelibs4support_export.h>
0024 #include <kfileitem.h>
0025 
0026 #include <QWidget>
0027 
0028 /**
0029  * @deprecated since 4.12, use Nepomuk2::FileMetaDataConfigurationWidget
0030  *
0031  * @brief Widget which allows to configure which meta data should be shown
0032  *        in the KFileMetaDataWidget.
0033  *
0034  * Note that the class is marked as internal and the API might change.
0035  * It is planned to make the class public in future KDE SC's, after the API has
0036  * been stabilized.
0037  *
0038  * @see KFileMetaDataWidget
0039  * @since 4.5
0040  * @internal
0041  */
0042 // TODO: A signal is required which indicates configuration changes. Otherwise
0043 // it would not be possible for an application developer to enable/disable an
0044 // "Apply" button of a dialog.
0045 class KDELIBS4SUPPORT_DEPRECATED_EXPORT KFileMetaDataConfigurationWidget : public QWidget
0046 {
0047     Q_OBJECT
0048 
0049 public:
0050     KDELIBS4SUPPORT_DEPRECATED explicit KFileMetaDataConfigurationWidget(QWidget *parent = nullptr);
0051     ~KFileMetaDataConfigurationWidget() override;
0052 
0053     /**
0054      * Sets the items, for which the visibility of the meta data should
0055      * be configured. Note that the visibility of the meta data is not
0056      * bound to the items itself, the items are only used to determine
0057      * which meta data should be configurable. For example when a JPEG image
0058      * is set as item, it will be configurable which EXIF data should be
0059      * shown. If an audio file is set as item, it will be configurable
0060      * whether the artist, album name, ... should be shown.
0061      */
0062     void setItems(const KFileItemList &items);
0063     KFileItemList items() const;
0064 
0065     /**
0066      * Saves the modified configuration.
0067      */
0068     void save();
0069 
0070     /** @see QWidget::sizeHint() */
0071     QSize sizeHint() const override;
0072 
0073 protected:
0074     bool event(QEvent *event) override;
0075 
0076 private:
0077     class Private;
0078     Private *const d;
0079 
0080     Q_PRIVATE_SLOT(d, void loadMetaData())
0081     Q_PRIVATE_SLOT(d, void slotLoadingFinished())
0082 };
0083 
0084 #endif