]>
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>
20 class PlacesItemModel
;
22 class QDialogButtonBox
;
33 class FileMetaDataWidget
;
37 * @brief Manages the widgets that display the meta information
38 * for file items of the Information Panel.
40 class InformationPanelContent
: public QWidget
45 explicit InformationPanelContent(QWidget
* parent
= nullptr);
46 ~InformationPanelContent() override
;
49 * Shows the meta information for the item \p item.
50 * The preview of the item is generated asynchronously,
51 * the other meta information are fetched synchronously.
53 void showItem(const KFileItem
& item
);
56 * Shows the meta information for the items \p items and its preview
58 void showItems(const KFileItemList
& items
);
60 KFileItemList
items();
63 * Refreshes the preview display, hiding it if needed
65 void refreshPreview();
68 * Switch the metadatawidget into configuration mode
70 void configureShownProperties();
73 * Set the auto play media mode for the file previewed
74 * Eventually starting media playback when turning it on
75 * But not stopping it when turning it off
77 void setPreviewAutoPlay(bool autoPlay
);
80 void urlActivated( const QUrl
& url
);
81 void configurationFinished();
82 void contextMenuRequested(const QPoint
& pos
);
86 * Is invoked after the file meta data configuration dialog has been
87 * closed and refreshes the displayed meta data by the panel.
89 void refreshMetaData();
92 /** @see QObject::eventFilter() */
93 bool eventFilter(QObject
* obj
, QEvent
* event
) override
;
95 bool event(QEvent
* event
) override
;
99 * Is invoked if no preview is available for the item. In this
100 * case the icon will be shown.
102 void showIcon(const KFileItem
& item
);
105 * Is invoked if a preview is available for the item. The preview
106 * \a pixmap is shown inside the info page.
108 void showPreview(const KFileItem
& item
, const QPixmap
& pixmap
);
111 * Marks the currently shown preview as outdated
112 * by greying the content.
114 void markOutdatedPreview();
116 void slotHasVideoChanged(bool hasVideo
);
120 * Sets the text for the label \a m_nameLabel and assures that the
121 * text is split in a way that it can be wrapped within the
122 * label width (QLabel::setWordWrap() does not work if the
123 * text represents one extremely long word).
125 void setNameLabelText(const QString
& text
);
128 * Adjusts the sizes of the widgets dependent on the available
129 * width given by \p width.
131 void adjustWidgetSizes(int width
);
134 * Refreshes the image in the PixmapViewer
136 void refreshPixmapView();
138 bool gestureEvent(QGestureEvent
* event
);
143 QPointer
<KIO::PreviewJob
> m_previewJob
;
144 QTimer
* m_outdatedPreviewTimer
;
146 PixmapViewer
* m_preview
;
147 PhononWidget
* m_phononWidget
;
149 Baloo::FileMetaDataWidget
* m_metaDataWidget
;
150 QScrollArea
* m_metaDataArea
;
151 QLabel
* m_configureLabel
;
152 QDialogButtonBox
* m_configureButtons
;
154 PlacesItemModel
* m_placesItemModel
;
158 #endif // INFORMATIONPANELCONTENT_H