]>
cloud.milkyroute.net Git - dolphin.git/blob - src/panels/information/informationpanelcontent.h
1 /***************************************************************************
2 * Copyright (C) 2009 by Peter Penz <peter.penz@gmx.at> *
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
23 #include <panels/panel.h>
41 * @brief Manages the widgets that display the meta information
42 * for file items of the Information Panel.
44 class InformationPanelContent
: public Panel
49 explicit InformationPanelContent(QWidget
* parent
= 0);
50 virtual ~InformationPanelContent();
53 * Shows the meta information for the item \p item.
54 * The preview of the item is generated asynchronously,
55 * the other meta informations are fetched synchronously.
57 void showItem(const KFileItem
& item
);
60 * Shows the meta information for the items \p items.
62 void showItems(const KFileItemList
& items
);
65 * Opens a menu which allows to configure which meta information
68 void configureSettings();
71 /** @see QObject::eventFilter() */
72 virtual bool eventFilter(QObject
* obj
, QEvent
* event
);
76 * Is invoked if no preview is available for the item. In this
77 * case the icon will be shown.
79 void showIcon(const KFileItem
& item
);
82 * Is invoked if a preview is available for the item. The preview
83 * \a pixmap is shown inside the info page.
85 void showPreview(const KFileItem
& item
, const QPixmap
& pixmap
);
88 * Marks the currently shown preview as outdated
89 * by greying the content.
91 void markOutdatedPreview();
93 void slotPlayingStarted();
94 void slotPlayingStopped();
98 * Checks whether the an URL is repesented by a place. If yes,
99 * then the place icon and name are shown instead of a preview.
100 * @return True, if the URL represents exactly a place.
101 * @param url The url to check.
103 bool applyPlace(const KUrl
& url
);
106 * Sets the text for the label \a m_nameLabel and assures that the
107 * text is split in a way that it can be wrapped within the
108 * label width (QLabel::setWordWrap() does not work if the
109 * text represents one extremely long word).
111 void setNameLabelText(const QString
& text
);
114 * Assures that the settings for the meta information
115 * are initialized with proper default values.
117 void initMetaInfoSettings(KConfigGroup
& group
);
120 * Temporary helper method for KDE 4.3 as we currently don't get
121 * translated labels for Nepmok literals: Replaces camelcase labels
122 * like "fileLocation" by "File Location:".
124 QString
tunedLabel(const QString
& label
) const;
131 bool m_pendingPreview
;
132 QTimer
* m_outdatedPreviewTimer
;
135 PixmapViewer
* m_preview
;
136 KSeparator
* m_previewSeparator
;
137 PhononWidget
* m_phononWidget
;
138 MetaDataWidget
* m_metaDataWidget
;
139 KSeparator
* m_metaDataSeparator
;
141 QScrollArea
* m_metaTextArea
;
142 MetaTextLabel
* m_metaTextLabel
;
145 #endif // INFORMATIONPANELCONTENT_H