#include <kdesktopfileactions.h>
#include <kvbox.h>
-namespace KIO
-{
- class Job;
-}
-
class QPixmap;
-class QIcon;
class QString;
-class QPainter;
class KFileItem;
class QLabel;
-class KVBox;
class PixmapViewer;
class MetaDataWidget;
explicit InfoSidebarPage(QWidget* parent = 0);
virtual ~InfoSidebarPage();
+ /** @see QWidget::sizeHint() */
+ virtual QSize sizeHint() const;
+
public slots:
/** @see SidebarPage::setUrl() */
virtual void setUrl(const KUrl& url);
virtual void setSelection(const KFileItemList& selection);
/**
- * Does a delayed request of information for the item of the given URL.
+ * Does a delayed request of information for the item \a item.
* If within this delay InfoSidebarPage::setUrl() or InfoSidebarPage::setSelection()
* are invoked, then the request will be skipped. Requesting a delayed item information
* makes sense when hovering items.
*/
- void requestDelayedItemInfo(const KUrl& url);
+ void requestDelayedItemInfo(const KFileItem& item);
protected:
/** @see QWidget::showEvent() */
enum { TimerDelay = 300 };
/**
- * Checks whether the an URL is repesented by a bookmark. If yes,
- * then the bookmark icon and name are shown instead of a preview.
- * @return True, if the URL represents exactly a bookmark.
+ * Checks whether the an URL is repesented by a place. If yes,
+ * then the place icon and name are shown instead of a preview.
+ * @return True, if the URL represents exactly a place.
* @param url The url to check.
*/
- bool applyBookmark(const KUrl& url);
+ bool applyPlace(const KUrl& url);
/** Assures that any pending item information request is cancelled. */
void cancelRequest();
- // TODO: the following methods are just a prototypes for meta
- // info generation...
- void createMetaInfo();
- void addInfoLine(const QString& labelText,
+ /**
+ * Shows the meta information for the current shown item inside
+ * a label.
+ */
+ void showMetaInfo();
+
+ /**
+ * Adds the texts \a labelText and \a infoText as one formated line
+ * to text.
+ */
+ void addInfoLine(QString& text,
+ const QString& labelText,
const QString& infoText);
- void beginInfoLines();
- void endInfoLines();
/**
+ * Converts the meta key \a key to a readable format into \a text.
* Returns true, if the string \a key represents a meta information
- * that should be shown.
+ * that should be shown. If false is returned, \a text is not modified.
*/
- bool showMetaInfo(const QString& key) const;
+ bool convertMetaInfo(const QString& key, QString& text) const;
private:
bool m_pendingPreview;
KUrl m_urlCandidate;
PixmapViewer* m_preview;
- QLabel* m_name;
+ QLabel* m_nameLabel;
- QString m_infoLines;
- QLabel* m_infos;
+ QLabel* m_infoLabel;
MetaDataWidget* m_metadataWidget;
};