]>
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
;
44 class KFileMetaDataWidget
;
47 class FileMetaDataWidget
;
52 * @brief Manages the widgets that display the meta information
53 * for file items of the Information Panel.
55 class InformationPanelContent
: public QWidget
60 explicit InformationPanelContent(QWidget
* parent
= nullptr);
61 ~InformationPanelContent() override
;
64 * Shows the meta information for the item \p item.
65 * The preview of the item is generated asynchronously,
66 * the other meta information are fetched synchronously.
68 void showItem(const KFileItem
& item
);
71 * Shows the meta information for the items \p items and its preview
73 void showItems(const KFileItemList
& items
);
75 KFileItemList
items();
78 * Refreshes the preview display, hiding it if needed
80 void refreshPreview();
83 void urlActivated( const QUrl
& url
);
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
;
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
);
135 QPointer
<KIO::PreviewJob
> m_previewJob
;
136 QTimer
* m_outdatedPreviewTimer
;
138 PixmapViewer
* m_preview
;
139 PhononWidget
* m_phononWidget
;
142 KFileMetaDataWidget
* m_metaDataWidget
;
144 Baloo::FileMetaDataWidget
* m_metaDataWidget
;
146 QScrollArea
* m_metaDataArea
;
148 PlacesItemModel
* m_placesItemModel
;
151 #endif // INFORMATIONPANELCONTENT_H