]>
cloud.milkyroute.net Git - dolphin.git/blob - src/panels/information/informationpanelcontent.h
1 /***************************************************************************
2 * Copyright (C) 2009-2010 by Peter Penz <peter.penz19@gmail.com> *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 ***************************************************************************/
20 #ifndef INFORMATIONPANELCONTENT_H
21 #define INFORMATIONPANELCONTENT_H
24 #include <config-baloo.h>
33 class PlacesItemModel
;
35 class QDialogButtonBox
;
45 class FileMetaDataWidget
;
49 * @brief Manages the widgets that display the meta information
50 * for file items of the Information Panel.
52 class InformationPanelContent
: public QWidget
57 explicit InformationPanelContent(QWidget
* parent
= nullptr);
58 ~InformationPanelContent() override
;
61 * Shows the meta information for the item \p item.
62 * The preview of the item is generated asynchronously,
63 * the other meta information are fetched synchronously.
65 void showItem(const KFileItem
& item
);
68 * Shows the meta information for the items \p items and its preview
70 void showItems(const KFileItemList
& items
);
72 KFileItemList
items();
75 * Refreshes the preview display, hiding it if needed
77 void refreshPreview();
80 * Switch the metadatawidget into configuration mode
82 void configureShownProperties();
85 * Set the auto play media mode for the file previewed
86 * Eventually starting media playback when turning it on
87 * But not stopping it when turning it off
89 void setPreviewAutoPlay(bool autoPlay
);
92 void urlActivated( const QUrl
& url
);
93 void configurationFinished();
97 * Is invoked after the file meta data configuration dialog has been
98 * closed and refreshes the displayed meta data by the panel.
100 void refreshMetaData();
103 /** @see QObject::eventFilter() */
104 bool eventFilter(QObject
* obj
, QEvent
* event
) override
;
108 * Is invoked if no preview is available for the item. In this
109 * case the icon will be shown.
111 void showIcon(const KFileItem
& item
);
114 * Is invoked if a preview is available for the item. The preview
115 * \a pixmap is shown inside the info page.
117 void showPreview(const KFileItem
& item
, const QPixmap
& pixmap
);
120 * Marks the currently shown preview as outdated
121 * by greying the content.
123 void markOutdatedPreview();
125 void slotHasVideoChanged(bool hasVideo
);
129 * Sets the text for the label \a m_nameLabel and assures that the
130 * text is split in a way that it can be wrapped within the
131 * label width (QLabel::setWordWrap() does not work if the
132 * text represents one extremely long word).
134 void setNameLabelText(const QString
& text
);
137 * Adjusts the sizes of the widgets dependent on the available
138 * width given by \p width.
140 void adjustWidgetSizes(int width
);
145 QPointer
<KIO::PreviewJob
> m_previewJob
;
146 QTimer
* m_outdatedPreviewTimer
;
148 PixmapViewer
* m_preview
;
149 PhononWidget
* m_phononWidget
;
151 Baloo::FileMetaDataWidget
* m_metaDataWidget
;
152 QScrollArea
* m_metaDataArea
;
153 QLabel
* m_configureLabel
;
154 QDialogButtonBox
* m_configureButtons
;
156 PlacesItemModel
* m_placesItemModel
;
159 #endif // INFORMATIONPANELCONTENT_H