]>
cloud.milkyroute.net Git - dolphin.git/blob - src/panels/information/informationpanelcontent.h
2 * SPDX-FileCopyrightText: 2009-2010 Peter Penz <peter.penz19@gmail.com>
4 * SPDX-License-Identifier: GPL-2.0-or-later
7 #ifndef INFORMATIONPANELCONTENT_H
8 #define INFORMATIONPANELCONTENT_H
11 #include <config-baloo.h>
21 class QDialogButtonBox
;
32 class FileMetaDataWidget
;
36 * @brief Manages the widgets that display the meta information
37 * for file items of the Information Panel.
39 class InformationPanelContent
: public QWidget
44 explicit InformationPanelContent(QWidget
* parent
= nullptr);
45 ~InformationPanelContent() override
;
48 * Shows the meta information for the item \p item.
49 * The preview of the item is generated asynchronously,
50 * the other meta information are fetched synchronously.
52 void showItem(const KFileItem
& item
);
55 * Shows the meta information for the items \p items and its preview
57 void showItems(const KFileItemList
& items
);
59 KFileItemList
items();
62 * Refreshes the preview display, hiding it if needed
64 void refreshPreview();
67 * Switch the metadatawidget into configuration mode
69 void configureShownProperties();
72 * Set the auto play media mode for the file previewed
73 * Eventually starting media playback when turning it on
74 * But not stopping it when turning it off
76 void setPreviewAutoPlay(bool autoPlay
);
79 void urlActivated( const QUrl
& url
);
80 void configurationFinished();
81 void contextMenuRequested(const QPoint
& pos
);
85 * Is invoked after the file meta data configuration dialog has been
86 * closed and refreshes the displayed meta data by the panel.
88 void refreshMetaData();
91 /** @see QObject::eventFilter() */
92 bool eventFilter(QObject
* obj
, QEvent
* event
) override
;
94 bool event(QEvent
* event
) override
;
98 * Is invoked if no preview is available for the item. In this
99 * case the icon will be shown.
101 void showIcon(const KFileItem
& item
);
104 * Is invoked if a preview is available for the item. The preview
105 * \a pixmap is shown inside the info page.
107 void showPreview(const KFileItem
& item
, const QPixmap
& pixmap
);
110 * Marks the currently shown preview as outdated
111 * by greying the content.
113 void markOutdatedPreview();
115 void slotHasVideoChanged(bool hasVideo
);
119 * Sets the text for the label \a m_nameLabel and assures that the
120 * text is split in a way that it can be wrapped within the
121 * label width (QLabel::setWordWrap() does not work if the
122 * text represents one extremely long word).
124 void setNameLabelText(const QString
& text
);
127 * Adjusts the sizes of the widgets dependent on the available
128 * width given by \p width.
130 void adjustWidgetSizes(int width
);
133 * Refreshes the image in the PixmapViewer
135 void refreshPixmapView();
137 bool gestureEvent(QGestureEvent
* event
);
142 QPointer
<KIO::PreviewJob
> m_previewJob
;
143 QTimer
* m_outdatedPreviewTimer
;
145 PixmapViewer
* m_preview
;
146 PhononWidget
* m_phononWidget
;
148 Baloo::FileMetaDataWidget
* m_metaDataWidget
;
149 QScrollArea
* m_metaDataArea
;
150 QLabel
* m_configureLabel
;
151 QDialogButtonBox
* m_configureButtons
;
156 #endif // INFORMATIONPANELCONTENT_H