]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinstatusbar.h
* Use Nepomuk for getting the meta data instead of KFileMetaInfo.
[dolphin.git] / src / dolphinstatusbar.h
index 1a9aaa4c172c53ccd90709d8d0f103ceeba76712..e28c1c4f46121900c2df61fddd84f42bd03a8b52 100644 (file)
@@ -27,8 +27,11 @@ class DolphinView;
 class KUrl;
 class StatusBarMessageLabel;
 class StatusBarSpaceInfo;
-class QProgressBar;
 class QLabel;
+class QProgressBar;
+class QToolButton;
+class QSlider;
+class QTimer;
 
 /**
  * @brief Represents the statusbar of a Dolphin view.
@@ -53,8 +56,7 @@ public:
         Error
     };
 
-    DolphinStatusBar(QWidget* parent,
-                     const KUrl& url);
+    DolphinStatusBar(QWidget* parent, DolphinView* view);
 
     virtual ~DolphinStatusBar();
 
@@ -115,6 +117,11 @@ public:
     void setDefaultText(const QString& text);
     const QString& defaultText() const;
 
+    /**
+     * Refreshes the status bar to get synchronized with the (updated) Dolphin settings.
+     */
+    void refresh();
+
 protected:
     /** @see QWidget::resizeEvent() */
     virtual void resizeEvent(QResizeEvent* event);
@@ -130,16 +137,46 @@ private slots:
     void updateSpaceInfoContent(const KUrl& url);
 
     /**
-     * Shows the space information if there is enough room to show it
-     * without the need to clip the status bar text. If the progress
-     * bar is shown, the space information won't be shown.
+     * Sets the zoom level of the item view to \a zoomLevel.
      */
-    void showSpaceInfo();
+    void setZoomLevel(int zoomLevel);
+
+    /**
+     * Assures that the text of the statusbar stays visible by hiding
+     * the space information widget or the zoom slider widget if not
+     * enough width is available.
+     */
+    void assureVisibleText();
+
+    void zoomOut();
+    void zoomIn();
+    void showZoomSliderToolTip(int zoomLevel);
 
 private:
+    /**
+     * Makes the space information widget and zoom slider widget
+     * visible, if \a visible is true and the settings allow to show
+     * the widgets. If \a visible is false, it is assured that both
+     * widgets are hidden.
+     */
+    void setExtensionsVisible(bool visible);
+
+    /**
+     * Updates the text of the zoom slider tooltip to show
+     * the currently used size.
+     */
+    void updateZoomSliderToolTip(int zoomLevel);
+
+private:
+    DolphinView* m_view;
     StatusBarMessageLabel* m_messageLabel;
     StatusBarSpaceInfo* m_spaceInfo;
 
+    QWidget* m_zoomWidget;
+    QToolButton* m_zoomOut;
+    QSlider* m_zoomSlider;
+    QToolButton* m_zoomIn;
+
     QLabel* m_progressText;
     QProgressBar* m_progressBar;
     int m_progress;