]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/infosidebarpage.h
Use Xesam ontology instead of NIE. Since Strigi uses Xesam and we have no mapping...
[dolphin.git] / src / infosidebarpage.h
index c9b15bdac11c10728195fce71a87d7c24f74afa4..ef014b3163d696146a8b83546ca394b1a3de536a 100644 (file)
 #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;
 
@@ -59,6 +51,9 @@ public:
     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);
@@ -67,12 +62,12 @@ public slots:
     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() */
@@ -110,29 +105,36 @@ private:
     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;
@@ -141,10 +143,9 @@ private:
     KUrl m_urlCandidate;
 
     PixmapViewer* m_preview;
-    QLabel* m_name;
+    QLabel* m_nameLabel;
 
-    QString m_infoLines;
-    QLabel* m_infos;
+    QLabel* m_infoLabel;
 
     MetaDataWidget* m_metadataWidget;
 };