]> cloud.milkyroute.net Git - dolphin.git/blob - src/views/tooltips/dolphinfilemetadatawidget.h
placespanel: Use correct loop index when connecting device signals
[dolphin.git] / src / views / tooltips / dolphinfilemetadatawidget.h
1 /*
2 * SPDX-FileCopyrightText: 2010 Peter Penz <peter.penz19@gmail.com>
3 * SPDX-FileCopyrightText: 2008 Fredrik Höglund <fredrik@kde.org>
4 * SPDX-FileCopyrightText: 2012 Mark Gaiser <markg85@gmail.com>
5 *
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
8
9 #ifndef DOLPHINFILEMETADATAWIDGET_H
10 #define DOLPHINFILEMETADATAWIDGET_H
11
12 #include "config-dolphin.h"
13
14 #include <QWidget>
15
16 class KFileItemList;
17 class QLabel;
18
19 namespace Baloo
20 {
21 class FileMetaDataWidget;
22 }
23
24 /**
25 * @brief Widget that shows the meta information and a preview of one
26 * or more files inside a KToolTipWidget.
27 */
28 class DolphinFileMetaDataWidget : public QWidget
29 {
30 Q_OBJECT
31
32 public:
33 explicit DolphinFileMetaDataWidget(QWidget *parent = nullptr);
34 ~DolphinFileMetaDataWidget() override;
35
36 void setPreview(const QPixmap &pixmap);
37 QPixmap preview() const;
38
39 void setName(const QString &name);
40 QString name() const;
41
42 /**
43 * Sets the items for which the meta data should be shown.
44 * The signal metaDataRequestFinished() will be emitted,
45 * as soon as the meta data for the items has been received.
46 */
47 void setItems(const KFileItemList &items);
48 KFileItemList items() const;
49
50 Q_SIGNALS:
51 /**
52 * Is emitted after the meta data has been received for the items
53 * set by DolphinFileMetaDataWidget::setItems().
54 */
55 void metaDataRequestFinished(const KFileItemList &items);
56
57 /**
58 * Is emitted when the user clicks a tag or a link
59 * in the metadata widget.
60 */
61 void urlActivated(const QUrl &url);
62
63 private:
64 QLabel *m_preview;
65 QLabel *m_name;
66 Baloo::FileMetaDataWidget *m_fileMetaDataWidget;
67 };
68
69 #endif