KDELibs4Support

kfilemetadatawidget.h
1 /*****************************************************************************
2  * Copyright (C) 2008 by Sebastian Trueg <[email protected]> *
3  * Copyright (C) 2009-2010 by Peter Penz <[email protected]> *
4  * *
5  * This library is free software; you can redistribute it and/or *
6  * modify it under the terms of the GNU Library General Public *
7  * License as published by the Free Software Foundation; either *
8  * version 2 of the License, or (at your option) any later version. *
9  * *
10  * This library 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 GNU *
13  * Library General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU Library General Public License *
16  * along with this library; see the file COPYING.LIB. If not, write to *
17  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *
18  * Boston, MA 02110-1301, USA. *
19  *****************************************************************************/
20 
21 #ifndef KFILEMETADATAWIDGET_H
22 #define KFILEMETADATAWIDGET_H
23 
24 #include <kdelibs4support_export.h>
25 #include <kfileitem.h>
26 
27 #include <QList>
28 #include <QWidget>
29 
30 /**
31  * @deprecated since 4.12 use Nepomuk2::FileMetaDataWidget
32  *
33  * @brief Shows the meta data of one or more file items.
34  *
35  * Meta data like name, size, rating, comment, ... are
36  * shown as several rows containing a description and
37  * the meta data value. It is possible for the user
38  * to change specific meta data like rating, tags and
39  * comment. The changes are stored automatically by the
40  * meta data widget.
41  *
42  * @since 4.5
43  */
44 class KDELIBS4SUPPORT_DEPRECATED_EXPORT KFileMetaDataWidget : public QWidget
45 {
46  Q_OBJECT
47  Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly)
48 
49 public:
50  KDELIBS4SUPPORT_DEPRECATED explicit KFileMetaDataWidget(QWidget *parent = nullptr);
51  ~KFileMetaDataWidget() override;
52 
53  /**
54  * Sets the items for which the meta data should be shown.
55  * The signal metaDataRequestFinished() will be emitted,
56  * as soon as the meta data for the items has been received.
57  */
58  void setItems(const KFileItemList &items);
59  KFileItemList items() const;
60 
61  /**
62  * If set to true, data such as the comment, tag or rating cannot be
63  * changed by the user. Per default read-only is disabled.
64  */
65  void setReadOnly(bool readOnly);
66  bool isReadOnly() const;
67 
68  /** @see QWidget::sizeHint() */
69  QSize sizeHint() const override;
70 
71 Q_SIGNALS:
72  /**
73  * Is emitted, if a meta data represents an URL that has
74  * been clicked by the user.
75  */
76  void urlActivated(const QUrl &url);
77 
78  /**
79  * Is emitted after the meta data has been received for the items
80  * set by KFileMetaDataWidget::setItems().
81  * @since 4.6
82  */
83  void metaDataRequestFinished(const KFileItemList &items);
84 
85 protected:
86  bool event(QEvent *event) override;
87 
88 private:
89  class Private;
90  Private *d;
91 
92  Q_PRIVATE_SLOT(d, void slotLoadingFinished())
93  Q_PRIVATE_SLOT(d, void slotLinkActivated(QString))
94  Q_PRIVATE_SLOT(d, void slotDataChangeStarted())
95  Q_PRIVATE_SLOT(d, void slotDataChangeFinished())
96 };
97 
98 #endif
Q_PROPERTY(...)
virtual bool event(QEvent *event) override
Shows the meta data of one or more file items.
Q_SIGNALSQ_SIGNALS
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Sep 28 2023 03:54:08 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.