]>
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
10 #include "config-dolphin.h"
21 class QDialogButtonBox
;
34 class FileMetaDataWidget
;
38 * @brief Manages the widgets that display the meta information
39 * for file items of the Information Panel.
41 class InformationPanelContent
: public QWidget
46 explicit InformationPanelContent(QWidget
*parent
= nullptr);
47 ~InformationPanelContent() override
;
50 * Shows the meta information for the item \p item.
51 * The preview of the item is generated asynchronously,
52 * the other meta information are fetched synchronously.
54 void showItem(const KFileItem
&item
);
57 * Shows the meta information for the items \p items and its preview
59 void showItems(const KFileItemList
&items
);
61 KFileItemList
items();
64 * Refreshes the preview display, hiding it if needed
66 void refreshPreview();
69 * Switch the metadatawidget into configuration mode
71 void configureShownProperties();
74 * Set the auto play media mode for the file previewed
75 * Eventually starting media playback when turning it on
76 * But not stopping it when turning it off
78 void setPreviewAutoPlay(bool autoPlay
);
81 void urlActivated(const QUrl
&url
);
82 void configurationFinished();
83 void contextMenuRequested(const QPoint
&pos
);
87 * Is invoked after the file meta data configuration dialog has been
88 * closed and refreshes the displayed meta data by the panel.
90 void refreshMetaData();
93 /** @see QObject::eventFilter() */
94 bool eventFilter(QObject
*obj
, QEvent
*event
) override
;
96 bool event(QEvent
*event
) override
;
100 * Is invoked if no preview is available for the item. In this
101 * case the icon will be shown.
103 void showIcon(const KFileItem
&item
);
106 * Is invoked if a preview is available for the item. The preview
107 * \a pixmap is shown inside the info page.
109 void showPreview(const KFileItem
&item
, const QPixmap
&pixmap
);
112 * Marks the currently shown preview as outdated
113 * by greying the content.
115 void markOutdatedPreview();
117 void slotHasVideoChanged(bool hasVideo
);
121 * Sets the text for the label \a m_nameLabel and assures that the
122 * text is split in a way that it can be wrapped within the
123 * label width (QLabel::setWordWrap() does not work if the
124 * text represents one extremely long word).
126 void setNameLabelText(const QString
&text
);
129 * Adjusts the sizes of the widgets dependent on the available
130 * width given by \p width.
132 void adjustWidgetSizes(int width
);
135 * Refreshes the image in the PixmapViewer
137 void refreshPixmapView();
139 bool gestureEvent(QGestureEvent
*event
);
144 QPointer
<KIO::PreviewJob
> m_previewJob
;
145 QTimer
*m_outdatedPreviewTimer
;
147 PixmapViewer
*m_preview
;
148 MediaWidget
*m_mediaWidget
;
150 Baloo::FileMetaDataWidget
*m_metaDataWidget
;
151 QScrollArea
*m_metaDataArea
;
152 QLabel
*m_configureLabel
;
153 QDialogButtonBox
*m_configureButtons
;
158 #endif // INFORMATIONPANELCONTENT_H