]> cloud.milkyroute.net Git - dolphin.git/blob - src/views/tooltips/dolphinfilemetadatawidget.h
Build with QT_NO_KEYWORDS
[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-baloo.h>
13
14 #include <QWidget>
15
16 class KFileItemList;
17 class QLabel;
18
19 namespace Baloo {
20 class FileMetaDataWidget;
21 }
22
23 /**
24 * @brief Widget that shows the meta information and a preview of one
25 * or more files inside a KToolTipWidget.
26 */
27 class DolphinFileMetaDataWidget : public QWidget
28 {
29 Q_OBJECT
30
31 public:
32 explicit DolphinFileMetaDataWidget(QWidget* parent = nullptr);
33 ~DolphinFileMetaDataWidget() override;
34
35 void setPreview(const QPixmap& pixmap);
36 QPixmap preview() const;
37
38 void setName(const QString& name);
39 QString name() const;
40
41 /**
42 * Sets the items for which the meta data should be shown.
43 * The signal metaDataRequestFinished() will be emitted,
44 * as soon as the meta data for the items has been received.
45 */
46 void setItems(const KFileItemList& items);
47 KFileItemList items() const;
48
49 Q_SIGNALS:
50 /**
51 * Is emitted after the meta data has been received for the items
52 * set by DolphinFileMetaDataWidget::setItems().
53 */
54 void metaDataRequestFinished(const KFileItemList& items);
55
56 /**
57 * Is emitted when the user clicks a tag or a link
58 * in the metadata widget.
59 */
60 void urlActivated(const QUrl& url);
61
62 private:
63 QLabel* m_preview;
64 QLabel* m_name;
65 Baloo::FileMetaDataWidget* m_fileMetaDataWidget;
66 };
67
68 #endif